Description
Use a HTTP POST request to create a resource.
Request
HTTP Method: POST
Parameter | Description |
---|---|
name | Name of the resource. |
value | Contents of the resource. Will be parsed as json if a valid json string is provided. |
team_id | Optional ID of Tines Team where the resource will be located. |
folder_id | Optional ID of folder to which the resource will be located |
read_access | Optional Control where this resource can be used (TEAM , GLOBAL ). default: TEAM |
description | Optional Description of the resource. default: "" (empty string) |
Sample request
curl -X POST \
https://<<META.tenant.domain>>/api/v1/global_resources \
-H 'content-type: application/json' \
-H 'x-user-email: <email-address>' \
-H 'x-user-token: <api-token>' \
-d '{
"name": "a json resource",
"value":{"fizz":"buzz"},
"team_id": 2,
"folder_id": 1
}'
Response
A successful request will return a JSON object describing the created resource.
Field description
Parameter | Description |
---|---|
id | Resource ID. |
user_id | ID of user associated with the resource. |
name | Name of the resource. |
team_id | ID of team to which the resource belongs. |
folder_id | ID of folder to which the resource belongs. |
read_access | Control where this resource can be used. |
description | Description of the resource. |
slug | An underscored representation of the resource name |
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
{
"id": 10,
"name": "a json resource",
"value": "{\"fizz\":\"buzz\"}",
"team_id": 2,
"folder_id": 1,
"user_id": 1,
"read_access": "TEAM",
"slug": "a_json_resource",
"created_at": "2020-02-05T20:40:32.313Z",
"updated_at": "2020-02-05T20:55:18.239Z",
"description": ""
}