UNPKG

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