1 | # @androozka/zendesk-api-js
|
2 |
|
3 | 
|
4 | [](https://codecov.io/gh/androozka/zendesk-api-js)
|
5 | 
|
6 | [](https://packagephobia.now.sh/result?p=@androozka/zendesk-api-js)
|
7 | [](http://npm-stat.com/charts.html?package=@androozka/zendesk-api-js)
|
8 | 
|
9 |
|
10 | A JS library for interacting with the Zendesk API.
|
11 |
|
12 | ## Features
|
13 |
|
14 | - Generates Zendesk API request objects
|
15 | - Send prepared object directly to axios
|
16 | - Mirrors Zendesk's API documentation
|
17 | - No dependencies
|
18 |
|
19 | ## Installing
|
20 |
|
21 | ### Using npm
|
22 |
|
23 | ```bash
|
24 | $ npm install @androozka/zendesk-api-js
|
25 | ```
|
26 |
|
27 | ### Using yarn
|
28 |
|
29 | ```bash
|
30 | $ yarn add @androozka/zendesk-api-js
|
31 | ```
|
32 |
|
33 | ## Usage
|
34 |
|
35 | ### Suggested libraries
|
36 |
|
37 | ```javascript
|
38 | const base64 = require('js-base64').Base64;
|
39 | const axios = require('axios');
|
40 | ```
|
41 |
|
42 | ### Zendesk account information
|
43 |
|
44 | ```javascript
|
45 | const instance = ''; // Name of Zendesk instance
|
46 | const email = ''; // Email address of Zendesk user
|
47 | const token = ''; // Generated Zendesk token
|
48 |
|
49 | const headers = {
|
50 | 'Content-Type': 'application/json',
|
51 | Authorization: `Basic ${base64.encode(`${email}/token:${token}`)}`
|
52 | };
|
53 | ```
|
54 |
|
55 | ### Choose framework version
|
56 |
|
57 | ```javascript
|
58 | const zaf_v2 = zdApi.v2(instance, headers);
|
59 | ```
|
60 |
|
61 | ### Selecting API endpoints
|
62 |
|
63 | ```javascript
|
64 | const { support, sunshine } = zaf_v2;
|
65 | ```
|
66 |
|
67 | ## Examples
|
68 |
|
69 | ### Add tags to a ticket
|
70 |
|
71 | ```javascript
|
72 | const list = { tags: ['tag_1', 'tag_2', ... ] }
|
73 | const { data } = await axios(support.tags.add('tickets', 123, list));
|
74 | ```
|
75 |
|
76 | ## API Coverage Status
|
77 |
|
78 | ### Support API
|
79 |
|
80 | - [x] Search
|
81 | - [ ] Users
|
82 | - [ ] User Identities
|
83 | - [ ] User Passwords
|
84 | - [ ] End Users
|
85 | - [ ] Groups
|
86 | - [ ] Group Memberships
|
87 | - [ ] Custom Agent Roles
|
88 | - [ ] Organizations
|
89 | - [ ] Organization Subscriptions
|
90 | - [ ] Organization Memberships
|
91 | - [ ] Requests
|
92 | - [ ] Tickets
|
93 | - [ ] Ticket Import
|
94 | - [ ] Attachments
|
95 | - [ ] Satisfaction Ratings
|
96 | - [ ] Satisfaction Reasons
|
97 | - [ ] Suspended Tickets
|
98 | - [ ] Ticket Audits
|
99 | - [ ] Ticket Comments
|
100 | - [ ] Ticket Skips
|
101 | - [x] Ticket Metrics
|
102 | - [ ] Ticket Metric Events
|
103 | - [ ] Ticket Activities
|
104 | - [ ] Sessions
|
105 | - [x] Tags
|
106 | - [ ] Views
|
107 | - [ ] Triggers
|
108 | - [ ] Automations
|
109 | - [ ] SLA Policies
|
110 | - [ ] Targets
|
111 | - [ ] Target Failures
|
112 | - [ ] Macros
|
113 | - [ ] Brands
|
114 | - [ ] Dynamic Content
|
115 | - [ ] Locales
|
116 | - [ ] Schedules
|
117 | - [ ] Sharing Agreements
|
118 | - [ ] Support Addresses
|
119 | - [ ] Ticket Forms
|
120 | - [ ] Ticket Fields
|
121 | - [ ] User Fields
|
122 | - [ ] Organization Fields
|
123 | - [ ] Job Statuses
|
124 | - [ ] Skill-based Routing
|
125 | - [ ] Incremental Skill-based Routing
|
126 | - [ ] Workspaces
|
127 | - [ ] Apps
|
128 | - [ ] App Installation Locations
|
129 | - [ ] App Locations
|
130 | - [ ] OAuth Clients
|
131 | - [ ] OAuth Tokens
|
132 | - [ ] OAuth Tokens for Grant Types
|
133 | - [ ] Authorized Global Clients
|
134 | - [ ] Account Settings
|
135 | - [ ] Audit Logs
|
136 | - [ ] Bookmarks
|
137 | - [ ] Push Notification Devices
|
138 | - [ ] Resource Collections
|
139 | - [ ] Channel Framework
|
140 | - [ ] Twitter Channel
|
141 |
|
142 | ### ToDo
|
143 |
|
144 | - Sunshine API
|
145 | - Help Center API
|
146 | - Chat API
|
147 | - Talk API
|
148 | - Sell API
|
149 | - Answer Bot API
|
150 | - Status API
|
151 | - Reseller API
|
152 | - NPS API
|