(Quick Reference)
Service: Assign an assigned item category to a new employee
Description: This web service is used to update an assigned item category to an employee to the database
Method: PUT
Request content type: application/json
URL:
https://BASE_URL/api/VERSION/employeeItemCategories/{id}
Parameters:
Name | Description | Type | Required | Example values |
---|
id | id of the desired record | Long | Yes | 111 |
userId | the id of the employee | Long | Yes | 777 |
customerId | the id of the customer to assign | Long | Yes | 777 |
URL with external_id:
https://BASE_URL/api/VERSION/employeeItemCategories/reference/{itemCategoryId}/{userId}
Parameters:
Name | Description | Type | Required | Examples values |
---|
itemCategoryId | reference of the item category | String | Yes | CC-002 |
userId | reference of the user | String | Yes | U-001 |
Success Output
Success case: response.status=201
{
"id": 570,
"employeeReference": "Emp-3",
"itemCategoryReference": "R-A-001",
"itemCategory": {
"id": 1751,
"reference": "R-A-001",
"name": "category1",
"href": "/api/v1.0/itemCategories/1751"
},
"employee": {
"id": 23,
"reference": "Emp-3",
"name": "new Employee",
"href": "/api/v1.0/employees/23"
},
"organization": "Lyon",
"dateCreated": "2016-08-22T09:42:19Z",
"lastUpdated": "2016-08-22T09:42:19Z"
}
Failure Output
Failure case:response.status = 400
{
"error": "missing_param",
"error_description": "userId parameter is missing"
}
"error": "already_assigned",
"error_description": "item category is already assigned to employee."
{
"error": "save_failed",
"error_description": "Failed to save instance"
}
Failure case:response.status = 404
{
"error":"not_found",
"error_description": "The user with the id 999 doesn't exist."
}
Failure case:response.status = 500
{
"error": "server_error",
"error_description": "Oops! Something went wrong..."
}