OAuth连接
存储和管理集成的OAuth访问令牌。看到创建和管理OAuth连接。
JSON格式
OAuth连接被表示为具有以下属性的JSON对象:
名字 | 类型 | 只读 | 强制性的 | 描述 |
---|---|---|---|---|
access_token | 字符串 | 真正的 | 假 | OAuth访问令牌 |
created_by | 字符串 | 真正的 | 假 | 创建连接的用户 |
集成 | 字符串 | 假 | 假 | 集成的名称 |
名字 | 字符串 | 假 | 假 | 用于唯一标识连接的名称。看到连接名称 |
oauth_access_token_response_body | 字符串 | 真正的 | 假 | 获取访问令牌时OAuth提供程序的响应 |
oauth_url_subdomain | 字符串 | 假 | 假 | 子域用于在OAuth提供程序的授权或令牌URL中插入子域占位符 |
permission_scope | 字符串 | 假 | 假 | 以空格分隔的字符串,用于列出OAuth流的所需OAuth权限 |
refresh_token | 字符串 | 真正的 | 假 | OAuth刷新令牌 |
token_expiry | 字符串 | 真正的 | 假 | 访问令牌的过期时间。YYYY-MM-DDThh:mm:ssZ格式 |
token_type | 字符串 | 真正的 | 假 | 令牌类型。例如,“承载者” |
uuid | 字符串 | 真正的 | 假 | 连接的UUID |
亚博zendesk_account_id | 整数 | 真正的 | 假 | Zend亚博esk帐户ID |
启动OAuth Flow
POST / api /服务/子/联系/ oauth /启动/{集成}
为客户端启动OAuth流。
身份验证
您可以使用OAuth访问令牌。Ze亚博ndesk应用程序也可以使用管理员的浏览器会话授权到该端点的请求。看到从Zendesk应用程序发出API请求亚博。
参数
名字 | 类型 | 在 | 要求 | 描述 |
---|---|---|---|---|
集成 | 字符串 | 路径 | 真正的 | 集成的名称 |
例子的身体
{
“allow_offline_access”:真正的,
“grant_type”:“authorization_code”,
“名称”:“my_flow”,
“oauth_client_name”:“my_oauth_client_name”,
“oauth_client_uuid”:“9 c81f444-4beb-4ba7-9bcc-6b2d068e7ade”,
“oauth_url_subdomain”:“foobar”,
“origin_oauth_redirect_url”:“https://client.int/callback”,
“permission_scopes”:“读写“
}
代码示例
旋度
旋度https://{子域名}.亚博zendesk.com/api/services/zis/connections/oauth/start/{集成}\
- h"授权:Bearer {access_token}"\
- x的帖子\
- h“application / json内容类型:\
- d”{
“allow_offline_access”:没错,
:“grant_type authorization_code”,
“名称”:“my_flow”,
:“oauth_client_name my_oauth_client_name”,
:“oauth_client_uuid 9 c81f444-4beb-4ba7-9bcc-6b2d068e7ade”,
“oauth_url_subdomain”:“foobar”,
“origin_oauth_redirect_url”:“https://client.int/callback”,
permission_scopes:读写
} '
去
进口(
“fmt”
“输入输出”
“net/http”
“弦”
)
函数主要(){
url:=“https://support.亚博zendesk.com/api/services/zis/connections/oauth/start/my_integration”
方法:=“职位”
有效载荷:=字符串。NewReader(”{
“allow_offline_access”:没错,
:“grant_type authorization_code”,
“名称”:“my_flow”,
:“oauth_client_name my_oauth_client_name”,
:“oauth_client_uuid 9 c81f444-4beb-4ba7-9bcc-6b2d068e7ade”,
“oauth_url_subdomain”:“foobar”,
“origin_oauth_redirect_url”:“https://client.int/callback”,
permission_scopes:读写
} ')
要求的事情,犯错:=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/connections/oauth/start/my_integration”)
。newBuilder();
RequestBody身体=RequestBody。创建(MediaType。解析(“application / json”),
"""
{
allow_offline_access \“\”:真正的,
grant_type \“\”:authorization_code \“\”,
\“\”:my_flow \“\”,
oauth_client_name \“\”:my_oauth_client_name \“\”,
oauth_client_uuid \“\”:\”9c81f444-4beb-4ba7-9bcc-6b2d068e7ade \”,
oauth_url_subdomain \“\”:\“foobar \”,
origin_oauth_redirect_url \“\”:\“https://客户端。int/回调\”,
permission_scopes \“\”:\“阅读写\”
}""");
请求请求=新请求。构建器()
。url(urlBuilder。构建())
。方法(“职位”,身体)
。addHeader(“内容类型”,“application / json”)
。构建();
响应响应=客户端。newCall(请求)。执行();
Nodejs
varaxios=需要(“axios”);
var数据=JSON。stringify({
“allow_offline_access”:真正的,
“grant_type”:“authorization_code”,
“名称”:“my_flow”,
“oauth_client_name”:“my_oauth_client_name”,
“oauth_client_uuid”:“9 c81f444-4beb-4ba7-9bcc-6b2d068e7ade”,
“oauth_url_subdomain”:“foobar”,
“origin_oauth_redirect_url”:“https://client.int/callback”,
“permission_scopes”:“读写“
});
var配置={
方法:“职位”,
url:“https://support.亚博zendesk.com/api/services/zis/connections/oauth/start/my_integration”,
头:{
“内容类型”:“application / json”,
},
数据:数据,
};
axios(配置)
。然后(函数(响应){
控制台。日志(JSON。stringify(响应。数据));
})
。抓(函数(错误){
控制台。日志(错误);
});
Python
进口请求
进口json
url=“https://support.亚博zendesk.com/api/services/zis/connections/oauth/start/my_integration”
有效载荷=json。加载(”““{
“allow_offline_access”:没错,
:“grant_type authorization_code”,
“名称”:“my_flow”,
:“oauth_client_name my_oauth_client_name”,
:“oauth_client_uuid 9 c81f444-4beb-4ba7-9bcc-6b2d068e7ade”,
“oauth_url_subdomain”:“foobar”,
“origin_oauth_redirect_url”:“https://client.int/callback”,
permission_scopes:读写
}”“”)
头={
“内容类型”:“application / json”,
}
响应=请求。请求(
“职位”,
url,
头=头,
json=有效载荷
)
打印(响应。文本)
鲁比(人名)
需要“net/http”
uri=URI(“https://support.亚博zendesk.com/api/services/zis/connections/oauth/start/my_integration”)
请求=网::HTTP::帖子。新(uri,“内容类型”:“application / json”)
请求。身体=%问({
“allow_offline_access”:真正的,
“grant_type”:“authorization_code”,
“名称”:“my_flow”,
“oauth_client_name”:“my_oauth_client_name”,
“oauth_client_uuid”:“9 c81f444-4beb-4ba7-9bcc-6b2d068e7ade”,
“oauth_url_subdomain”:“foobar”,
“origin_oauth_redirect_url”:“https://client.int/callback”,
“permission_scopes”:“读写“
})
响应=网::HTTP。开始uri。主机名,uri。港口,use_ssl:真正的做|http|
http。请求(请求)
结束
示例响应(年代)
200好了
//状态200 OK
{
“redirect_url”:“https://foobar.亚博zendesk.com/api/services/zis/connections/oauth/start_redirect?flow_token=xyz”
}
401年未经授权
//状态401未授权
{
“错误”:[
{
“代码”:“1200”,
“细节”:“未经授权的”,
“状态”:“401”
}
]
}
403年被禁止的
//状态403禁止
{
“错误”:[
{
“代码”:“1200”,
“细节”:“禁止”,
“状态”:“403”
}
]
}
404未找到
//状态404未找到
{
“错误”:[
{
“代码”:“1302”,
“细节”:“没有找到”,
“状态”:“404”
}
]
}
422不可处理实体
//状态422不可处理的实体
{
“错误”:[
{
“代码”:“1303”,
“细节”:"无效值:集成。说明:集成不能为零”,
“状态”:“422”
}
]
}
请求太多
//状态429请求过多
{
“错误”:[
{
“代码”:“1300”,
“细节”:“请求太多了”,
“状态”:“429”
}
]
}
启动OAuth重定向
GET / api /服务/子/联系/ oauth / start_redirect吗?flow_token = {flow_token}
发出HTTPs请求时启动OAuth Flow,则返回此端点redirect_url
在回应中。
参数
名字 | 类型 | 在 | 要求 | 描述 |
---|---|---|---|---|
flow_token | 字符串 | 查询 | 真正的 | 标记的一部分redirect_url 政府的回应oauth /启动/{集成} 端点 |
代码示例
旋度
旋度https://{子域名}.亚博zendesk.com/api/services/zis/connections/oauth/start_redirect ? flow_token={flow_token}
去
进口(
“fmt”
“输入输出”
“net/http”
)
函数主要(){
url:=“https://support.亚博zendesk.com/api/services/zis/connections/oauth/start_redirect?flow_token=TgtEfGWfduqzwNnkST8jNsr5MnjPnYEt”
方法:=“获得”
要求的事情,犯错:=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/connections/oauth/start_redirect”)
。newBuilder()
。addQueryParameter(“flow_token”,“TgtEfGWfduqzwNnkST8jNsr5MnjPnYEt”);
请求请求=新请求。构建器()
。url(urlBuilder。构建())
。方法(“获得”,零)
。addHeader(“内容类型”,“application / json”)
。构建();
响应响应=客户端。newCall(请求)。执行();
Nodejs
varaxios=需要(“axios”);
var配置={
方法:“得到”,
url:“https://support.亚博zendesk.com/api/services/zis/connections/oauth/start_redirect”,
头:{
“内容类型”:“application / json”,
},
参数个数:{
“flow_token”:“TgtEfGWfduqzwNnkST8jNsr5MnjPnYEt”,
},
};
axios(配置)
。然后(函数(响应){
控制台。日志(JSON。stringify(响应。数据));
})
。抓(函数(错误){
控制台。日志(错误);
});
Python
进口请求
url=“https://support.亚博zendesk.com/api/services/zis/connections/oauth/start_redirect?flow_token=TgtEfGWfduqzwNnkST8jNsr5MnjPnYEt”
头={
“内容类型”:“application / json”,
}
响应=请求。请求(
“获得”,
url,
头=头
)
打印(响应。文本)
鲁比(人名)
需要“net/http”
uri=URI(“https://support.亚博zendesk.com/api/services/zis/connections/oauth/start_redirect”)
uri。查询=URI。encode_www_form(“flow_token”:“TgtEfGWfduqzwNnkST8jNsr5MnjPnYEt”)
请求=网::HTTP::得到。新(uri,“内容类型”:“application / json”)
响应=网::HTTP。开始uri。主机名,uri。港口,use_ssl:真正的做|http|
http。请求(请求)
结束
示例响应(年代)
307临时重定向
//状态307临时重定向
零
400错误请求
//状态400错误请求
{
“错误”:[
{
“代码”:“1301”,
“细节”:“无效的请求”,
“状态”:“400”
}
]
}
OAuth令牌
POST / api /服务/子/联系/ oauth /令牌/{集成}
返回Zendesk OAuth令牌URL的代理。亚博有关Zendesk OAuth流的详细信息,请参见亚博对应用程序使用OAuth身份验证。
参数
名字 | 类型 | 在 | 要求 | 描述 |
---|---|---|---|---|
集成 | 字符串 | 路径 | 真正的 | 集成的名称 |
例子的身体
{
“client_id”:“my_client_id”,
“client_secret”:“my_client_secret”,
“代码”:“LgwEzL8CA3aRA35r5QYfRbjjMa3Iacsk1CvwcRsnM”,
“grant_type”:“authorization_code”,
“redirect_uri”:“https://client.int/callback”,
“范围”:“读写“
}
代码示例
旋度
旋度https://{子域名}.亚博zendesk.com/api/services/zis/connections/oauth/tokens/{集成}\
- x的帖子\
- h“application / json内容类型:\
- d”{
:“client_id my_client_id”,
:“client_secret my_client_secret”,
“代码”:“LgwEzL8CA3aRA35r5QYfRbjjMa3Iacsk1CvwcRsnM”,
:“grant_type authorization_code”,
“redirect_uri”:“https://client.int/callback”,
scope:读写
} '
去
进口(
“fmt”
“输入输出”
“net/http”
“弦”
)
函数主要(){
url:=“https://support.亚博zendesk.com/api/services/zis/connections/oauth/tokens/my_integration”
方法:=“职位”
有效载荷:=字符串。NewReader(”{
:“client_id my_client_id”,
:“client_secret my_client_secret”,
“代码”:“LgwEzL8CA3aRA35r5QYfRbjjMa3Iacsk1CvwcRsnM”,
:“grant_type authorization_code”,
“redirect_uri”:“https://client.int/callback”,
scope:读写
} ')
要求的事情,犯错:=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/connections/oauth/tokens/my_integration”)
。newBuilder();
RequestBody身体=RequestBody。创建(MediaType。解析(“application / json”),
"""
{
\ " client_id \”:my_client_id \“\”,
client_secret \“\”:my_client_secret \“\”,
\ \“代码”:\”LgwEzL8CA3aRA35r5QYfRbjjMa3Iacsk1CvwcRsnM\”,
grant_type \“\”:authorization_code \“\”,
redirect_uri \“\”:\“https://客户端。int/回调\”,
\ \“范围”:\“阅读写\”
}""");
请求请求=新请求。构建器()
。url(urlBuilder。构建())
。方法(“职位”,身体)
。addHeader(“内容类型”,“application / json”)
。构建();
响应响应=客户端。newCall(请求)。执行();
Nodejs
varaxios=需要(“axios”);
var数据=JSON。stringify({
“client_id”:“my_client_id”,
“client_secret”:“my_client_secret”,
“代码”:“LgwEzL8CA3aRA35r5QYfRbjjMa3Iacsk1CvwcRsnM”,
“grant_type”:“authorization_code”,
“redirect_uri”:“https://client.int/callback”,
“范围”:“读写“
});
var配置={
方法:“职位”,
url:“https://support.亚博zendesk.com/api/services/zis/connections/oauth/tokens/my_integration”,
头:{
“内容类型”:“application / json”,
},
数据:数据,
};
axios(配置)
。然后(函数(响应){
控制台。日志(JSON。stringify(响应。数据));
})
。抓(函数(错误){
控制台。日志(错误);
});
Python
进口请求
进口json
url=“https://support.亚博zendesk.com/api/services/zis/connections/oauth/tokens/my_integration”
有效载荷=json。加载(”““{
:“client_id my_client_id”,
:“client_secret my_client_secret”,
“代码”:“LgwEzL8CA3aRA35r5QYfRbjjMa3Iacsk1CvwcRsnM”,
:“grant_type authorization_code”,
“redirect_uri”:“https://client.int/callback”,
scope:读写
}”“”)
头={
“内容类型”:“application / json”,
}
响应=请求。请求(
“职位”,
url,
头=头,
json=有效载荷
)
打印(响应。文本)
鲁比(人名)
需要“net/http”
uri=URI(“https://support.亚博zendesk.com/api/services/zis/connections/oauth/tokens/my_integration”)
请求=网::HTTP::帖子。新(uri,“内容类型”:“application / json”)
请求。身体=%问({
“client_id”:“my_client_id”,
“client_secret”:“my_client_secret”,
“代码”:“LgwEzL8CA3aRA35r5QYfRbjjMa3Iacsk1CvwcRsnM”,
“grant_type”:“authorization_code”,
“redirect_uri”:“https://client.int/callback”,
“范围”:“读写“
})
响应=网::HTTP。开始uri。主机名,uri。港口,use_ssl:真正的做|http|
http。请求(请求)
结束
示例响应(年代)
200好了
//状态200 OK
{
“access_token”:“ps55XW1CbNj_hKnzwJU3yc968SL39yh3C3Okn1fpC-ThYWDqY2_M5w = = ",
“范围”:“读写“,
“token_type”:“持票人”
}
400错误请求
//状态400错误请求
{
“错误”:[
{
“代码”:“1301”,
“细节”:“无效的请求”,
“状态”:“400”
}
]
}
401年未经授权
//状态401未授权
{
“错误”:[
{
“代码”:“1200”,
“细节”:“未经授权的”,
“状态”:“401”
}
]
}
403年被禁止的
//状态403禁止
{
“错误”:[
{
“代码”:“1200”,
“细节”:“禁止”,
“状态”:“403”
}
]
}
422不可处理实体
//状态422不可处理的实体
{
“错误”:[
{
“代码”:“1303”,
“细节”:"无效值:集成。说明:集成不能为零”,
“状态”:“422”
}
]
}
交易所验证码
GET / api /服务/子/联系/ oauth / access_codes /{集成}?verification_code = {verification_code}
当提供验证码时,返回访问码和连接UUID。
身份验证
您可以使用OAuth访问令牌。Ze亚博ndesk应用程序也可以使用管理员的浏览器会话授权到该端点的请求。看到从Zendesk应用程序发出API请求亚博。
参数
名字 | 类型 | 在 | 要求 | 描述 |
---|---|---|---|---|
verification_code | 字符串 | 查询 | 真正的 | 从授权流返回的验证码 |
集成 | 字符串 | 路径 | 真正的 | 集成的名称 |
代码示例
旋度
旋度https://{子域名}.亚博zendesk.com/api/services/zis/connections/oauth/access_codes/{集成}verification_code ?={verification_code}\
- h"授权:Bearer {access_token}"
去
进口(
“fmt”
“输入输出”
“net/http”
)
函数主要(){
url:=“https://support.亚博zendesk.com/api/services/zis/connections/oauth/access_codes/my_integration?verification_code=s8fOrC4oP”
方法:=“获得”
要求的事情,犯错:=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/connections/oauth/access_codes/my_integration”)
。newBuilder()
。addQueryParameter(“verification_code”,“s8fOrC4oP”);
请求请求=新请求。构建器()
。url(urlBuilder。构建())
。方法(“获得”,零)
。addHeader(“内容类型”,“application / json”)
。构建();
响应响应=客户端。newCall(请求)。执行();
Nodejs
varaxios=需要(“axios”);
var配置={
方法:“得到”,
url:“https://support.亚博zendesk.com/api/services/zis/connections/oauth/access_codes/my_integration”,
头:{
“内容类型”:“application / json”,
},
参数个数:{
“verification_code”:“s8fOrC4oP”,
},
};
axios(配置)
。然后(函数(响应){
控制台。日志(JSON。stringify(响应。数据));
})
。抓(函数(错误){
控制台。日志(错误);
});
Python
进口请求
url=“https://support.亚博zendesk.com/api/services/zis/connections/oauth/access_codes/my_integration?verification_code=s8fOrC4oP”
头={
“内容类型”:“application / json”,
}
响应=请求。请求(
“获得”,
url,
头=头
)
打印(响应。文本)
鲁比(人名)
需要“net/http”
uri=URI(“https://support.亚博zendesk.com/api/services/zis/connections/oauth/access_codes/my_integration”)
uri。查询=URI。encode_www_form(“verification_code”:“s8fOrC4oP”)
请求=网::HTTP::得到。新(uri,“内容类型”:“application / json”)
响应=网::HTTP。开始uri。主机名,uri。港口,use_ssl:真正的做|http|
http。请求(请求)
结束
示例响应(年代)
200好了
//状态200 OK
{
“access_token”:“ps55XW1CbNj_hKnzwJU3yc968SL39yh3C3Okn1fpC-ThYWDqY2_M5w = = ",
“created_by”:“test_user”,
“集成”:“my_integration”,
“oauth_access_token_response_body”:”{\“access_token \”,\“ps55XW1CbNj_hKnzwJU3yc968SL39yh3C3Okn1fpC \“}”,
“origin_oauth_redirect_url”:“https://client.int/callback”,
“permission_scope”:“读写“,
“raw_callback_params”:“代码= aPrx.f3G28C1ueiVxd.Skd2w.u5bioOnuzTNDdT81IaImk7PKmXXHAfVBtYu5rK.Yh.lDL4jsA&state = CC5j68_SRVA5pSBbDkMq2sa4d36NyibXf12_Hf2POkk”,
“refresh_token”:“cs95Xaw_F5PKcxO4fQ9bZKklHKncdkXIc9qGrvktPt2elg = = ",
“token_expiry”:“2021 - 10 - 01 - t12:44:22z”,
“token_type”:“持票人”,
“uuid”:“ac10a230-0c43-45f8-b221-9e085ce90418”,
“亚博zendesk_account_id”:123456
}
400错误请求
//状态400错误请求
{
“错误”:[
{
“代码”:“1301”,
“细节”:“无效的请求”,
“状态”:“400”
}
]
}
401年未经授权
//状态401未授权
{
“错误”:[
{
“代码”:“1200”,
“细节”:“未经授权的”,
“状态”:“401”
}
]
}
刷新OAuth Token
GET / api /服务/子/联系/更新/{集成}
刷新OAuth令牌。
参数
名字 | 类型 | 在 | 要求 | 描述 |
---|---|---|---|---|
名字 | 字符串 | 查询 | 假 | 连接名称。指定“uuid”或“name” |
uuid | 字符串 | 查询 | 假 | 连接的UUID。指定“uuid”或“name” |
集成 | 字符串 | 路径 | 真正的 | 集成的名称 |
代码示例
旋度
旋度https://{子域名}.亚博zendesk.com/api/services/zis/connections/refresh/{集成}uuid ?={uuid}\
- h"授权:Bearer {access_token}"
旋度
旋度https://{子域名}.亚博zendesk.com/api/services/zis/connections/refresh/{集成}名字吗?={名字}\
- h"授权:Bearer {access_token}"
去
进口(
“fmt”
“输入输出”
“net/http”
)
函数主要(){
url:=“https://support.亚博zendesk.com/api/services/zis/connections/refresh/my_integration?name=my_oauth_connection&uuid=9c865cd6 - 858 e - 42 - c6 - b14d - 2 - cc43f3b4ac4”
方法:=“获得”
要求的事情,犯错:=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/connections/refresh/my_integration”)
。newBuilder()
。addQueryParameter(“名称”,“my_oauth_connection”)
。addQueryParameter(“uuid”,“9 c865cd6 - 858 e - 42 - c6 - b14d - 2 - cc43f3b4ac4”);
请求请求=新请求。构建器()
。url(urlBuilder。构建())
。方法(“获得”,零)
。addHeader(“内容类型”,“application / json”)
。构建();
响应响应=客户端。newCall(请求)。执行();
Nodejs
varaxios=需要(“axios”);
var配置={
方法:“得到”,
url:“https://support.亚博zendesk.com/api/services/zis/connections/refresh/my_integration”,
头:{
“内容类型”:“application / json”,
},
参数个数:{
“名字”:“my_oauth_connection”,
“uuid”:9 c865cd6 - 858 - e - 42 - c6 - b14d - 2 - cc43f3b4ac4”,
},
};
axios(配置)
。然后(函数(响应){
控制台。日志(JSON。stringify(响应。数据));
})
。抓(函数(错误){
控制台。日志(错误);
});
Python
进口请求
url=“https://support.亚博zendesk.com/api/services/zis/connections/refresh/my_integration?name=my_oauth_connection&uuid=9c865cd6 - 858 e - 42 - c6 - b14d - 2 - cc43f3b4ac4”
头={
“内容类型”:“application / json”,
}
响应=请求。请求(
“获得”,
url,
头=头
)
打印(响应。文本)
鲁比(人名)
需要“net/http”
uri=URI(“https://support.亚博zendesk.com/api/services/zis/connections/refresh/my_integration”)
uri。查询=URI。encode_www_form(“名称”:“my_oauth_connection”,“uuid”:“9 c865cd6 - 858 e - 42 - c6 - b14d - 2 - cc43f3b4ac4”)
请求=网::HTTP::得到。新(uri,“内容类型”:“application / json”)
响应=网::HTTP。开始uri。主机名,uri。港口,use_ssl:真正的做|http|
http。请求(请求)
结束
示例响应(年代)
200好了
//状态200 OK
{
“access_token”:“ps55XW1CbNj_hKnzwJU3yc968SL39yh3C3Okn1fpC-ThYWDqY2_M5w = = ",
“created_by”:“test_user”,
“集成”:“my_integration”,
“名称”:“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”,
“亚博zendesk_account_id”:123456
}
400错误请求
//状态400错误请求
{
“错误”:[
{
“代码”:“1301”,
“细节”:“无效的请求”,
“状态”:“400”
}
]
}
401年未经授权
//状态401未授权
{
“错误”:[
{
“代码”:“1200”,
“细节”:“未经授权的”,
“状态”:“401”
}
]
}
403年被禁止的
//状态403禁止
{
“错误”:[
{
“代码”:“1200”,
“细节”:“禁止”,
“状态”:“403”
}
]
}
422不可处理实体
//状态422不可处理的实体
{
“错误”:[
{
“代码”:“1303”,
“细节”:"无效值:集成。说明:集成不能为零”,
“状态”:“422”
}
]
}
显示OAuth连接
GET / api /服务/子/联系/{集成}
返回集成的连接详细信息。
身份验证
您可以使用OAuth访问令牌。Ze亚博ndesk应用程序也可以使用管理员的浏览器会话授权到该端点的请求。看到从Zendesk应用程序发出API请求亚博。
参数
名字 | 类型 | 在 | 要求 | 描述 |
---|---|---|---|---|
名字 | 字符串 | 查询 | 假 | 连接名称。指定“uuid”或“name” |
uuid | 字符串 | 查询 | 假 | 连接的UUID。指定“uuid”或“name” |
集成 | 字符串 | 路径 | 真正的 | 集成的名称 |
代码示例
旋度
旋度https://{子域名}.亚博zendesk.com/api/services/zis/connections/{集成}uuid ?={uuid}\
- h"授权:Bearer {access_token}"
旋度
旋度https://{子域名}.亚博zendesk.com/api/services/zis/connections/{集成}名字吗?={名字}\
- h"授权:Bearer {access_token}"
去
进口(
“fmt”
“输入输出”
“net/http”
)
函数主要(){
url:=“https://support.亚博zendesk.com/api/services/zis/connections/my_integration?name=my_oauth_connection&uuid=9c865cd6 - 858 e - 42 - c6 - b14d - 2 - cc43f3b4ac4”
方法:=“获得”
要求的事情,犯错:=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/connections/my_integration”)
。newBuilder()
。addQueryParameter(“名称”,“my_oauth_connection”)
。addQueryParameter(“uuid”,“9 c865cd6 - 858 e - 42 - c6 - b14d - 2 - cc43f3b4ac4”);
请求请求=新请求。构建器()
。url(urlBuilder。构建())
。方法(“获得”,零)
。addHeader(“内容类型”,“application / json”)
。构建();
响应响应=客户端。newCall(请求)。执行();
Nodejs
varaxios=需要(“axios”);
var配置={
方法:“得到”,
url:“https://support.亚博zendesk.com/api/services/zis/connections/my_integration”,
头:{
“内容类型”:“application / json”,
},
参数个数:{
“名字”:“my_oauth_connection”,
“uuid”:9 c865cd6 - 858 - e - 42 - c6 - b14d - 2 - cc43f3b4ac4”,
},
};
axios(配置)
。然后(函数(响应){
控制台。日志(JSON。stringify(响应。数据));
})
。抓(函数(错误){
控制台。日志(错误);
});
Python
进口请求
url=“https://support.亚博zendesk.com/api/services/zis/connections/my_integration?name=my_oauth_connection&uuid=9c865cd6 - 858 e - 42 - c6 - b14d - 2 - cc43f3b4ac4”
头={
“内容类型”:“application / json”,
}
响应=请求。请求(
“获得”,
url,
头=头
)
打印(响应。文本)
鲁比(人名)
需要“net/http”
uri=URI(“https://support.亚博zendesk.com/api/services/zis/connections/my_integration”)
uri。查询=URI。encode_www_form(“名称”:“my_oauth_connection”,“uuid”:“9 c865cd6 - 858 e - 42 - c6 - b14d - 2 - cc43f3b4ac4”)
请求=网::HTTP::得到。新(uri,“内容类型”:“application / json”)
响应=网::HTTP。开始uri。主机名,uri。港口,use_ssl:真正的做|http|
http。请求(请求)
结束
示例响应(年代)
200好了
//状态200 OK
{
“access_token”:“ps55XW1CbNj_hKnzwJU3yc968SL39yh3C3Okn1fpC-ThYWDqY2_M5w = = ",
“created_by”:“test_user”,
“集成”:“my_integration”,
“名称”:“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”,
“亚博zendesk_account_id”:123456
}
400错误请求
//状态400错误请求
{
“错误”:[
{
“代码”:“1301”,
“细节”:“无效的请求”,
“状态”:“400”
}
]
}
401年未经授权
//状态401未授权
{
“错误”:[
{
“代码”:“1200”,
“细节”:“未经授权的”,
“状态”:“401”
}
]
}
403年被禁止的
//状态403禁止
{
“错误”:[
{
“代码”:“1200”,
“细节”:“禁止”,
“状态”:“403”
}
]
}
422不可处理实体
//状态422不可处理的实体
{
“错误”:[
{
“代码”:“1303”,
“细节”:"无效值:集成。说明:集成不能为零”,
“状态”:“422”
}
]
}
显示OAuth连接
GET / api /服务/子/集成/{集成}/连接?名叫={名叫}
返回集成的连接列表。现在的支持仅限于命名? = true
只返回已命名的连接。
身份验证
您可以使用OAuth访问令牌。Ze亚博ndesk应用程序也可以使用管理员的浏览器会话授权到该端点的请求。看到从Zendesk应用程序发出API请求亚博。
参数
名字 | 类型 | 在 | 要求 | 描述 |
---|---|---|---|---|
命名 | 布尔 | 查询 | 真正的 | 布尔值,只返回已命名的连接 |
集成 | 字符串 | 路径 | 真正的 | 集成的名称 |
代码示例
旋度
旋度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?named=true”
方法:=“获得”
要求的事情,犯错:=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”)
。newBuilder()
。addQueryParameter(“命名”,“真正的”);
请求请求=新请求。构建器()
。url(urlBuilder。构建())
。方法(“获得”,零)
。addHeader(“内容类型”,“application / json”)
。构建();
响应响应=客户端。newCall(请求)。执行();
Nodejs
varaxios=需要(“axios”);
var配置={
方法:“得到”,
url:“https://support.亚博zendesk.com/api/services/zis/integrations/my_integration/connections”,
头:{
“内容类型”:“application / json”,
},
参数个数:{
“命名”:“真正的”,
},
};
axios(配置)
。然后(函数(响应){
控制台。日志(JSON。stringify(响应。数据));
})
。抓(函数(错误){
控制台。日志(错误);
});
Python
进口请求
url=“https://support.亚博zendesk.com/api/services/zis/integrations/my_integration/connections?named=true”
头={
“内容类型”:“application / json”,
}
响应=请求。请求(
“获得”,
url,
头=头
)
打印(响应。文本)
鲁比(人名)
需要“net/http”
uri=URI(“https://support.亚博zendesk.com/api/services/zis/integrations/my_integration/connections”)
uri。查询=URI。encode_www_form(“命名”:“真正的”)
请求=网::HTTP::得到。新(uri,“内容类型”:“application / json”)
响应=网::HTTP。开始uri。主机名,uri。港口,use_ssl:真正的做|http|
http。请求(请求)
结束
示例响应(年代)
200好了
//状态200 OK
{
“连接”:[
{
“access_token”:“ps55XW1CbNj_hKnzwJU3yc968SL39yh3C3Okn1fpC-ThYWDqY2_M5w = = ",
“created_by”:“test_user”,
“集成”:“my_integration”,
“名称”:“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”,
“亚博zendesk_account_id”:123456
}
]
}
400错误请求
//状态400错误请求
{
“错误”:[
{
“代码”:“1301”,
“细节”:“无效的请求”,
“状态”:“400”
}
]
}
401年未经授权
//状态401未授权
{
“错误”:[
{
“代码”:“1200”,
“细节”:“未经授权的”,
“状态”:“401”
}
]
}
403年被禁止的
//状态403禁止
{
“错误”:[
{
“代码”:“1200”,
“细节”:“禁止”,
“状态”:“403”
}
]
}
422不可处理实体
//状态422不可处理的实体
{
“错误”:[
{
“代码”:“1303”,
“细节”:"无效值:集成。说明:集成不能为零”,
“状态”:“422”
}
]
}
更新连接
补丁/ api /服务/子/联系/{集成}?uuid = {uuid}
更新连接详细信息。
参数
名字 | 类型 | 在 | 要求 | 描述 |
---|---|---|---|---|
uuid | 字符串 | 查询 | 真正的 | 连接的UUID |
集成 | 字符串 | 路径 | 真正的 | 集成的名称 |
例子的身体
{
“名称”:“my_oauth_connection”
}
代码示例
旋度
旋度https://{子域名}.亚博zendesk.com/api/services/zis/connections/{集成}uuid ?={uuid}\
- h"授权:Bearer {access_token}"\
- x片\
- h“application / json内容类型:\
- d”{
“名称”:“my_oauth_connection”
} '
去
进口(
“fmt”
“输入输出”
“net/http”
“弦”
)
函数主要(){
url:=“https://support.亚博zendesk.com/api/services/zis/connections/my_integration?uuid=9c865cd6 - 858 e - 42 - c6 - b14d - 2 - cc43f3b4ac4”
方法:=“补丁”
有效载荷:=字符串。NewReader(”{
“名称”:“my_oauth_connection”
} ')
要求的事情,犯错:=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/connections/my_integration”)
。newBuilder()
。addQueryParameter(“uuid”,“9 c865cd6 - 858 e - 42 - c6 - b14d - 2 - cc43f3b4ac4”);
RequestBody身体=RequestBody。创建(MediaType。解析(“application / json”),
"""
{
\“\”:my_oauth_connection \“\”
}""");
请求请求=新请求。构建器()
。url(urlBuilder。构建())
。方法(“补丁”,身体)
。addHeader(“内容类型”,“application / json”)
。构建();
响应响应=客户端。newCall(请求)。执行();
Nodejs
varaxios=需要(“axios”);
var数据=JSON。stringify({
“名称”:“my_oauth_connection”
});
var配置={
方法:“补丁”,
url:“https://support.亚博zendesk.com/api/services/zis/connections/my_integration”,
头:{
“内容类型”:“application / json”,
},
参数个数:{
“uuid”:9 c865cd6 - 858 - e - 42 - c6 - b14d - 2 - cc43f3b4ac4”,
},
数据:数据,
};
axios(配置)
。然后(函数(响应){
控制台。日志(JSON。stringify(响应。数据));
})
。抓(函数(错误){
控制台。日志(错误);
});
Python
进口请求
进口json
url=“https://support.亚博zendesk.com/api/services/zis/connections/my_integration?uuid=9c865cd6 - 858 e - 42 - c6 - b14d - 2 - cc43f3b4ac4”
有效载荷=json。加载(”““{
“名称”:“my_oauth_connection”
}”“”)
头={
“内容类型”:“application / json”,
}
响应=请求。请求(
“补丁”,
url,
头=头,
json=有效载荷
)
打印(响应。文本)
鲁比(人名)
需要“net/http”
uri=URI(“https://support.亚博zendesk.com/api/services/zis/connections/my_integration”)
uri。查询=URI。encode_www_form(“uuid”:“9 c865cd6 - 858 e - 42 - c6 - b14d - 2 - cc43f3b4ac4”)
请求=网::HTTP::补丁。新(uri,“内容类型”:“application / json”)
请求。身体=%问({
“名称”:“my_oauth_connection”
})
响应=网::HTTP。开始uri。主机名,uri。港口,use_ssl:真正的做|http|
http。请求(请求)
结束
示例响应(年代)
204无内容
//状态204无内容
零
401年未经授权
//状态401未授权
{
“错误”:[
{
“代码”:“1200”,
“细节”:“未经授权的”,
“状态”:“401”
}
]
}
403年被禁止的
//状态403禁止
{
“错误”:[
{
“代码”:“1200”,
“细节”:“禁止”,
“状态”:“403”
}
]
}
404未找到
//状态404未找到
{
“错误”:[
{
“代码”:“1302”,
“细节”:“没有找到”,
“状态”:“404”
}
]
}
422不可处理实体
//状态422不可处理的实体
{
“错误”:[
{
“代码”:“1303”,
“细节”:"无效值:集成。说明:集成不能为零”,
“状态”:“422”
}
]
}
请求太多
//状态429请求过多
{
“错误”:[
{
“代码”:“1300”,
“细节”:“请求太多了”,
“状态”:“429”
}
]
}
删除连接
删除/ api /服务/子/联系/{集成}
删除存储在ZIS连接服务中的授权令牌。
参数
名字 | 类型 | 在 | 要求 | 描述 |
---|---|---|---|---|
名字 | 字符串 | 查询 | 假 | 连接名称。指定“uuid”或“name” |
uuid | 字符串 | 查询 | 假 | 连接的UUID。指定“uuid”或“name” |
集成 | 字符串 | 路径 | 真正的 | 集成的名称 |
代码示例
旋度
旋度https://{子域名}.亚博zendesk.com/api/services/zis/connections/{集成}uuid ?={uuid}\
- h"授权:Bearer {access_token}"\
- x删除
旋度
旋度旋度https://{子域名}.亚博zendesk.com/api/services/zis/connections/{集成}名字吗?={名字}\
- h"授权:Bearer {access_token}"\
- x删除
去
进口(
“fmt”
“输入输出”
“net/http”
)
函数主要(){
url:=“https://support.亚博zendesk.com/api/services/zis/connections/my_integration?name=my_oauth_connection&uuid=9c865cd6 - 858 e - 42 - c6 - b14d - 2 - cc43f3b4ac4”
方法:=“删除”
要求的事情,犯错:=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/connections/my_integration”)
。newBuilder()
。addQueryParameter(“名称”,“my_oauth_connection”)
。addQueryParameter(“uuid”,“9 c865cd6 - 858 e - 42 - c6 - b14d - 2 - cc43f3b4ac4”);
请求请求=新请求。构建器()
。url(urlBuilder。构建())
。方法(“删除”,零)
。addHeader(“内容类型”,“application / json”)
。构建();
响应响应=客户端。newCall(请求)。执行();
Nodejs
varaxios=需要(“axios”);
var配置={
方法:“删除”,
url:“https://support.亚博zendesk.com/api/services/zis/connections/my_integration”,
头:{
“内容类型”:“application / json”,
},
参数个数:{
“名字”:“my_oauth_connection”,
“uuid”:9 c865cd6 - 858 - e - 42 - c6 - b14d - 2 - cc43f3b4ac4”,
},
};
axios(配置)
。然后(函数(响应){
控制台。日志(JSON。stringify(响应。数据));
})
。抓(函数(错误){
控制台。日志(错误);
});
Python
进口请求
url=“https://support.亚博zendesk.com/api/services/zis/connections/my_integration?name=my_oauth_connection&uuid=9c865cd6 - 858 e - 42 - c6 - b14d - 2 - cc43f3b4ac4”
头={
“内容类型”:“application / json”,
}
响应=请求。请求(
“删除”,
url,
头=头
)
打印(响应。文本)
鲁比(人名)
需要“net/http”
uri=URI(“https://support.亚博zendesk.com/api/services/zis/connections/my_integration”)
uri。查询=URI。encode_www_form(“名称”:“my_oauth_connection”,“uuid”:“9 c865cd6 - 858 e - 42 - c6 - b14d - 2 - cc43f3b4ac4”)
请求=网::HTTP::删除。新(uri,“内容类型”:“application / json”)
响应=网::HTTP。开始uri。主机名,uri。港口,use_ssl:真正的做|http|
http。请求(请求)
结束
示例响应(年代)
204无内容
//状态204无内容
零
401年未经授权
//状态401未授权
{
“错误”:[
{
“代码”:“1200”,
“细节”:“未经授权的”,
“状态”:“401”
}
]
}
403年被禁止的
//状态403禁止
{
“错误”:[
{
“代码”:“1200”,
“细节”:“禁止”,
“状态”:“403”
}
]
}
404未找到
//状态404未找到
{
“错误”:[
{
“代码”:“1302”,
“细节”:“没有找到”,
“状态”:“404”
}
]
}