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. When a non-JSON string is passed in, it will be parsed as regular text. |
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 , SPECIFIC_TEAMS ). default: TEAM . (SPECIFIC_TEAMS is a premium feature. Reach out to find out more.) |
shared_team_slugs | Optional List of teams' slugs where this resource can be used. Required to set read_access to SPECIFIC_TEAMS . default: [] (empty array). |
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-token: <api-token>' \
-d '{
"name": "foo",
"value": "bar"
}'
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 (TEAM , GLOBAL , SPECIFIC_TEAMS ). |
shared_team_slugs | List of teams' slugs where this resource can be used when read_access is SPECIFIC_TEAMS , otherwise empty. |
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": 9,
"name": "foo",
"value": "bar",
"team_id": 2,
"folder_id": 1,
"user_id": 1,
"read_access": "TEAM",
"shared_team_slugs": [],
"slug": "foo",
"created_at": "2020-02-05T20:40:32.313Z",
"updated_at": "2020-02-05T20:55:18.239Z",
"description": ""
}