UNPKG

3.88 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_**Note**: Only v2 framework, [v1 deprecated](https://support.zendesk.com/hc/en-us/articles/360002106888-Removal-of-Zendesk-Apps-framework-v1)_
20
21## Installing
22
23```bash
24# using npm
25npm install @androozka/zendesk-api-js
26
27# using yarn
28yarn add @androozka/zendesk-api-js
29```
30
31## Usage
32
33### Getting Started
34
35```javascript
36const axios = require('axios'); // Suggested library
37const zdApi = require('@androozka/zendesk-api-js');
38```
39
40### Zendesk Info
41
42```javascript
43const options = {
44 instance: '', // Zendesk subdomain
45 email: '', // User account to perform requests
46 password: '', // Password for user account
47 token: '' // Generated Zendesk token
48};
49/* Note: Either "password" or "token" is required */
50```
51
52### Initalize
53
54```javascript
55// Load entire library
56const { support, sunshine } = zdApi.init(options);
57
58// Load entire API
59const { tickets, groups } = zdApi.support.init(options);
60
61// Load specific endpoint
62const { list, create } = zdApi.support.tickets(options);
63```
64
65## Examples
66
67### Add tags to a ticket
68
69```javascript
70try {
71 const { tags } = zdApi.support.init(options);
72 const data = { tags: ['tag_1', 'tag_2', ... ] }
73
74 const req = tags.add({ type: 'tickets', id: 123, data });
75
76 const res = await axios(req);
77} catch (error) {
78 // ...
79}
80```
81
82## API Coverage Status
83
84### Support API
85
86Search, Users, End Users, Groups, Group Memberships, Custom Agent Roles, Organizations, Organization Subscriptions, Organization Memberships, Tickets, Ticket Import, Satisfaction Ratings, Satisfaction Reasons, Suspended Tickets, Ticket Audits, Ticket Comments, Ticket Skips, Ticket Metrics, Ticket Metric Events, Ticket Activities, Tags, Views, Automations, SLA Policies, Targets, Target Failures, Brands, Locales, Schedules, Sharing Agreements, Support Addresses, Ticket Forms, Ticket Fields, User Fields, Organization Fields, Job Statuses, Incremental Skill-based Routing, Workspaces, App Installation Locations, App Locations, Account Settings, Audit Logs, Bookmarks, Twitter Channel
87
88### Sunshine API
89
90Custom Object Types, Custom Object Records, Relationship Types, Relationship Records, Custom Objects Events
91
92### Under Construction
93
94#### Support
95
96- [ ] User Identities
97- [ ] User Passwords
98- [ ] Requests
99- [ ] Attachments
100- [ ] Sessions
101- [ ] Triggers
102- [ ] Macros
103- [ ] Dynamic Content
104- [ ] Skill-based Routing
105- [ ] Apps
106- [ ] OAuth Clients
107- [ ] OAuth Tokens
108- [ ] OAuth Tokens for Grant Types
109- [ ] Authorized Global Clients
110- [ ] Push Notification Devices
111- [ ] Resource Collections
112- [ ] Channel Framework
113
114#### Sunshine
115
116- [ ] Jobs
117- [ ] Limits
118- [ ] Events
119- [ ] Profiles
120- [ ] People
121
122### APIs Up Next
123
124- Help Center API
125- Chat API
126- Talk API
127- Sell API
128- Answer Bot API
129- Status API
130- Reseller API
131- NPS API