Description
Use a HTTP PUT request to update a global resource.
Request
HTTP Method: PUT
Parameter | Description |
---|---|
id | The ID of the global resource to update. |
name | Name of the global resource. |
value_type | Global resource type, either: text , json or array . |
value | Contents of the global resource. |
Sample request
curl -X PUT \
https://<tenant-name>.tines.io/api/v1/global_resources/<global-resource-id> \
-H 'content-type: application/json' \
-H 'x-user-email: <email-address>' \
-H 'x-user-token: <api-token>'
-d '{
"name": "an array resource",
"value_type": "array",
"value":"[1,2,3,4,5]"
}'
Response
A successful request will return a JSON object describing the created resource.
Field description
Parameter | Description |
---|---|
id | Global resource ID. |
user_id | ID of user associated with the resource. |
name | Name of the global resource. |
value_type | Global resource type, either: text , json or array |
created_at | ISO 8601 Timestamp representing date and time the resource was created. |
updated_at | ISO 8601 Timestamp representing date and time the resource was last updated. |
Sample response
{
"value_type": "array",
"id": 9,
"name": "an array resource",
"value": "[1,2,3,4,5]",
"user_id": 1,
"created_at": "2020-02-05T20:40:32.313Z",
"updated_at": "2020-02-05T20:55:18.239Z"
}