(Quick Reference) Service: Assign customer to employee

Description: This web service is used to assign a customer to an employee, the data created will be returned in JSON format

URL:

https://BASE_URL/api/VERSION/customerEmployees

Method: POST

Request content type: application/json

Parameters:

NameDescriptionTypeRequiredExample values
userIdthe id of the employeeLong/StringYes777
customerIdthe id of the customer to assignLong/StringYes 
useExternalIdBy default, it is set to false. set it to true if you want to use external ids.Booleannotrue , false
The customer can only be assigned just one time

Success Output

Success case: response.status=201
{
    "id": 6,
    "name": "okawa",
    "reference": "9999",
    "organization": "Lyon",
    "description": null,
    "dateCreated": "2016-08-17T14:59:43Z",
    "lastUpdated": "2016-08-17T14:59:43Z"
}

Failure Output

Failure case:response.status = 400
{
    "error": "missing_param",
    "error_description": "userId parameter is missing"
}
"error": "already_assigned",
    "error_description": "customer 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..."
}