(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:

NameDescriptionTypeRequiredExample values
idid of the desired recordLongYes111
userIdthe id of the employeeLongYes777
customerIdthe id of the customer to assignLongYes777

URL with external_id:

https://BASE_URL/api/VERSION/employeeItemCategories/reference/{itemCategoryId}/{userId}

Parameters:

NameDescriptionTypeRequiredExamples values
itemCategoryIdreference of the item categoryStringYesCC-002
userIdreference of the userStringYesU-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..."
}