---
sidebar: auto
---
# API - NodeJS Wrapper for Zendesk API
[![Circle CI](https://circleci.com/gh/StreakYC/node-api-wrapper.svg?style=shield)](https://circleci.com/gh/StreakYC/node-api-wrapper)
[![npm version](https://badge.fury.io/js/streakapi.svg)](https://badge.fury.io/js/streakapi)
NodeJS package that acts as a thin wrapper over the [Zendesk API](https://developer.zendesk.com/rest_api).
To use the API, just do the standard
$ npm install --save node-zendesk
and then
```js
var zendesk = require('node-zendesk');
var client = zendesk.createClient({
username: 'username',
token: 'token',
remoteUri: 'https://remote.zendesk.com/api/v2'
});
client.users.list(function (err, req, result) {
if (err) {
console.log(err);
return;
}
console.log(JSON.stringify(result[0], null, 2, true));//gets the first page
});
```
or you can use `Promises`, you just need to skip the callback:
```js
var zendesk = require('node-zendesk');
var client = zendesk.createClient({
username: 'username',
token: 'token',
remoteUri: 'https://remote.zendesk.com/api/v2'
});
client.users.list()
.then(function(result) {
console.log(JSON.stringify(result[0], null, 2, true));//gets the first page
})
.catch(function(error) {
console.log(error);
});
```
Take a look in the `examples` folder for more examples.
[[toc]]
## Core API Methods
(See: https://developer.zendesk.com/rest_api/docs/core/introduction)
### client
```js
request(method, uri)
requestAll(method, uri) //pulls back multiple pages
requestUpload(uri, file, fileToken, callback)
```
### accountsettings
```js
show(cb)
```
### activitystream
```js
show(activityID, cb)
list(cb)
```
### attachments
```js
upload(file, fileOptions, cb)
deleteUpload(token, cb)
show(attachmentID, cb)
delete(attachmentID, cb)
redactAttachmentComment(ticketID, commentID, attachmentID, cb)
fileOptions = {filename: 'file.txt', token: 'P1c4rDRuLz'}
// token is [optional]
file = // string or Stream (with 'pipe' function)
```
### automations
```js
list(cb)
listActive(automationID, cb)
show(automationID, cb)
create(automation, cb)
update(automationID, automation, cb)
delete(automationID, cb)
reorder(automationIDs, cb) // automationIDs is Array
```
### dynamiccontent
https://developer.zendesk.com/rest_api/docs/core/dynamic_content
```js
listItems(cb)
listAllItems(cb)
showItem(itemID, cb)
createItem(item, cb)
updateItem(itemID, item, cb)
deleteItem(itemID, cb)
listVariants(itemID, cb)
listAllVariants(itemID, cb)
showVariant((itemID, variantID, cb)
createVariant(itemID, variant, cb)
updateVariant(itemID, variantID, variant, cb)
deleteVariant(itemID, variantID, cb)
```
### categories
```js
list(cb)
show(categoryID, cb)
create(category, cb)
update(categoryID, category, cb)
delete(categoryID, cb)
```
### customagentroles
```js
list(cb)
```
### forums
```js
list(cb)
listByCategory(categoryID, cb)
show(forumID, cb)
create(forum, cb)
update(forumID, forum, cb)
delete(forumID, cb)
```
### forumsubscriptions
```js
list(cb)
listByForum(forumID, cb)
show(forumSubscriptionID, cb)
create(forumSubscription, cb)
delete(forumSubscriptionID, cb)
```
### groupmemberships
```js
list(cb)
listByUser(userID, cb)
listByGroup(groupID, cb)
show(groupMembershipID, cb)
showByUser(userID, groupMembershipID, cb)
create(groupMembership, cb)
createByUser(userID, groupMembership, cb)
delete(groupMembershipID, cb)
deleteByUser(userID, groupMembershipID, cb)
makeDefault(userID, groupMembershipID, cb)
```
### groups
```js
list(cb)
assignable(cb)
show(groupID, cb)
create(group, cb)
update(groupID, group, cb)
delete(groupID, cb)
```
### jobstatuses
```js
show(jobStatusID, cb)
watch(jobStatusID, interval, maxAttempts, cb)
```
### locales
```js
list(cb)
show(localeID, cb)
showCurrent(cb)
current(cb)
```
### macros
```js
list(cb)
listByParams(params, cb)
apply(macroID, cb)
applyTicket(ticketID, macroID, cb)
create(macro, cb)
categories(cb)
update(macroID, macro, cb)
createMany(users, cb)
```
### oauthtokens
```js
list(cb)
show(id, cb)
current(cb)
revoke(id, cb)
```
### organizations
```js
list(cb)
show(organizationID, cb)
create(organization, cb)
createMany(organizations, cb)
update(organizationID, organization, cb)
updateMany(organizations, cb)
upsert(organizationID, organization, cb)
delete(organizationID, cb)
incrementalInclude(startTime, includes, cb) // New Export API supporing includes
incremental(startTime, cb) // New Export API
incrementalSample(startTime, cb) // New Export API Sample
```
### organizationfields
```js
list(cb)
show(organizationFieldID, cb)
create(organizationField, cb)
update(organizationFieldID, organizationField, cb)
delete(organizationFieldID, cb)
```
### (SLA) policies
```js
list(cb)
show(policyID, cb)
create(policy, cb)
update(policyID, policy, cb)
delete(policyID, cb)
```
### requests
```js
list(cb)
listOpen(cb)
listSolved(cb)
listCCD(cb)
listByUser(userID, cb)
listByOrganization(orgID, cb)
getRequest(requestID, cb)
create(request, cb)
update(requestID, request, cb)
listComments(requestID, cb)
getComment(requestID, commentID, cb)
```
### satisfactionratings
```js
list(cb)
received(cb)
show(satisfactionRatingID, cb)
```
### search
```js
query(searchTerm, cb)
queryAll(searchTerm, cb)
queryAnonymous (searchTerm, cb)
queryAnonymousAll (searchTerm, cb)
```
### sessions
```js
get(cb)
getByUserId(userId, cb)
getByUserIdBySessionId(userId, sessionId, cb)
getMyAuthenticatedSession(cb)
deleteByUserIdBySessionId(userId, sessionId, cb)
bulkDeleteByUserId(userId, cb)
logMeOut(cb)
```
### suspendedtickets
```js
list(cb)
show(suspendedTicketID, cb)
recover(suspendedTicketID, cb)
recoverMany(suspendedTicketIDs, cb)
delete(suspendedTicketID, cb)
destroyMany(suspendedTicketIDs, cb)
deleteMany(suspendedTicketIDs, cb)
```
### tags
```js
list(cb)
```
### ticketaudits
```js
list(ticketID, cb)
```
### ticketevents
```js
incrementalInclude(startTime, includes, cb) // New Export API supporing includes
incremental(startTime, cb)
incrementalSample(startTime, cb)
```
### ticketforms
```js
list(cb)
show(ticketFormID, cb)
```
### ticketfields
```js
list(cb)
show(ticketFieldID, cb)
create(ticketField, cb)
update(ticketFieldID, ticketField, cb)
delete(ticketFieldID, cb)
```
### ticketmetrics
```js
list(ticketId, cb)
listAll(cb)
show(ticketMetricId, cb)
```
### tickets
```js
list(cb)
listAssigned(userID, cb)
listByOrganization(orgID, cb)
listByUserRequested(userID, cb)
listByUserCCD(userID, cb) // email cc
listRecent(cb)
listCollaborators(ticketID, cb)
listIncidents(ticketID, cb)
listMetrics(ticketID, cb)
show(ticketID, cb)
showMany(ticket_ids, cb)
create(ticket, cb)
createMany(tickets, cb)
update(ticketID, ticket, cb)
merge(ticketID, mergedTicket, cb)
updateMany(ticket_ids, ticket, cb)
deleteMany(ticket_ids, cb)
delete(ticketID, cb)
export(startTime, cb) //1000 per page export
exportSample(startTime, cb) //Ticket Export Sample (max 50 tickets per request)
exportAudit(ticketID, cb) //Listing Audits
getComments(ticketID, cb)
incrementalInclude(startTime, includes, cb) // New Export API supporing includes
incremental(startTime, cb) // New Export API
incrementalSample(startTime, cb) // New Export API Sample
```
### ticketexports
```js
export(start_time, cb)
exportWithUser(start_time, cb)
exportAudit(ticketID, cb)
```
### ticketimport
```js
import(ticket, cb)
exportAudit(ticketID, cb)
```
### topiccomments
```js
list(topicID, cb)
listByUser(userID, cb)
show(topicID, commentID, cb)
showByUser(userID, commentID, cb)
create(topicID, comment, cb)
update(topicID, commentID, comment, cb)
delete(topicID, commentID, cb)
```
### topics
```js
list(cb)
listByForum(forumID, cb)
listByUser(userID, cb)
show(topicID, cb)
showMany(topicIDs, cb)
create(topic, cb)
update(topicID, topic, cb)
delete(topicID, cb)
```
### topicsubscriptions
```js
list(cb)
listByTopic(topicID, cb)
show(topicSubscriptionsID, cb)
create(topicSubscription, cb)
delete
没有合适的资源?快使用搜索试试~ 我知道了~
node-zendesk:与node.js一起使用的zendesk API客户端库
共116个文件
js:95个
md:9个
npmignore:2个
需积分: 10 1 下载量 8 浏览量
2021-02-01
08:27:37
上传
评论
收藏 231KB ZIP 举报
温馨提示
节点zendesk 一个与node.js一起使用的Zendesk API客户端库 阅读blakmatrix.github.io/node-zendesk/的完整文档 承诺支持介绍 Promise支持是在@v 2.0.0中引入的,@ v 2.0.0是没有Promises @v 1.5.0的传统版本的node-zendesk。 安装 要使用API,只需执行标准 $ npm install --save node-zendesk 例 var zendesk = require ( 'node-zendesk' ) ; var client = zendesk . createClient ( { username : 'username' , token : 'token' , remoteUri : 'https://remote.zendesk.com/api/v2' } ) ; client . users . list ( function ( err , req , result ) { if ( err ) { console . log
资源详情
资源评论
资源推荐
收起资源包目录
node-zendesk:与node.js一起使用的zendesk API客户端库 (116个子文件)
busey.gif 44KB
.gitignore 62B
client.js 13KB
tickets.js 6KB
users.js 4KB
articles.js 4KB
translations.js 4KB
client.js 4KB
organizations.js 3KB
requests.js 3KB
organizationmemberships.js 3KB
sections.js 3KB
subscriptions.js 3KB
views.js 3KB
groupmemberships.js 3KB
votes.js 2KB
useridentities.js 2KB
dynamiccontent.js 2KB
articleattachments.js 2KB
categories.js 2KB
articlecomments.js 2KB
topiccomments.js 2KB
topics.js 2KB
suspendedtickets.js 2KB
attachments.js 2KB
automations.js 2KB
macros.js 2KB
triggers.js 2KB
articlelabels.js 2KB
search.js 2KB
organizationfields.js 2KB
phonenumbers.js 2KB
helpers.js 2KB
topicsubscriptions.js 1KB
forumsubscriptions.js 1KB
throttle.js 1KB
installations.js 1KB
groups.js 1KB
ticketfields.js 1KB
satisfactionratings.js 1KB
brand.js 1KB
config.js 1KB
invitations.js 1KB
sessions.js 1KB
forums.js 1KB
userfields.js 1KB
categories.js 1KB
topicvotes.js 1KB
policies.js 1KB
targets.js 1KB
greetings.js 1KB
ticketevents.js 1KB
ticketmetrics.js 1KB
ticketexport.js 1KB
search.js 999B
locales.js 940B
accesspolicies.js 895B
oauthtokens.js 894B
ticketimport.js 875B
greetingcategories.js 866B
availabilities.js 853B
targetfailures.js 827B
links.js 807B
activitystream.js 805B
ticketforms.js 794B
imports.js 787B
surveys.js 774B
ticketaudits.js 769B
user-create-many.js 744B
jobstatuses.js 735B
historicalqueueactivity.js 716B
currentqueueactivity.js 680B
ticket-create-promise.js 671B
ticket-list-observer.js 641B
ticket-create.js 632B
sharingagreement.js 621B
customagentroles.js 618B
accountsettings.js 607B
agentactivity.js 601B
organization-upsert.js 588B
upload-attachment.js 567B
user-fields-list.js 529B
tags.js 518B
user-create-promise.js 508B
users-list.js 507B
user-create.js 497B
search-query.js 476B
ticket-delete.js 460B
ticket-list.js 456B
organization-fields-list.js 441B
check-oauth-token.js 424B
check-auth-promise.js 414B
check-auth.js 411B
check-auth-token.js 409B
enhanceApp.js 378B
exampleConfig.js 118B
pass-test.js 12B
package-lock.json 433KB
package.json 3KB
LICENSE 1KB
共 116 条
- 1
- 2
biuh
- 粉丝: 33
- 资源: 4736
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
最新资源
- 三菱电梯主板地址表参数 三菱电梯地址码, 778主板地址参数, 758电梯主板地址参数
- 藏区特产销售平台--论文-springboot毕业项目,适合计算机毕-设、实训项目、大作业学习.zip
- 洞见研报亚太卫星宽带(卫星宽带通信服务商,亚太卫星宽带通信(深圳)有限公司)创投信息
- 在线学籍管理系统--论文-springboot毕业项目,适合计算机毕-设、实训项目、大作业学习.zip
- “共享书角”图书借还管理系统--论文-springboot毕业项目,适合计算机毕-设、实训项目、大作业学习.zip
- 职称评审管理系统-springboot毕业项目,适合计算机毕-设、实训项目、大作业学习.zip
- 智慧党建系统设计与实现_1i659--论文-springboot毕业项目,适合计算机毕-设、实训项目、大作业学习.zip
- java学习平台--论文-springboot毕业项目,适合计算机毕-设、实训项目、大作业学习.zip
- 洞见研报云蝠智能(语音大数据及智能化客服解决方案供应商,南京星蝠科技有限公司)创投信息
- 基于labview的双音多频系统设计
- 基于Java的超市进销存系统--论文-springboot毕业项目,适合计算机毕-设、实训项目、大作业学习.zip
- 智慧学生校舍系统--论文-springboot毕业项目,适合计算机毕-设、实训项目、大作业学习.zip
- 光伏发电并网系统 matlab simulink整体仿真,波形如图,光伏板,MPPT控制boost,坐标变,锁相环,dq功率控制+解耦控制+电流内环电压外环,pwm调制,滤波器,此链接有2018a和
- 自习室预订系统-springboot毕业项目,适合计算机毕-设、实训项目、大作业学习.zip
- pytorch3D 为使用pytorch进行 3D 计算机视觉研究提供了高效、可重复使用的组件
- aarch64汇编指令集介绍
资源上传下载、课程学习等过程中有任何疑问或建议,欢迎提出宝贵意见哦~我们会及时处理!
点击此处反馈
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功
评论0