Update sync job template
/sync-job-template/{id}
Path Parameters
The ID of the sync job template to update.
Request Body
JSON schema defining the structure of the arguments that can be passed to the sync job. Same shape as JsonSchemaObject (top-level { type: "object", properties }).
{
"type": "object",
"properties": {
"project_slug": {
"type": "string",
"description": "The project slug of the project on CircleCI. Its in the format vcs_provider/org_name/repo_name.",
"required": true
}
}
}
Map of property name → JsonSchemaObjectProperties.
object
The default runtime version for sync jobs using this template.
Optional longer description of what this template does.
Fetches contacts from ZendeskIf you want to change the integration for the template.
A short descriptor for the template.
The resource that this resource depends on (parent resource). This is optional and can be used to sync a resource only after another resource has been synced. Each object synced for the parent resource is available as the resources object in placeholders for the child resource, e.g. {{resources.crm.contacts.id}} if depends on is crm/contacts resource.
crm/contactsThe ID of the resource to sync. This is optional and can be used to sync a single resource. It also supports placeholders.
Static value like `4a4de828-f4db-4c9e-adfd-434e0864c3c7` or placeholder like `{{args.user_id}}`.When a particular placeholder argument is an array and you want to repeat the request for each element in that array, you can set this parameter. For example, if you accept an argument called user_ids which is an array of strings, and you want to fetch each user's details, you can set this parameter to user_ids and the request will be repeated for each element in the user_ids array.
{"{ args.user_ids }":null}The method to call on the resource.
listWhether to persist the resource in the database or not in case of a Daemon sync job run or send as a payload in case of RapidBridge sync job run. The Proxy API resources are by default NOT persisted and this parameter can be set to true to persist them. Unified API resources are always persisted.
The query parameters to pass to the resource method. It supports placeholders for values.
{
"page": 1,
"per_page": 100,
"user_id": "{{args.user_id}}"
}
The name of the resource to sync. For Unified APIs, it should be in the format unified_api_name/resource_name. For Proxy API, it can just be resource_name.
For fetching Contacts from CRM Unified API, `crm/contacts`. For fetching Contacts from a Proxy API, `contacts`.allowaskdeny
Timestamp automatically updated.
Response Body
Optional JSON schema describing arguments for the sync job.
{
"type": "object",
"properties": {
"project_slug": {
"type": "string",
"description": "The project slug of the project on CircleCI. Its in the format vcs_provider/org_name/repo_name.",
"required": true
}
}
}
Map of property name → JsonSchemaObjectProperties.
object
When the template was created.
2024-01-10T10:00:00.000ZThe runtime version for any sync job that uses this template.
2Optional longer description of what this template does.
Fetches contacts from ZendeskThe unique ID of the sync job template.
The integration name to which this template applies. Is null for default_runtime_version > 4.
zendeskA short descriptor for the template.
Zendesk contacts syncA list of sync job resources that define the steps. If empty, no default resources are set.
The resource that this resource depends on (parent resource). This is optional and can be used to sync a resource only after another resource has been synced. Each object synced for the parent resource is available as the resources object in placeholders for the child resource, e.g. {{resources.crm.contacts.id}} if depends on is crm/contacts resource.
crm/contactsThe ID of the resource to sync. This is optional and can be used to sync a single resource. It also supports placeholders.
Static value like `4a4de828-f4db-4c9e-adfd-434e0864c3c7` or placeholder like `{{args.user_id}}`.When a particular placeholder argument is an array and you want to repeat the request for each element in that array, you can set this parameter. For example, if you accept an argument called user_ids which is an array of strings, and you want to fetch each user's details, you can set this parameter to user_ids and the request will be repeated for each element in the user_ids array.
{"{ args.user_ids }":null}The method to call on the resource.
listWhether to persist the resource in the database or not in case of a Daemon sync job run or send as a payload in case of RapidBridge sync job run. The Proxy API resources are by default NOT persisted and this parameter can be set to true to persist them. Unified API resources are always persisted.
The query parameters to pass to the resource method. It supports placeholders for values.
{
"page": 1,
"per_page": 100,
"user_id": "{{args.user_id}}"
}
The name of the resource to sync. For Unified APIs, it should be in the format unified_api_name/resource_name. For Proxy API, it can just be resource_name.
For fetching Contacts from CRM Unified API, `crm/contacts`. For fetching Contacts from a Proxy API, `contacts`.The sharing policy of the template.
denyallowaskdeny
The team that owns this template.
05daecaf-4365-42e8-8370-8127de5dd717When the template was last updated.
2024-01-11T12:30:00.000Zcurl -X PATCH 'https://api.truto.one/sync-job-template/{id}' \
-H 'Authorization: Bearer <your_api_token>' \
-H 'Content-Type: application/json' \
-d '{
"integration_name": "your_integration_name",
"args_schema": "{\n \"type\": \"object\",\n \"properties\": {\n \"project_slug\": {\n \"type\": \"string\",\n \"description\": \"The project slug of the project on CircleCI. Its in the format vcs_provider/org_name/repo_name.\",\n \"required\": true\n }\n }\n}\n",
"resources": [],
"updated_at": "your_updated_at",
"default_runtime_version": 0,
"label": "your_label",
"description": "Fetches contacts from Zendesk",
"sharing": "allow"
}'const body = {
"integration_name": "your_integration_name",
"args_schema": "{\n \"type\": \"object\",\n \"properties\": {\n \"project_slug\": {\n \"type\": \"string\",\n \"description\": \"The project slug of the project on CircleCI. Its in the format vcs_provider/org_name/repo_name.\",\n \"required\": true\n }\n }\n}\n",
"resources": [],
"updated_at": "your_updated_at",
"default_runtime_version": 0,
"label": "your_label",
"description": "Fetches contacts from Zendesk",
"sharing": "allow"
};
const response = await fetch('https://api.truto.one/sync-job-template/{id}', {
method: 'PATCH',
headers: {
'Authorization': 'Bearer <your_api_token>',
'Content-Type': 'application/json',
},
body: JSON.stringify(body),
});
const data = await response.json();
console.log(data);import requests
url = "https://api.truto.one/sync-job-template/{id}"
headers = {
"Authorization": "Bearer <your_api_token>",
"Content-Type": "application/json",
}
params = {
}
payload = {
"integration_name": "your_integration_name",
"args_schema": "{\n \"type\": \"object\",\n \"properties\": {\n \"project_slug\": {\n \"type\": \"string\",\n \"description\": \"The project slug of the project on CircleCI. Its in the format vcs_provider/org_name/repo_name.\",\n \"required\": True\n }\n }\n}\n",
"resources": [],
"updated_at": "your_updated_at",
"default_runtime_version": 0,
"label": "your_label",
"description": "Fetches contacts from Zendesk",
"sharing": "allow"
}
response = requests.patch(url, headers=headers, params=params, json=payload)
print(response.json())