PUT Request - Replacing content of existing records
3 min
PUT requests update an existing record to match completely the content of the sent message. This differs to the PATCH requests, which allow the targeted update of a few specific fields. Example use cases for the two request types:
- Synchronise a record from an authoritative source (e.g. a Supplier record from a HR system) to Servicely - ensuring that the state is EXACTLY as in the source HR system - use PUT.
- Update a changed contact number or email address from a CRM system to Servicely, but keep any information being tracked by Servicely that the CRM system does not have in place - use PATCH.
URL Format
Single record
The format to insert a single record is:
https://[instance-url]/v1/[table-name]https://[instance-url]/v1/[table-name]
Example:
Example: Reset user record
Any field which was not specified in the above request will be reset to an empty value.
System or Managed fields will not be affected.
➜ ~ https PUT https://sandbox.servicely.ai/v1/User/c0a8011645fb1a608145fb3102b10000 \
Email="[email protected]" \
FirstName="Erik" \
LastName="Employee" \
Name="Erik Employee" \
Email="[email protected]" \
UserName="erik.employee"
HTTP/1.1 200 OK
Content-Encoding: gzip
Content-Length: 331
Content-Type: application/json
{
"data": {
"Active": false,
"CreatedBy": "4028818a3b214291013b21504a000000",
"CreatedOn": "2020-01-01T14:44:24.853Z",
"Email": "[email protected]",
"FirstName": "Erik",
"LastName": "Employee",
"LockedOut": false,
"Name": "Erik Employee",
"SID": "LBoawmmFanX4V",
"SelectableForAssignment": false,
"SelectableForRequests": false,
"TableClass": "User",
"UpdatedBy": "4028818a3b214291013b21504a000000",
"UpdatedOn": "2021-06-16T11:53:24.309Z",
"UserName": "erik.employee",
"VIP": false,
"Version": 18,
"id": "c0a8011645fb1a608145fb3102b10000"
}
}