Update an existing client record
Update
| Parameter | Mandatory | Description | Examples | More Info |
|---|---|---|---|---|
| API | Yes | The API area | clients.json | |
| General | Yes | Parameters described in overview | Authorization: Bearer <access_token> header — see Synergist API Authentication | Structure of an API call |
| Action | Yes | The action to perform | action=update | |
| Input | Yes | JSON string | See below |
| JSON Input | Mandatory | Description | Examples |
|---|---|---|---|
| Identifier | Yes | Client ID or UUID | "clientCode":"1/P0909" |
| Update data | Yes | Data to update | "clientName":"NewCompanyInc" |
Example request (OAuth 2.0):
Authorization: Bearer <access_token>
http://<SERVER>/jsonapi/clients.json?&version=6&action=update&input={
"data": [
{
"clientCode": "1/P0909",
"clientName": "NewCompanyInc"
}
]
}
Example request (legacy username/password):
http://<SERVER>/jsonapi/clients.json?&version=6&action=update&input={
"data": [
{
"clientCode": "1/P0909",
"clientName": "NewCompanyInc"
}
]
}&user=<username>&password=<password>
Example response:
{
"responsecode": 1,
"responsestatus": "OK",
"errorcode": 0,
"errormessage": "",
"responsemessage": "data processed successfully.",
"warningmessage": "",
"success": true,
"data": [
{
"clientCode": "1/P0909",
"clientUuid": "493686EA86774194831FFE438B031917",
"clientTimeStampModified": 1544093783,
"clientRecordVersionNumber": 97
}
]
}Note:
To discover which fields are editable make a call to the "Client details" endpoint and specify '&style=modelstructure' see Meta-data
