Skip to end of metadata
Go to start of metadata

You are viewing an old version of this page. View the current version.

Compare with Current View Page History

Version 1 Next »

/report/{report_id}
Retrieves/Modifies a specific report, if no id is given updates the first report found for this user (currently users are only support to have 1 report so not sending an id is fine)
Possible Methods

GET POST PUT DELETE

Arguments

report_id(optional)
Report to modify

Json Object
{
        public String report_id;
    	public List<ReportDataPojo> report;
}

ReportDataPojo
{
	public int index;
    public String data;
    public String note;
    public Date created_date;
}

 

Example
curl -b cookies.txt -X GET "http://localhost:8185/report" > response.txt
curl -b cookies.txt -X GET "http://localhost:8185/report/5331abfdb8e06221ba4a3b8a" > response.txt
curl -b cookies.txt -X POST -d '{"report":[{"index":0,"data":"88343","note":"nothing to see here", "created_date":"May 1, 2014 01:39:49 PM UTC"},{"index":1,"data":"asfd","note":"nothing to see here"}]}' "http://localhost:8185/report" > response.txt
curl -b cookies.txt -X PUT -d '{"report":[{"index":0,"data":"88343","note":"nothing to see here", "created_date":"May 1, 2014 01:39:49 PM UTC"},{"index":1,"data":"asfd","note":"nothing to see here"}]}' "http://localhost:8185/report" > response.txt
curl -b cookies.txt -X DELETE "http://localhost:8185/report" > response.txt

 

Example Response
curl -b cookies.txt -X POST -d '{"report":[{"index":0,"data":"88343","note":"nothing to see here", "created_date":"May 1, 2014 01:39:49 PM UTC"},{"index":1,"data":"asfd","note":"nothing to see here"}]}' "http://localhost:8185/report" > response.txt

 

 {
    "response": {
        "action": "Report",
        "success": true,
        "message": "Created a new report successfully",
        "time": 0
    },
    "data": {
        "report_id": "536401dc78ea6fd12b61222e",
        "report": [
            {
                "index": 0,
                "data": "88343",
                "note": "nothing to see here",
                "created_date": "May 1, 2014 01:39:49 PM UTC"
            },
            {
                "index": 1,
                "data": "asfd",
                "note": "nothing to see here",
                "created_date": "May 2, 2014 08:40:24 PM UTC"
            }
        ]
    }
}
  • No labels