@kosha-ai/integration-zendesk 0.6.0 → 0.8.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +11 -0
- package/docs/openapi.json +343 -0
- package/package.json +3 -3
package/README.md
CHANGED
|
@@ -51,5 +51,16 @@ The full catalogue is still declared, for display and validation. Your Zendesk
|
|
|
51
51
|
OAuth client has to permit the requested scopes, or Zendesk refuses the
|
|
52
52
|
authorization.
|
|
53
53
|
|
|
54
|
+
## OpenAPI
|
|
55
|
+
|
|
56
|
+
The focused Zendesk OpenAPI specification is exposed at
|
|
57
|
+
`/api/integrations/zendesk/docs/openapi.json` when the Kosha server is running.
|
|
58
|
+
Its `getTicket` operation uses Kosha's
|
|
59
|
+
`/api/proxy/zendesk/{configurationSlug}/{owner}/tickets/{ticketId}` route and
|
|
60
|
+
`x-api-key` authentication.
|
|
61
|
+
The `listTickets` operation is available at
|
|
62
|
+
`/api/proxy/zendesk/{configurationSlug}/{owner}/tickets` and supports Zendesk
|
|
63
|
+
pagination, sorting, external ID filtering, and sideloads.
|
|
64
|
+
|
|
54
65
|
See [docs/setup.md](./docs/setup.md) for the OAuth client walkthrough, the
|
|
55
66
|
operation → scope reference, and the subdomain rules.
|
|
@@ -0,0 +1,343 @@
|
|
|
1
|
+
{
|
|
2
|
+
"openapi": "3.0.3",
|
|
3
|
+
"info": {
|
|
4
|
+
"title": "Kosha Zendesk API",
|
|
5
|
+
"version": "1.0.0",
|
|
6
|
+
"description": "A focused Zendesk API surface exposed through Kosha's authenticated proxy. The proxy resolves the Zendesk tenant from the configuration and forwards requests using the connected account's OAuth credentials."
|
|
7
|
+
},
|
|
8
|
+
"servers": [{ "url": "https://your-kosha-host.example" }],
|
|
9
|
+
"security": [{ "x-kosha-api-key": [] }],
|
|
10
|
+
"paths": {
|
|
11
|
+
"/api/proxy/zendesk/{configurationSlug}/{owner}/tickets": {
|
|
12
|
+
"get": {
|
|
13
|
+
"operationId": "listTickets",
|
|
14
|
+
"summary": "List tickets",
|
|
15
|
+
"description": "Returns up to 100 tickets visible to the connected Zendesk agent. Cursor pagination is recommended for traversing pages.",
|
|
16
|
+
"parameters": [
|
|
17
|
+
{ "$ref": "#/components/parameters/ConfigurationSlug" },
|
|
18
|
+
{ "$ref": "#/components/parameters/Owner" },
|
|
19
|
+
{ "$ref": "#/components/parameters/ExternalId" },
|
|
20
|
+
{ "$ref": "#/components/parameters/Include" },
|
|
21
|
+
{ "$ref": "#/components/parameters/Page" },
|
|
22
|
+
{ "$ref": "#/components/parameters/PerPage" },
|
|
23
|
+
{ "$ref": "#/components/parameters/Sort" },
|
|
24
|
+
{ "$ref": "#/components/parameters/SortBy" },
|
|
25
|
+
{ "$ref": "#/components/parameters/SortOrder" },
|
|
26
|
+
{ "$ref": "#/components/parameters/SupportTypeScope" }
|
|
27
|
+
],
|
|
28
|
+
"responses": {
|
|
29
|
+
"200": {
|
|
30
|
+
"description": "A page of Zendesk tickets.",
|
|
31
|
+
"content": {
|
|
32
|
+
"application/json": {
|
|
33
|
+
"schema": { "$ref": "#/components/schemas/TicketListResponse" }
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
},
|
|
37
|
+
"401": { "$ref": "#/components/responses/Unauthorized" }
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
},
|
|
41
|
+
"/api/proxy/zendesk/{configurationSlug}/{owner}/tickets/{ticketId}": {
|
|
42
|
+
"get": {
|
|
43
|
+
"operationId": "getTicket",
|
|
44
|
+
"summary": "Get ticket details",
|
|
45
|
+
"description": "Returns the details of a Zendesk ticket. The full comment thread is not included; use Zendesk's ticket comments endpoint if it is needed.",
|
|
46
|
+
"parameters": [
|
|
47
|
+
{ "$ref": "#/components/parameters/ConfigurationSlug" },
|
|
48
|
+
{ "$ref": "#/components/parameters/Owner" },
|
|
49
|
+
{ "$ref": "#/components/parameters/TicketId" },
|
|
50
|
+
{ "$ref": "#/components/parameters/Include" }
|
|
51
|
+
],
|
|
52
|
+
"responses": {
|
|
53
|
+
"200": {
|
|
54
|
+
"description": "The requested Zendesk ticket.",
|
|
55
|
+
"content": {
|
|
56
|
+
"application/json": {
|
|
57
|
+
"schema": { "$ref": "#/components/schemas/TicketResponse" }
|
|
58
|
+
}
|
|
59
|
+
}
|
|
60
|
+
},
|
|
61
|
+
"401": { "$ref": "#/components/responses/Unauthorized" },
|
|
62
|
+
"404": { "description": "Ticket not found." }
|
|
63
|
+
}
|
|
64
|
+
}
|
|
65
|
+
}
|
|
66
|
+
},
|
|
67
|
+
"components": {
|
|
68
|
+
"securitySchemes": {
|
|
69
|
+
"x-kosha-api-key": {
|
|
70
|
+
"type": "apiKey",
|
|
71
|
+
"in": "header",
|
|
72
|
+
"name": "x-api-key",
|
|
73
|
+
"description": "Kosha API key for the environment containing the Zendesk configuration."
|
|
74
|
+
}
|
|
75
|
+
},
|
|
76
|
+
"parameters": {
|
|
77
|
+
"ConfigurationSlug": {
|
|
78
|
+
"name": "configurationSlug",
|
|
79
|
+
"in": "path",
|
|
80
|
+
"required": true,
|
|
81
|
+
"description": "Kosha configuration slug for the connected Zendesk OAuth client.",
|
|
82
|
+
"schema": { "type": "string", "default": "zendesk" }
|
|
83
|
+
},
|
|
84
|
+
"Owner": {
|
|
85
|
+
"name": "owner",
|
|
86
|
+
"in": "path",
|
|
87
|
+
"required": true,
|
|
88
|
+
"description": "The consuming application's stable identifier for the person whose Zendesk connection should be used.",
|
|
89
|
+
"schema": { "type": "string" }
|
|
90
|
+
},
|
|
91
|
+
"TicketId": {
|
|
92
|
+
"name": "ticketId",
|
|
93
|
+
"in": "path",
|
|
94
|
+
"required": true,
|
|
95
|
+
"description": "The numeric ID of the Zendesk ticket.",
|
|
96
|
+
"schema": { "type": "integer", "format": "int64", "minimum": 1 }
|
|
97
|
+
},
|
|
98
|
+
"Include": {
|
|
99
|
+
"name": "include",
|
|
100
|
+
"in": "query",
|
|
101
|
+
"description": "Comma-separated sideloads to include in the response, as supported by Zendesk.",
|
|
102
|
+
"schema": { "type": "string", "example": "users,groups" }
|
|
103
|
+
},
|
|
104
|
+
"ExternalId": {
|
|
105
|
+
"name": "external_id",
|
|
106
|
+
"in": "query",
|
|
107
|
+
"description": "Lists tickets by external ID. Multiple tickets may share an external ID.",
|
|
108
|
+
"schema": { "type": "string" }
|
|
109
|
+
},
|
|
110
|
+
"Page": {
|
|
111
|
+
"name": "page",
|
|
112
|
+
"in": "query",
|
|
113
|
+
"description": "Pagination. Use either offset pagination with page, or cursor pagination with page[size] and page[after]/page[before]. Do not combine both formats.",
|
|
114
|
+
"style": "deepObject",
|
|
115
|
+
"explode": true,
|
|
116
|
+
"schema": {
|
|
117
|
+
"type": "object",
|
|
118
|
+
"properties": {
|
|
119
|
+
"size": {
|
|
120
|
+
"type": "integer",
|
|
121
|
+
"minimum": 1,
|
|
122
|
+
"maximum": 100,
|
|
123
|
+
"default": 100
|
|
124
|
+
},
|
|
125
|
+
"after": { "type": "string" },
|
|
126
|
+
"before": { "type": "string" }
|
|
127
|
+
}
|
|
128
|
+
}
|
|
129
|
+
},
|
|
130
|
+
"PerPage": {
|
|
131
|
+
"name": "per_page",
|
|
132
|
+
"in": "query",
|
|
133
|
+
"description": "Number of records to return for offset pagination.",
|
|
134
|
+
"schema": {
|
|
135
|
+
"type": "integer",
|
|
136
|
+
"minimum": 1,
|
|
137
|
+
"maximum": 100,
|
|
138
|
+
"default": 100
|
|
139
|
+
}
|
|
140
|
+
},
|
|
141
|
+
"Sort": {
|
|
142
|
+
"name": "sort",
|
|
143
|
+
"in": "query",
|
|
144
|
+
"description": "Cursor sort field. Prefix with - for descending order.",
|
|
145
|
+
"schema": {
|
|
146
|
+
"type": "string",
|
|
147
|
+
"enum": [
|
|
148
|
+
"id",
|
|
149
|
+
"updated_at",
|
|
150
|
+
"status",
|
|
151
|
+
"-id",
|
|
152
|
+
"-updated_at",
|
|
153
|
+
"-status"
|
|
154
|
+
]
|
|
155
|
+
}
|
|
156
|
+
},
|
|
157
|
+
"SortBy": {
|
|
158
|
+
"name": "sort_by",
|
|
159
|
+
"in": "query",
|
|
160
|
+
"description": "Offset sort field.",
|
|
161
|
+
"schema": {
|
|
162
|
+
"type": "string",
|
|
163
|
+
"enum": [
|
|
164
|
+
"assignee",
|
|
165
|
+
"assignee.name",
|
|
166
|
+
"created_at",
|
|
167
|
+
"group",
|
|
168
|
+
"id",
|
|
169
|
+
"requester",
|
|
170
|
+
"requester.name",
|
|
171
|
+
"status",
|
|
172
|
+
"subject",
|
|
173
|
+
"updated_at"
|
|
174
|
+
]
|
|
175
|
+
}
|
|
176
|
+
},
|
|
177
|
+
"SortOrder": {
|
|
178
|
+
"name": "sort_order",
|
|
179
|
+
"in": "query",
|
|
180
|
+
"schema": {
|
|
181
|
+
"type": "string",
|
|
182
|
+
"enum": ["asc", "desc"],
|
|
183
|
+
"default": "asc"
|
|
184
|
+
}
|
|
185
|
+
},
|
|
186
|
+
"SupportTypeScope": {
|
|
187
|
+
"name": "support_type_scope",
|
|
188
|
+
"in": "query",
|
|
189
|
+
"schema": {
|
|
190
|
+
"type": "string",
|
|
191
|
+
"enum": ["all", "agent", "ai_agent"],
|
|
192
|
+
"default": "agent"
|
|
193
|
+
}
|
|
194
|
+
}
|
|
195
|
+
},
|
|
196
|
+
"responses": {
|
|
197
|
+
"Unauthorized": {
|
|
198
|
+
"description": "The API key or connected Zendesk credential is invalid."
|
|
199
|
+
}
|
|
200
|
+
},
|
|
201
|
+
"schemas": {
|
|
202
|
+
"TicketListResponse": {
|
|
203
|
+
"type": "object",
|
|
204
|
+
"required": ["tickets"],
|
|
205
|
+
"properties": {
|
|
206
|
+
"tickets": {
|
|
207
|
+
"type": "array",
|
|
208
|
+
"items": { "$ref": "#/components/schemas/Ticket" }
|
|
209
|
+
},
|
|
210
|
+
"next_page": { "type": "string", "format": "uri", "nullable": true },
|
|
211
|
+
"previous_page": {
|
|
212
|
+
"type": "string",
|
|
213
|
+
"format": "uri",
|
|
214
|
+
"nullable": true
|
|
215
|
+
},
|
|
216
|
+
"meta": {
|
|
217
|
+
"type": "object",
|
|
218
|
+
"properties": {
|
|
219
|
+
"has_more": { "type": "boolean" },
|
|
220
|
+
"after_cursor": { "type": "string", "nullable": true },
|
|
221
|
+
"before_cursor": { "type": "string", "nullable": true }
|
|
222
|
+
},
|
|
223
|
+
"additionalProperties": true
|
|
224
|
+
},
|
|
225
|
+
"users": {
|
|
226
|
+
"type": "array",
|
|
227
|
+
"items": { "$ref": "#/components/schemas/User" }
|
|
228
|
+
},
|
|
229
|
+
"groups": {
|
|
230
|
+
"type": "array",
|
|
231
|
+
"items": { "$ref": "#/components/schemas/Group" }
|
|
232
|
+
}
|
|
233
|
+
}
|
|
234
|
+
},
|
|
235
|
+
"TicketResponse": {
|
|
236
|
+
"type": "object",
|
|
237
|
+
"required": ["ticket"],
|
|
238
|
+
"properties": {
|
|
239
|
+
"ticket": { "$ref": "#/components/schemas/Ticket" },
|
|
240
|
+
"audit": { "type": "object", "additionalProperties": true },
|
|
241
|
+
"users": {
|
|
242
|
+
"type": "array",
|
|
243
|
+
"description": "Sideloaded users, when requested with include.",
|
|
244
|
+
"items": { "$ref": "#/components/schemas/User" }
|
|
245
|
+
},
|
|
246
|
+
"groups": {
|
|
247
|
+
"type": "array",
|
|
248
|
+
"description": "Sideloaded groups, when requested with include.",
|
|
249
|
+
"items": { "$ref": "#/components/schemas/Group" }
|
|
250
|
+
}
|
|
251
|
+
}
|
|
252
|
+
},
|
|
253
|
+
"Ticket": {
|
|
254
|
+
"type": "object",
|
|
255
|
+
"required": ["id", "subject", "status"],
|
|
256
|
+
"properties": {
|
|
257
|
+
"url": { "type": "string", "format": "uri" },
|
|
258
|
+
"id": { "type": "integer", "format": "int64" },
|
|
259
|
+
"external_id": { "type": "string", "nullable": true },
|
|
260
|
+
"type": {
|
|
261
|
+
"type": "string",
|
|
262
|
+
"nullable": true,
|
|
263
|
+
"enum": ["problem", "incident", "question", "task", null]
|
|
264
|
+
},
|
|
265
|
+
"subject": { "type": "string" },
|
|
266
|
+
"raw_subject": { "type": "string" },
|
|
267
|
+
"description": { "type": "string" },
|
|
268
|
+
"priority": {
|
|
269
|
+
"type": "string",
|
|
270
|
+
"nullable": true,
|
|
271
|
+
"enum": ["urgent", "high", "normal", "low", null]
|
|
272
|
+
},
|
|
273
|
+
"status": {
|
|
274
|
+
"type": "string",
|
|
275
|
+
"enum": ["new", "open", "pending", "hold", "solved", "closed"]
|
|
276
|
+
},
|
|
277
|
+
"requester_id": {
|
|
278
|
+
"type": "integer",
|
|
279
|
+
"format": "int64",
|
|
280
|
+
"nullable": true
|
|
281
|
+
},
|
|
282
|
+
"assignee_id": {
|
|
283
|
+
"type": "integer",
|
|
284
|
+
"format": "int64",
|
|
285
|
+
"nullable": true
|
|
286
|
+
},
|
|
287
|
+
"group_id": {
|
|
288
|
+
"type": "integer",
|
|
289
|
+
"format": "int64",
|
|
290
|
+
"nullable": true
|
|
291
|
+
},
|
|
292
|
+
"organization_id": {
|
|
293
|
+
"type": "integer",
|
|
294
|
+
"format": "int64",
|
|
295
|
+
"nullable": true
|
|
296
|
+
},
|
|
297
|
+
"collaborator_ids": {
|
|
298
|
+
"type": "array",
|
|
299
|
+
"items": { "type": "integer", "format": "int64" }
|
|
300
|
+
},
|
|
301
|
+
"follower_ids": {
|
|
302
|
+
"type": "array",
|
|
303
|
+
"items": { "type": "integer", "format": "int64" }
|
|
304
|
+
},
|
|
305
|
+
"tags": { "type": "array", "items": { "type": "string" } },
|
|
306
|
+
"via": { "type": "object", "additionalProperties": true },
|
|
307
|
+
"custom_fields": {
|
|
308
|
+
"type": "array",
|
|
309
|
+
"items": { "$ref": "#/components/schemas/CustomField" }
|
|
310
|
+
},
|
|
311
|
+
"created_at": { "type": "string", "format": "date-time" },
|
|
312
|
+
"updated_at": { "type": "string", "format": "date-time" }
|
|
313
|
+
},
|
|
314
|
+
"additionalProperties": true
|
|
315
|
+
},
|
|
316
|
+
"CustomField": {
|
|
317
|
+
"type": "object",
|
|
318
|
+
"required": ["id", "value"],
|
|
319
|
+
"properties": {
|
|
320
|
+
"id": { "type": "integer", "format": "int64" },
|
|
321
|
+
"value": {}
|
|
322
|
+
}
|
|
323
|
+
},
|
|
324
|
+
"User": {
|
|
325
|
+
"type": "object",
|
|
326
|
+
"properties": {
|
|
327
|
+
"id": { "type": "integer", "format": "int64" },
|
|
328
|
+
"name": { "type": "string" },
|
|
329
|
+
"email": { "type": "string", "format": "email" }
|
|
330
|
+
},
|
|
331
|
+
"additionalProperties": true
|
|
332
|
+
},
|
|
333
|
+
"Group": {
|
|
334
|
+
"type": "object",
|
|
335
|
+
"properties": {
|
|
336
|
+
"id": { "type": "integer", "format": "int64" },
|
|
337
|
+
"name": { "type": "string" }
|
|
338
|
+
},
|
|
339
|
+
"additionalProperties": true
|
|
340
|
+
}
|
|
341
|
+
}
|
|
342
|
+
}
|
|
343
|
+
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@kosha-ai/integration-zendesk",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.8.0",
|
|
4
4
|
"description": "Zendesk integration for Kosha",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"kosha",
|
|
@@ -48,9 +48,9 @@
|
|
|
48
48
|
"key": "zendesk"
|
|
49
49
|
},
|
|
50
50
|
"peerDependencies": {
|
|
51
|
-
"@kosha-ai/integration-sdk": "0.
|
|
51
|
+
"@kosha-ai/integration-sdk": "0.8.0"
|
|
52
52
|
},
|
|
53
53
|
"devDependencies": {
|
|
54
|
-
"@kosha-ai/integration-sdk": "0.
|
|
54
|
+
"@kosha-ai/integration-sdk": "0.8.0"
|
|
55
55
|
}
|
|
56
56
|
}
|