(Quick Reference)
Service: Update a route
Description: This web service is used to update an existing route object of specified id to the database
URL:
https://BASE_URL/api/VERSION/routes/{id}
URL with external_id:
https://BASE_URL/api/VERSION/routes/reference/{id}
Method: PUT
Request content type: application/json
Parameters:
Name | Description | Type | Required | Example values |
---|
id | id of the desired record to update | Long/String | Yes | 123 |
name | the name of the new route | String | Yes | |
reference | the reference of the new appointment | String | Yes | |
geographicLocationId | the id of region which the route will be associated | Long | No | |
geographicLocationId
must be an ID of a leaf region located within the geographical positions’ hierarchical tree
reference
must be unique
Success Output
Success case: response.status = 200
{
"id": 2,
"reference": "R-RT-001",
"name": "fast and furious",
"geographicLocation": {
"id": 3,
"name": "Nice",
"href": "/api/v1.0/regions/3"
},
"organization": "entity1",
"dateCreated": "2016-10-17T14:05:54Z",
"lastUpdated": "2016-10-18T09:52:10Z"
}
Failure Output
Failure case:response.status = 400
{
"error": "invalid_param_type",
"error_description": "The type of parameter geographicLocationId you provided is not valid for this request."
}
{
"error": "missing_param",
"error_description": "name parameter is missing"
}
{
"error": "not_unique",
"error_description": "reference already used"
}
{
"error": "save_failed",
"error_description": "Failed to save instance"
}
Failure case:response.status = 404
{
"error": "not_found",
"error_description": "The geographic location with the id 999 doesn't exist."
}
Failure case:response.status = 500
{
"error": "server_error",
"error_description": "Oops! Something went wrong..."
}