(Quick Reference)
Service: Update an assigned route to a customer
Description: This web service is used to update an assigned customer to a route
URL:
https://BASE_URL/api/VERSION/routeCustomers/{id} Method: PUT
Request content type: application/json
Parameters:
| Name | Description | Type | Required | Example values |
|---|
| id | id of the desired record to update | Long | Yes | 123 |
| customerId | the id of customer to be assigned | Long | Yes | 111 |
| routeId | the id of the assigned route | Long | Yes | 777 |
| rank | | Integer | Yes | |
URL with external_id:
https://BASE_URL/api/VERSION/routeCustomers/reference/{routeId}/{customerId} Parameters:
| Name | Description | Type | Required | Examples values |
|---|
| routeId | reference of the route | String | Yes | R-002 |
| customerId | reference of the customer | String | Yes | C-001 |
| rank | | Integer | Yes | |
A customer can only be assigned one time to a route
Success Output
Success case: response.status = 200
{
"id": 7,
"rank": 4,
"route": {
"id": 4,
"reference": "R-R-001",
"href": "/api/v1.0/routes/4"
},
"customer": {
"id": 2,
"reference": "R-CUS2",
"href": "/api/v1.0/customers/2"
},
"organization": "entity1",
"dateCreated": "2016-10-19T09:33:05Z",
"lastUpdated": "2016-10-19T09:42:20Z"
}
Failure Output
Failure case:response.status = 400
{
"error": "invalid_param_type",
"error_description": "The type of parameter routeId you provided is not valid for this request."
}
{
"error": "missing_param",
"error_description": "customerId parameter is missing"
}
{
"error": "invalid_param_type",
"error_description": "An invalid value was specified for parameter: rank (must be Integer)"
}
{
"error": "update_not_authorized",
"error_description": "the specified route is already assigned to the specified customer"
}
{
"error": "invalid_param_type",
"error_description": "An invalid value was specified for parameter: rank of a customer (must be Less than 2)"
}
{
"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..."
}