所有连接
连接存储服务或系统(如Slack、Shopify或Zendesk)的凭据。亚博您可以使用连接对ZIS流中的REST API请求进行身份验证。有关更多信息,请参见理解连接.
邮差跑进来
如果你使用Postman,你可以将ZIS Connections端点作为一个集合导入到你的Postman应用中,然后尝试不同的请求来了解API是如何工作的。点击以下按钮开始:
如果你不使用邮差,你可以注册一个免费帐户邮递员的网站并下载应用程序。有关使用Postman与Zendesk api的更多信息,请参阅亚博探索Zendesk 亚博api与邮差.
JSON格式
所有连接都表示为具有以下属性的JSON对象:
名字 | 类型 | 只读 | 强制性的 | 描述 |
---|---|---|---|---|
api_key | 数组 | 真正的 | 假 | API密钥连接数组。看到API密钥连接 |
basic_auth | 数组 | 真正的 | 假 | 基本身份验证连接数组。看到基本认证连接 |
bearer_token | 数组 | 真正的 | 假 | 承载令牌连接数组。看到承载令牌连接 |
元 | 对象 | 真正的 | 假 | 用于对结果进行分页光标分页 |
oauth | 数组 | 真正的 | 假 | OAuth连接数组。看到OAuth连接 |
显示连接
GET / api /服务/子/集成/{集成}/ /所有的连接
返回用于集成的所有类型的连接列表。
身份验证
您可以使用OAuth访问令牌.Ze亚博ndesk应用程序也可以使用管理员的浏览器会话授权到该端点的请求。看到从Zendesk应用程序发出API请求亚博.
分页
- 光标分页
看到分页.
每页最多返回100条记录。
参数
名字 | 类型 | 在 | 要求 | 描述 |
---|---|---|---|---|
页面(后) | 字符串 | 查询 | 假 | 下一组结果的游标 |
页面(前) | 字符串 | 查询 | 假 | 上一组结果的游标 |
页面(大小) | 整数 | 查询 | 假 | 要在结果页中显示的项数。不能超过One hundred. |
集成 | 字符串 | 路径 | 真正的 | 集成的名称 |
代码示例
旋度
旋度https://{子域名}.亚博zendesk.com/api/services/zis/integrations/{集成}/ /连接所有\
- h"授权:Bearer {access_token}"
去
进口(
“fmt”
“输入输出”
“net/http”
)
函数主要(){
url:=“https://support.亚博zendesk.com/api/services/zis/integrations/my_integration/connections/all?page[在]= my_first_connection&page[在]= my_tenth_connection&page(大小)= 10”
方法:=“获得”
要求的事情,犯错:=http.NewRequest(方法,url,零)
如果犯错! =零{
fmt.Println(犯错)
返回
}
要求的事情.头.添加(“内容类型”,“application / json”)
客户端:=&http.客户端{}
res,犯错:=客户端.做(要求的事情)
如果犯错! =零{
fmt.Println(犯错)
返回
}
推迟res.身体.关闭()
身体,犯错:=io.ReadAll(res.身体)
如果犯错! =零{
fmt.Println(犯错)
返回
}
fmt.Println(字符串(身体))
}
Java
进口com.squareup.okhttp.*;
OkHttpClient客户端=新OkHttpClient();
HttpUrl.构建器urlBuilder=HttpUrl.解析(“https://support.亚博zendesk.com/api/services/zis/integrations/my_integration/connections/all”)
.newBuilder()
.addQueryParameter(“页面(后)”,“my_first_connection”)
.addQueryParameter(“页面(前)”,“my_tenth_connection”)
.addQueryParameter(“页面大小”,“10”);
请求请求=新请求.构建器()
.url(urlBuilder.构建())
.方法(“获得”,零)
.addHeader(“内容类型”,“application / json”)
.构建();
响应响应=客户端.newCall(请求).执行();
Nodejs
varaxios=需要(“axios”);
var配置={
方法:“得到”,
url:“https://support.亚博zendesk.com/api/services/zis/integrations/my_integration/connections/all”,
头:{
“内容类型”:“application / json”,
},
参数个数:{
的页面(后):“my_first_connection”,
的页面(前):“my_tenth_connection”,
页面(大小)的:“十”,
},
};
axios(配置)
.然后(函数(响应){
控制台.日志(JSON.stringify(响应.数据));
})
.抓(函数(错误){
控制台.日志(错误);
});
Python
进口请求
url=“https://support.亚博zendesk.com/api/services/zis/integrations/my_integration/connections/all?page[在]= my_first_connection&page[在]= my_tenth_connection&page(大小)= 10”
头={
“内容类型”:“application / json”,
}
响应=请求.请求(
“获得”,
url,
头=头
)
打印(响应.文本)
鲁比(人名)
需要“net/http”
uri=URI(“https://support.亚博zendesk.com/api/services/zis/integrations/my_integration/connections/all”)
uri.查询=URI.encode_www_form(“页面(后)”:“my_first_connection”,“页面(前)”:“my_tenth_connection”,“页面大小”:“10”)
请求=网::HTTP::得到.新(uri,“内容类型”:“application / json”)
响应=网::HTTP.开始uri.主机名,uri.港口,use_ssl:真正的做|http|
http.请求(请求)
结束
示例响应(年代)
200好了
//状态200 OK
{
“api_key”:[
{
“allowed_domain”:“api.example.com”,
“api_key”:“* * * * *”,
“created_at”:“1985 - 04 - 12 - t23:20:50.52z”,
“header_name”:“x-api-key”,
“名称”:“my_api_key_connection”,
“updated_at”:“1985 - 04 - 12 - t23:20:50.52z”
}
],
“basic_auth”:[
{
“allowed_domain”:“api.example.com”,
“created_at”:“1985 - 04 - 12 - t23:20:50.52z”,
“名称”:“my_basic_auth_connection”,
“密码”:“* * * * *”,
“updated_at”:“1985 - 04 - 12 - t23:20:50.52z”,
“用户名”:”(电子邮件保护)”
}
],
“bearer_token”:[
{
“allowed_domain”:“api.example.com”,
“created_at”:“1985 - 04 - 12 - t23:20:50.52z”,
“名称”:“my_bearer_token_connection”,
“令牌”:“* * * * *”,
“updated_at”:“1985 - 04 - 12 - t23:20:50.52z”
}
],
“元”:{
“后”:“my_first_connection”,
“之前”:“my_tenth_connection”,
“has_more”:真正的
},
“oauth”:[
{
“access_token”:“ps55XW1CbNj_hKnzwJU3yc968SL39yh3C3Okn1fpC-ThYWDqY2_M5w = = ",
“created_by”:“test_user”,
“名称”:“my_oauth_connection”,
“oauth_access_token_response_body”:”{\“access_token \”,\“ps55XW1CbNj_hKnzwJU3yc968SL39yh3C3Okn1fpC \“}”,
“oauth_url_subdomain”:“foobar”,
“permission_scope”:“读写“,
“refresh_token”:“cs95Xaw_F5PKcxO4fQ9bZKklHKncdkXIc9qGrvktPt2elg = = ",
“token_expiry”:“2021 - 10 - 01 - t12:44:22z”,
“token_type”:“持票人”,
“uuid”:“ac10a230-0c43-45f8-b221-9e085ce90418”
}
]
}
401年未经授权
//状态401未授权
{
“错误”:[
{
“代码”:“InvalidCredentials”,
“标题”:"令牌长度无效"
}
]
}
403年被禁止的
//状态403禁止
{
“错误”:[
{
“代码”:“禁止”,
“标题”:"无法访问此资源。缺少作用域写入"
}
]
}
请求太多
//状态429请求过多
{
“错误”:[
{
“代码”:“TooManyRequests”,
“标题”:“请求太多了”
}
]
}