Documentation
Difficulty level:
API - Hook - POST hook/resource/
Incoming hook to create or update resource
POST hook/resource/
Used for
Incoming hook to create or update resource.
Authentication
Administrator access
Parameters
The table here only shows a view of the core variables.
Parameter | Description | Mandatory | Location | Example |
---|---|---|---|---|
id | Resource ID | No* | Body | |
external_id | If suppllied, a resource is searched based on this ID | No* | Body | |
desc | The description | No | Body | |
long_desc | The extended description | No | Body | |
type | 1=Location, 2=Personel, 3=default | No | Body | |
before | Time before in minutes | No | Body | |
after | Time after in minutes | No | Body | |
amount | Amount, default 1 | No | Body |
* None of the variable is mandatory by itself. A correct combination of variables is mandatory and will determine the action which will be executed
- If "id" is supplied, the resource will be updated with the supplied fields
- If "id" is not supplied, but "external_id" is supplied, then the resource will be updated which contains that external id.
- If "id" and "external_id" are not supplied or cannot be found, a new resource is created.
Example
Create or update resource.
POST api/rest/hook/resource/
Request { "external_id": "3114hqq4rqsvlhgr8s66msvju9", "type": "3", "name": "COURT1", "desc": "Tennis court 1" }
Response: { "ownerid": "10", "name": "COURT1", "desc": "Tennis court1", "long_desc": "", "type": "3", "before": "", "after": "", "amount": "1", "external_id": "3114hqq4rqsvlhgr8s66msvju9" }
If resources are added via this API, the resource should still be connected to objects.
This API is mostly used for updating existing resources.