Description
Use a HTTP PUT request to update a resource. If the resource has a test value this can be modified by using the is_test parameter.
Request
HTTP Method: PUT
Parameter | Description |
---|---|
resource_id | The ID of the live resource. |
value | Contents of the resource. |
name | Optional Name of the resource. |
folder_id | Optional The ID of the folder to move the resource to, or an empty value to indicate the root folder. Note that this folder must exist within the team identified by team_id , or the resource's current team if team_id isn't specified. |
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). |
test_resource_enabled | Optional Boolean value stating if the resource is enabled for using a test. resource |
is_test | Optional Boolean value stating if the test resource should be updated. test_resource_enabled must be set to TRUE and a test resource must exist for the update to succeed. |
include_referencing_action_ids | Optional Defaults to true , when set to false we will exclude referencing_action_ids from the response |
Sample request
curl -X PUT \
https://<<META.tenant.domain>>/api/v1/global_resources/<<resource_id>> \
-H 'content-type: application/json' \
-H 'Authorization: Bearer <<CREDENTIAL.tines_api_key>>' \
-d '{
"value":"updated resource value"
}'
Response
A successful request will return a JSON object describing the updated resource. Test resource data is contained within the live resource.
Field description
Parameter | Description |
---|---|
id | Resource ID. |
name | Name of the resource. |
value | Value of the resource. |
team_id | ID of team to which the resource belongs. |
folder_id | ID of folder to which the resource belongs. |
user_id | ID of user associated with the resource. |
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. |
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. |
description | Description of the resource. |
test_resource_enabled | A boolean value stating if the resource is enabled for using a test resource. |
test_resource | JSON block of the test resource. |
referencing_action_ids | IDs of action that are referencing the Resource. |
Sample response
{
"id": 9,
"name": "an array resource",
"value": "updated resource value",
"team_id": 1,
"folder_id": 1,
"user_id": 1,
"read_access": "TEAM",
"shared_team_slugs": [],
"slug": "an_array_resource",
"created_at": "2020-02-05T20:40:32.313Z",
"updated_at": "2020-02-05T20:55:18.239Z",
"description": "",
"test_resource_enabled": false
}