Update a Resource
The Update method modifies an existing entity in Deepser by sending an HTTP PUT request with a JSON payload. Include only the fields you want to change. The response returns the complete entity with all fields, not just the updated ones.
Syntax
HTTP Method: PUT
URL:
http://deepserhost/api/rest/[entity]/[id]
Request body: A JSON object containing only the fields to update.
Example
The following request updates the company with ID 5:
URL:
http://deepserhost/api/rest/company/5
Request body:
{
"name" : "ACME Germany",
"parent_id" : "1",
"description" : "ACME Germany Gmbh"
}
Response:
{
"entity_id": "5",
"parent_id": "1",
"sort_order": null,
"name": "ACME Germany",
"description": "ACME Germany Gmbh",
"phone": null,
"fax": "+498587575",
"address": "Augsburger Strasse",
"city": "Berlin",
"state": "Berlin",
"country": "DE",
"zip_code": "10115",
"notes": null,
"logo": null,
"primary_contact": null,
"mailbox_id": "0",
"status": "1",
"formtemplate_id": "0",
"updated_at": "2018-10-29 16:14:10",
"created_at": "2018-10-29 15:49:33",
"payment_status": null
}
The response includes every field of the entity, regardless of whether it was modified. Only the fields specified in the request body are changed; all other fields retain their existing values.
note
Ensure the JSON keys in your request body match the entity's field codes exactly. Unrecognized keys are silently ignored.