(Quick Reference)
73 Reports - Reference Documentation
Version: 2.1
73 Reports
73.1 List
Service: List of reports
Description: This web service return the list of reports in JSON format
URL:
https://BASE_URL/api/VERSION/reports
Method: GET
Parameters:
Pagination parameters:
Name | Description | Type | Required | Possible values |
---|
offset | Tells where to start returning records from the entire set of results | Integer | No | |
max | limits the number of resources requested to return | Integer | No | |
sort | Orders the results by the specified field | String | No | |
order | Orders ascending (ASC) or descending DESC | Integer | No | asc, desc |
Filters parameters:
Name | Description | Type | Required | Example values |
---|
dateCreated_gt | Filters by the resource's creation date time and operator greater than | Date | no | 2016-08-15T14:52:48Z |
dateCreated_gte | Filters by the resource's creation date time and operator greater than or equal | Date | no | |
dateCreated_lt | Filters by the resource's creation date time and operator less than | Date | no | |
dateCreated_lte | Filters by the resource's creation date time and operator less than or equal | Date | no | |
lastUpdated_gt | Filters by the resource's last-modified date time and operator greater than | Date | no | |
lastUpdated_gte | Filters by the resource's last-modified date time and operator greater than or equal | Date | no | |
lastUpdated_lt | Filters by the resource's last-modified date time and operator less than | Date | no | |
lastUpdated_lte | Filters by the resource's last-modified date time and operator less than or equal | Date | no | |
customerReference | Wildcard search by the resource's customer reference | String | no | customerReference=Ref-6* , customerReference=*ef-6 , customerReference=*ef-6* |
title | Wildcard search by the resource's title | String | no | |
employeeReference | Wildcard search by the resource's employee reference | String | no | employeeReference=Ref-6* , employeeReference=*ef-6 , employeeReference=*ef-6* |
Success Output
Success case: response.status=200
{
"paging": {
"total": 26,
"max": 1,
"offset": 0,
"previous": null,
"next": "/api/v1.0/reports?max=1&offset=1&sort=dateCreated&order=asc"
},
"data": [
{
"id": 2,
"title": "Marie's Jewelry complaint ",
"description": "Shipped Wrong Quantity",
"image": "BASE_URL/entity1-1450169988465/photoNotes/1471338230737_logo_color_272x92dp.png",
"latitude": 35.835454,
"longitude": 10.590584,
"checkInDate": "2015-12-31T15:48:32Z",
"type": "1",
"customerId": 2,
"customer": {
"id": 2,
"reference": "NC-3",
"name": "Marie's Jewelry",
"href": "/api/v1.0/customers/2"
},
"user": {
"id": 2,
"reference": "emp-002",
"href": "/api/v1.0/users/2"
},
"organization": "entity1",
"dateCreated": "2015-12-31T15:48:32Z",
"lastUpdated": "2015-12-31T15:48:32Z"
}
]
}
Failure Output
Failure case:response.status = 400
{
"error": "invalid_param",
"error_description": "The parameters [dateCreated_gta] you provided are not valid for this request."
}
{
"error": "invalid_datetime_format",
"error_description": "Invalid datetime filter (not ISO-8601 formatted): [2016-08-1Z]"
}
Failure case:response.status = 500
{
"error": "server_error",
"error_description": "Oops! Something went wrong..."
}
73.2 Show
Service: Show a report
Description: This web service return a report details of the specified id in JSON format
URL:
https://BASE_URL/api/VERSION/reports/{id}
Method: GET
Parameters:
Name | Description | Type | Required | Example values |
---|
id | id of the desired report | Long | Yes | 777 |
Success Output
Success case: response.status=200
{
"id": 2,
"title": "Marie's Jewelry complaint",
"description": "Late Shipment",
"image": "BASE_URL/entity1-1450169988465/photoNotes/1471338230737_logo_color_272x92dp.png",
"latitude": 35.835454,
"longitude": 10.590584,
"checkInDate": "2015-12-31T15:48:32Z",
"type": "1",
"customerId": 2,
"customer": {
"id": 2,
"reference": "NC-3",
"name": "Marie's Jewelry",
"href": "/api/v1.0/customers/2"
},
"user": {
"id": 2,
"reference": "emp-002",
"href": "/api/v1.0/users/2"
},
"organization": "entity1",
"dateCreated": "2015-12-31T15:48:32Z",
"lastUpdated": "2015-12-31T15:48:32Z"
}
Failure Output
Failure case:response.status = 400
{
"error": "invalid_param_type",
"error_description": "The type of parameter id you provided is not valid for this request."
}
Failure case:response.status = 404
{
"error": "not_found",
"error_description": "The report with the id 7 doesn't exist."
}
73.3 Save
Service: Save a report
Description: This web service is used to add a new report object to the database
URL:
https://BASE_URL/api/VERSION/reports
Method: POST
Request content type: application/x-www-form-urlencoded or multipart/form-data
Parameters:
Name | Description | Type | Required | Example values |
---|
title | the title of the new report | String | Yes | |
description | the description related to the the new report | String | Yes | |
latitude | | String | No | |
longitude | | String | No | |
checkInDate | | String | No | 2016-09-21T17:00:00Z |
customerId | The numerical ID of customer | Integer/String | no | |
userId | The numerical ID of user. By default, it is set to the current connected user | Long/String | no | |
type | indicate the report type | String | No | |
imageFile | Image can be in jpg, gif, png or bmp format | Multipart | no | |
useExternalId | By default, it is set to false. set it to true if you want to use external ids. | Boolean | no | true , false |
type
can only be equal to "1" (Customer complaint) , "2" (Customer note) or "3" (Manager note)
Success Output
Success case: response.status=201
{
"id": 2,
"title": "Marie's Jewelry complaint ",
"description": "Shipped Wrong Quantity",
"image": "BASE_URL/entity1-1450169988465/photoNotes/1471338230737_logo_color_272x92dp.png",
"latitude": 35.835454,
"longitude": 10.590584,
"checkInDate": "2015-12-31T15:48:32Z",
"type": "1",
"customerId": 2,
"customer": {
"id": 2,
"reference": "NC-3",
"name": "Marie's Jewelry",
"href": "/api/v1.0/customers/2"
},
"user": {
"id": 2,
"reference": "emp-002",
"href": "/api/v1.0/users/2"
},
"organization": "entity1",
"dateCreated": "2015-12-31T15:48:32Z",
"lastUpdated": "2015-12-31T15:48:32Z"
}
Failure Output
Failure case:response.status = 400
{
"error": "missing_param",
"error_description": "title parameter is missing"
}
{
"error": "invalid_param_type",
"error_description": "The type of parameter latitude you provided is not valid for this request."
}
{
"error": "not_in_list_error",
"error_description": "Failed to Save the Report , because type can have only these values [ 1,2,3 ]"
}
{
"error":"invalid_datetime_format",
"error_description": "Invalid datetime format for checkInDate it must be in this form : dd-MM-yyyy HH:mm"
}
{
"error": "save_failed",
"error_description": "Failed to save instance"
}
Failure case:response.status = 404
{
"error": "not_found",
"error_description": "The customer with the id 999 doesn't exist."
}
Failure case:response.status = 500
{
"error": "server_error",
"error_description": "Oops! Something went wrong..."
}
73.4 Delete
Service: Delete a report
Description: This web service is used in order to delete a report object from the database
URL:
https://BASE_URL/api/v1.0/reports/{id}
Method: DELETE
Parameters:
Name | Description | Type | Required | Examples values |
---|
id | Id of the desired report to delete | Long | Yes | 777 |
Success Output
Success case: response.status=200
{
"success": "true",
"success_description": "Instance deleted successfully"
}
Failure Output
Failure case:response.status = 400
{
"error": "invalid_param_type",
"error_description": "The type of parameter id you provided is not valid for this request."
}
Failure case:response.status = 404
{
"error": "not_found",
"error_description": "The report with the id 1 doesn't exist."
}
Failure case:response.status = 500
{
"error": "server_error",
"error_description": "Oops! Something went wrong..."
}
73.5 Update
Service: Save a report
Description: Returns the updated report in json format when successful. Returns a json response, describing the failure condition when unsuccessful.
URL:
https://BASE_URL/api/VERSION/reports/{id}
Method: POST
Request content type: application/x-www-form-urlencoded or multipart/form-data
Parameters:
Name | Description | Type | Required | Example values |
---|
id | The numerical ID of the desired reason | Integer | yes | 123 |
title | the title of the new report | String | Yes | |
description | the description related to the the new report | String | Yes | |
latitude | | String | No | |
longitude | | String | No | |
checkInDate | | String | No | 2016-09-21T17:00:00Z |
customerId | The numerical ID of customer | Integer/String | no | |
userId | The numerical ID of user. By default, it is set to the current connected user | Long/String | no | |
type | indicate the report type | String | No | |
imageFile | Image can be in jpg, gif, png or bmp format | Multipart | no | |
useExternalId | By default, it is set to false. set it to true if you want to use external ids. | Boolean | no | true , false |
type
can only be equal to "1" (Customer complaint) , "2" (Customer note) or "3" (Manager note)
Success Output
Success case: response.status=200
{
"id": 2,
"title": "Marie's Jewelry complaint ",
"description": "Shipped Wrong Quantity",
"image": "BASE_URL/entity1-1450169988465/photoNotes/1471338230737_logo_color_272x92dp.png",
"latitude": 35.835454,
"longitude": 10.590584,
"checkInDate": "2015-12-31T15:48:32Z",
"type": "1",
"customerId": 2,
"customer": {
"id": 2,
"reference": "NC-3",
"name": "Marie's Jewelry",
"href": "/api/v1.0/customers/2"
},
"user": {
"id": 2,
"reference": "emp-002",
"href": "/api/v1.0/users/2"
},
"organization": "entity1",
"dateCreated": "2015-12-31T15:48:32Z",
"lastUpdated": "2015-12-31T15:48:32Z"
}
Failure Output
Failure case:response.status = 400
{
"error": "missing_param",
"error_description": "title parameter is missing"
}
{
"error": "invalid_param_type",
"error_description": "The type of parameter latitude you provided is not valid for this request."
}
{
"error": "not_in_list_error",
"error_description": "Failed to Save the Report , because type can have only these values [ 1,2,3 ]"
}
{
"error":"invalid_datetime_format",
"error_description": "Invalid datetime format for checkInDate it must be in this form : dd-MM-yyyy HH:mm"
}
{
"error": "save_failed",
"error_description": "Failed to save instance"
}
Failure case:response.status = 404
{
"error": "not_found",
"error_description": "The customer with the id 999 doesn't exist."
}
Failure case:response.status = 500
{
"error": "server_error",
"error_description": "Oops! Something went wrong..."
}