API Verbs and Format
Estimated reading: 2 minutes
HTTP verbs are used to manage the state of resources.
In Deepser REST API there are four verbs used to manage resources: GET, POST, PUT, and DELETE.
You can:
- Create new entity data using HTTP POST
- Retrive the contents of the data using HTTP GET
- Update the data using PUT
- Delete the data using HTTP DELETE
API AUTHORIZATION
Deepser API uses those methods to get, create, update or delete entities.
Based on the entity, on the role and the permissions of the logged-in user, there are different actions allowed.
The details will be explained in the next chapters, but you must remember the actions implemented by the API are:
- Create: to create a single resource (HTTP POST)
- Retrieve: to get a single resource (HTTP GET)
- Update: to update a single resource (HTTP PUT)
- Delete: to delete a single resource (HTTP DELETE)
- Multiple Retrieve: to get multiple resources (HTTP GET)
- Multiple Create: to create multiple resources (HTTP POST)
- Multiple Update: : to update multiple resources (HTTP PUT)
Multiple Delete is not allowed for Security Reasons.
API FORMAT
The REST API response is a JSON object, depending on the resource requested.
A brief example (we will describe in the next chapters in details) is the following:
{
"totalRecords":2,
"items":[
{
"entity_id":"1",
"parent_id":"0",
"sort_order":null,
"name":"ACME International",
"description":"ACME International – Main Company of the group",
"phone":"0288396",
"fax":"998266",
"address":"Madison Square Garden",
"city":"NY",
"state":"NY",
"country":"USA",
"zip_code":"00195",
"notes":null,
"logo":"company/image/a/c/acme_usa.png",
"primary_contact":"4\\euclid",
"mailbox_id":"0",
"status":"1",
"formtemplate_id":"56",
"updated_at":"2018-07-12 08:43:13",
"created_at":"2018-06-19 13:30:41"
},
{
"entity_id":"2",
"parent_id":"1",
"sort_order":null,
"name":"ACME France",
"description":"ACME France",
"phone":null,
"fax":null,
"address":"Roux de Strasse",
"city":"Paris",
"state":"Paris",
"country":"France",
"zip_code":"75000",
"notes":null,
"logo":"company/image/a/c/acme_fr_1.png",
"primary_contact":"4\\euclid",
"mailbox_id":"0",
"status":"1",
"formtemplate_id":"56",
"updated_at":"2018-07-12 08:43:56",
"created_at":"2018-06-19 13:33:57"
}
]
}