664 lines
15 KiB
TypeScript
664 lines
15 KiB
TypeScript
// Generated from the OpenAPI specification. Do not edit by hand: regenerate.
|
|
import type { INodeProperties } from 'n8n-workflow';
|
|
|
|
export const supportOperations: INodeProperties[] = [{
|
|
"displayName": "Operation",
|
|
"name": "operation",
|
|
"type": "options",
|
|
"noDataExpression": true,
|
|
"displayOptions": {
|
|
"show": {
|
|
"resource": [
|
|
"support"
|
|
]
|
|
}
|
|
},
|
|
"options": [
|
|
{
|
|
"name": "List the tickets",
|
|
"value": "ticketsList",
|
|
"description": "Needs `support:read`. The most recent replies first. The `status` values are the slugs of the status names, such as `open`, `answered` and `closed`.",
|
|
"action": "List the tickets",
|
|
"routing": {
|
|
"request": {
|
|
"method": "GET",
|
|
"url": "=/v1/tickets"
|
|
},
|
|
"output": {
|
|
"postReceive": [
|
|
{
|
|
"type": "rootProperty",
|
|
"properties": {
|
|
"property": "data"
|
|
}
|
|
}
|
|
]
|
|
}
|
|
}
|
|
},
|
|
{
|
|
"name": "Open a ticket",
|
|
"value": "ticketsCreate",
|
|
"description": "Needs `support:write`. The ticket stays in the name of the account. Needs the `Idempotency-Key` header. Limited to 10 per hour per account. A department that asks for extra data answers `422` with...",
|
|
"action": "Open a ticket",
|
|
"routing": {
|
|
"request": {
|
|
"method": "POST",
|
|
"url": "=/v1/tickets",
|
|
"headers": {
|
|
"Idempotency-Key": "={{ \"n8n-\" + Date.now().toString(36) + \"-\" + Math.random().toString(36).slice(2, 12) }}"
|
|
}
|
|
}
|
|
}
|
|
},
|
|
{
|
|
"name": "See a ticket",
|
|
"value": "ticketsGet",
|
|
"description": "Needs `support:read`. With all the messages, the oldest first. Attachments come by name only.",
|
|
"action": "See a ticket",
|
|
"routing": {
|
|
"request": {
|
|
"method": "GET",
|
|
"url": "=/v1/tickets/{{encodeURIComponent(String($parameter[\"id\"]))}}"
|
|
}
|
|
}
|
|
},
|
|
{
|
|
"name": "List the departments",
|
|
"value": "departmentsList",
|
|
"description": "Needs `support:read`. The departments that can receive tickets.",
|
|
"action": "List the departments",
|
|
"routing": {
|
|
"request": {
|
|
"method": "GET",
|
|
"url": "=/v1/support/departments"
|
|
},
|
|
"output": {
|
|
"postReceive": [
|
|
{
|
|
"type": "rootProperty",
|
|
"properties": {
|
|
"property": "data"
|
|
}
|
|
}
|
|
]
|
|
}
|
|
}
|
|
},
|
|
{
|
|
"name": "Reply to a ticket",
|
|
"value": "ticketsRepliesCreate",
|
|
"description": "Needs `support:write`. The reply stays in the name of the account. Replying to a closed ticket opens it again. Limited to 30 per hour per account. Send `Idempotency-Key` so that a retry does not...",
|
|
"action": "Reply to a ticket",
|
|
"routing": {
|
|
"request": {
|
|
"method": "POST",
|
|
"url": "=/v1/tickets/{{encodeURIComponent(String($parameter[\"id\"]))}}/replies",
|
|
"headers": {
|
|
"Idempotency-Key": "={{ \"n8n-\" + Date.now().toString(36) + \"-\" + Math.random().toString(36).slice(2, 12) }}"
|
|
}
|
|
}
|
|
}
|
|
},
|
|
{
|
|
"name": "Close a ticket",
|
|
"value": "ticketsClose",
|
|
"description": "Needs `support:write`. In `conflict`, `details.reason` can be `already_closed` or `closure_not_allowed`.",
|
|
"action": "Close a ticket",
|
|
"routing": {
|
|
"request": {
|
|
"method": "POST",
|
|
"url": "=/v1/tickets/{{encodeURIComponent(String($parameter[\"id\"]))}}/close"
|
|
}
|
|
}
|
|
},
|
|
{
|
|
"name": "List the Knowledge Base categories",
|
|
"value": "kbCategoriesList",
|
|
"description": "Needs `support:read`. In the language of `Accept-Language`, when there is a translation.",
|
|
"action": "List the Knowledge Base categories",
|
|
"routing": {
|
|
"request": {
|
|
"method": "GET",
|
|
"url": "=/v1/kb/categories"
|
|
},
|
|
"output": {
|
|
"postReceive": [
|
|
{
|
|
"type": "rootProperty",
|
|
"properties": {
|
|
"property": "data"
|
|
}
|
|
}
|
|
]
|
|
}
|
|
}
|
|
},
|
|
{
|
|
"name": "List or search Knowledge Base articles",
|
|
"value": "kbArticlesList",
|
|
"description": "Needs `support:read`. Only published articles. Searches are limited to 30 per minute.",
|
|
"action": "List or search Knowledge Base articles",
|
|
"routing": {
|
|
"request": {
|
|
"method": "GET",
|
|
"url": "=/v1/kb/articles"
|
|
},
|
|
"output": {
|
|
"postReceive": [
|
|
{
|
|
"type": "rootProperty",
|
|
"properties": {
|
|
"property": "data"
|
|
}
|
|
}
|
|
]
|
|
}
|
|
}
|
|
},
|
|
{
|
|
"name": "Read a Knowledge Base article",
|
|
"value": "kbArticlesGet",
|
|
"description": "Needs `support:read`. The text comes in HTML. In the language of `Accept-Language`, when there is a translation; `translated` says if there was.",
|
|
"action": "Read a Knowledge Base article",
|
|
"routing": {
|
|
"request": {
|
|
"method": "GET",
|
|
"url": "=/v1/kb/articles/{{encodeURIComponent(String($parameter[\"id\"]))}}"
|
|
}
|
|
}
|
|
},
|
|
{
|
|
"name": "List the announcements",
|
|
"value": "announcementsList",
|
|
"description": "Needs `support:read`. Only published announcements, the most recent first.",
|
|
"action": "List the announcements",
|
|
"routing": {
|
|
"request": {
|
|
"method": "GET",
|
|
"url": "=/v1/announcements"
|
|
},
|
|
"output": {
|
|
"postReceive": [
|
|
{
|
|
"type": "rootProperty",
|
|
"properties": {
|
|
"property": "data"
|
|
}
|
|
}
|
|
]
|
|
}
|
|
}
|
|
},
|
|
{
|
|
"name": "Read an announcement",
|
|
"value": "announcementsGet",
|
|
"description": "Needs `support:read`. The text comes in HTML.",
|
|
"action": "Read an announcement",
|
|
"routing": {
|
|
"request": {
|
|
"method": "GET",
|
|
"url": "=/v1/announcements/{{encodeURIComponent(String($parameter[\"id\"]))}}"
|
|
}
|
|
}
|
|
}
|
|
],
|
|
"default": "ticketsList"
|
|
}];
|
|
|
|
export const supportFields: INodeProperties[] = [
|
|
{
|
|
"displayName": "Query Parameters",
|
|
"name": "queryParameters",
|
|
"type": "collection",
|
|
"placeholder": "Add Parameter",
|
|
"default": {},
|
|
"displayOptions": {
|
|
"show": {
|
|
"resource": [
|
|
"support"
|
|
],
|
|
"operation": [
|
|
"ticketsList"
|
|
]
|
|
}
|
|
},
|
|
"options": [
|
|
{
|
|
"displayName": "Page",
|
|
"name": "page",
|
|
"type": "number",
|
|
"default": 1,
|
|
"typeOptions": {
|
|
"numberPrecision": 0
|
|
},
|
|
"description": "The page number. The first is 1.",
|
|
"routing": {
|
|
"send": {
|
|
"type": "query",
|
|
"property": "page"
|
|
}
|
|
}
|
|
},
|
|
{
|
|
"displayName": "Per Page",
|
|
"name": "per_page",
|
|
"type": "number",
|
|
"default": 10,
|
|
"typeOptions": {
|
|
"numberPrecision": 0
|
|
},
|
|
"description": "Results per page, from 1 to 100. The default is 10.",
|
|
"routing": {
|
|
"send": {
|
|
"type": "query",
|
|
"property": "per_page"
|
|
}
|
|
}
|
|
},
|
|
{
|
|
"displayName": "Status",
|
|
"name": "status",
|
|
"type": "string",
|
|
"default": "",
|
|
"description": "Only tickets in this status.",
|
|
"routing": {
|
|
"send": {
|
|
"type": "query",
|
|
"property": "status"
|
|
}
|
|
}
|
|
}
|
|
]
|
|
},
|
|
{
|
|
"displayName": "Department ID",
|
|
"name": "department_id",
|
|
"type": "number",
|
|
"default": 0,
|
|
"typeOptions": {
|
|
"numberPrecision": 0
|
|
},
|
|
"required": true,
|
|
"routing": {
|
|
"send": {
|
|
"type": "body",
|
|
"property": "department_id"
|
|
}
|
|
},
|
|
"displayOptions": {
|
|
"show": {
|
|
"resource": [
|
|
"support"
|
|
],
|
|
"operation": [
|
|
"ticketsCreate"
|
|
]
|
|
}
|
|
}
|
|
},
|
|
{
|
|
"displayName": "Subject",
|
|
"name": "subject",
|
|
"type": "string",
|
|
"default": "",
|
|
"required": true,
|
|
"routing": {
|
|
"send": {
|
|
"type": "body",
|
|
"property": "subject"
|
|
}
|
|
},
|
|
"displayOptions": {
|
|
"show": {
|
|
"resource": [
|
|
"support"
|
|
],
|
|
"operation": [
|
|
"ticketsCreate"
|
|
]
|
|
}
|
|
}
|
|
},
|
|
{
|
|
"displayName": "Message",
|
|
"name": "message",
|
|
"type": "string",
|
|
"default": "",
|
|
"required": true,
|
|
"routing": {
|
|
"send": {
|
|
"type": "body",
|
|
"property": "message"
|
|
}
|
|
},
|
|
"displayOptions": {
|
|
"show": {
|
|
"resource": [
|
|
"support"
|
|
],
|
|
"operation": [
|
|
"ticketsCreate"
|
|
]
|
|
}
|
|
}
|
|
},
|
|
{
|
|
"displayName": "Additional Fields",
|
|
"name": "additionalFields",
|
|
"type": "collection",
|
|
"placeholder": "Add Field",
|
|
"default": {},
|
|
"displayOptions": {
|
|
"show": {
|
|
"resource": [
|
|
"support"
|
|
],
|
|
"operation": [
|
|
"ticketsCreate"
|
|
]
|
|
}
|
|
},
|
|
"options": [
|
|
{
|
|
"displayName": "Domain ID",
|
|
"name": "domain_id",
|
|
"type": "number",
|
|
"default": 0,
|
|
"typeOptions": {
|
|
"numberPrecision": 0
|
|
},
|
|
"description": "A domain of the account. Use it instead of `service_id`.",
|
|
"routing": {
|
|
"send": {
|
|
"type": "body",
|
|
"property": "domain_id"
|
|
}
|
|
}
|
|
},
|
|
{
|
|
"displayName": "Priority",
|
|
"name": "priority",
|
|
"type": "options",
|
|
"options": [
|
|
{
|
|
"name": "low",
|
|
"value": "low"
|
|
},
|
|
{
|
|
"name": "medium",
|
|
"value": "medium"
|
|
},
|
|
{
|
|
"name": "high",
|
|
"value": "high"
|
|
}
|
|
],
|
|
"default": "medium",
|
|
"routing": {
|
|
"send": {
|
|
"type": "body",
|
|
"property": "priority"
|
|
}
|
|
}
|
|
},
|
|
{
|
|
"displayName": "Service ID",
|
|
"name": "service_id",
|
|
"type": "number",
|
|
"default": 0,
|
|
"typeOptions": {
|
|
"numberPrecision": 0
|
|
},
|
|
"description": "A service of the account this ticket is about.",
|
|
"routing": {
|
|
"send": {
|
|
"type": "body",
|
|
"property": "service_id"
|
|
}
|
|
}
|
|
}
|
|
]
|
|
},
|
|
{
|
|
"displayName": "ID",
|
|
"name": "id",
|
|
"type": "string",
|
|
"required": true,
|
|
"default": "",
|
|
"description": "The number of the ticket.",
|
|
"displayOptions": {
|
|
"show": {
|
|
"resource": [
|
|
"support"
|
|
],
|
|
"operation": [
|
|
"ticketsGet"
|
|
]
|
|
}
|
|
}
|
|
},
|
|
{
|
|
"displayName": "ID",
|
|
"name": "id",
|
|
"type": "string",
|
|
"required": true,
|
|
"default": "",
|
|
"description": "The ticket number.",
|
|
"displayOptions": {
|
|
"show": {
|
|
"resource": [
|
|
"support"
|
|
],
|
|
"operation": [
|
|
"ticketsRepliesCreate"
|
|
]
|
|
}
|
|
}
|
|
},
|
|
{
|
|
"displayName": "Message",
|
|
"name": "message",
|
|
"type": "string",
|
|
"default": "",
|
|
"required": true,
|
|
"routing": {
|
|
"send": {
|
|
"type": "body",
|
|
"property": "message"
|
|
}
|
|
},
|
|
"displayOptions": {
|
|
"show": {
|
|
"resource": [
|
|
"support"
|
|
],
|
|
"operation": [
|
|
"ticketsRepliesCreate"
|
|
]
|
|
}
|
|
}
|
|
},
|
|
{
|
|
"displayName": "ID",
|
|
"name": "id",
|
|
"type": "string",
|
|
"required": true,
|
|
"default": "",
|
|
"description": "The ticket number.",
|
|
"displayOptions": {
|
|
"show": {
|
|
"resource": [
|
|
"support"
|
|
],
|
|
"operation": [
|
|
"ticketsClose"
|
|
]
|
|
}
|
|
}
|
|
},
|
|
{
|
|
"displayName": "Query Parameters",
|
|
"name": "queryParameters",
|
|
"type": "collection",
|
|
"placeholder": "Add Parameter",
|
|
"default": {},
|
|
"displayOptions": {
|
|
"show": {
|
|
"resource": [
|
|
"support"
|
|
],
|
|
"operation": [
|
|
"kbArticlesList"
|
|
]
|
|
}
|
|
},
|
|
"options": [
|
|
{
|
|
"displayName": "Category",
|
|
"name": "category",
|
|
"type": "string",
|
|
"default": "",
|
|
"description": "The `id` of a category.",
|
|
"routing": {
|
|
"send": {
|
|
"type": "query",
|
|
"property": "category"
|
|
}
|
|
}
|
|
},
|
|
{
|
|
"displayName": "Page",
|
|
"name": "page",
|
|
"type": "number",
|
|
"default": 1,
|
|
"typeOptions": {
|
|
"numberPrecision": 0
|
|
},
|
|
"description": "The page number. The first is 1.",
|
|
"routing": {
|
|
"send": {
|
|
"type": "query",
|
|
"property": "page"
|
|
}
|
|
}
|
|
},
|
|
{
|
|
"displayName": "Per Page",
|
|
"name": "per_page",
|
|
"type": "number",
|
|
"default": 10,
|
|
"typeOptions": {
|
|
"numberPrecision": 0
|
|
},
|
|
"description": "Results per page, from 1 to 100. The default is 10.",
|
|
"routing": {
|
|
"send": {
|
|
"type": "query",
|
|
"property": "per_page"
|
|
}
|
|
}
|
|
},
|
|
{
|
|
"displayName": "Q",
|
|
"name": "q",
|
|
"type": "string",
|
|
"default": "",
|
|
"description": "Words to find, from 2 to 100 characters.",
|
|
"routing": {
|
|
"send": {
|
|
"type": "query",
|
|
"property": "q"
|
|
}
|
|
}
|
|
}
|
|
]
|
|
},
|
|
{
|
|
"displayName": "ID",
|
|
"name": "id",
|
|
"type": "string",
|
|
"required": true,
|
|
"default": "",
|
|
"description": "The `id` of the article.",
|
|
"displayOptions": {
|
|
"show": {
|
|
"resource": [
|
|
"support"
|
|
],
|
|
"operation": [
|
|
"kbArticlesGet"
|
|
]
|
|
}
|
|
}
|
|
},
|
|
{
|
|
"displayName": "Query Parameters",
|
|
"name": "queryParameters",
|
|
"type": "collection",
|
|
"placeholder": "Add Parameter",
|
|
"default": {},
|
|
"displayOptions": {
|
|
"show": {
|
|
"resource": [
|
|
"support"
|
|
],
|
|
"operation": [
|
|
"announcementsList"
|
|
]
|
|
}
|
|
},
|
|
"options": [
|
|
{
|
|
"displayName": "Page",
|
|
"name": "page",
|
|
"type": "number",
|
|
"default": 1,
|
|
"typeOptions": {
|
|
"numberPrecision": 0
|
|
},
|
|
"description": "The page number. The first is 1.",
|
|
"routing": {
|
|
"send": {
|
|
"type": "query",
|
|
"property": "page"
|
|
}
|
|
}
|
|
},
|
|
{
|
|
"displayName": "Per Page",
|
|
"name": "per_page",
|
|
"type": "number",
|
|
"default": 10,
|
|
"typeOptions": {
|
|
"numberPrecision": 0
|
|
},
|
|
"description": "Results per page, from 1 to 100. The default is 10.",
|
|
"routing": {
|
|
"send": {
|
|
"type": "query",
|
|
"property": "per_page"
|
|
}
|
|
}
|
|
}
|
|
]
|
|
},
|
|
{
|
|
"displayName": "ID",
|
|
"name": "id",
|
|
"type": "string",
|
|
"required": true,
|
|
"default": "",
|
|
"description": "The `id` of the announcement.",
|
|
"displayOptions": {
|
|
"show": {
|
|
"resource": [
|
|
"support"
|
|
],
|
|
"operation": [
|
|
"announcementsGet"
|
|
]
|
|
}
|
|
}
|
|
}
|
|
];
|