基本认证连接
存储和管理集成的基本身份验证凭据。看到理解连接。
JSON格式
基本身份验证连接表示为具有以下属性的JSON对象:
名字 | 类型 | 只读 | 强制性的 | 描述 |
---|---|---|---|---|
allowed_domain | 字符串 | 假 | 真正的 | 可以使用连接的主机名。看到允许域 |
created_at | 字符串 | 真正的 | 假 | 创建连接时 |
名字 | 字符串 | 假 | 真正的 | 用于唯一标识连接的名称。看到连接名称 |
密码 | 字符串 | 假 | 真正的 | 基本身份验证凭证的密码。出于安全考虑,该值在响应中被编校 |
updated_at | 字符串 | 真正的 | 假 | 上次更新连接的时间 |
用户名 | 字符串 | 假 | 真正的 | 基本身份验证凭据的用户名 |
创建基本认证连接
POST / api /服务/子/集成/{集成}/ / basic_auth连接
为集成创建基本身份验证连接。
身份验证
您可以使用OAuth访问令牌。Ze亚博ndesk应用程序也可以使用管理员的浏览器会话授权到该端点的请求。看到从Zendesk应用程序发出API请求亚博。
参数
名字 | 类型 | 在 | 要求 | 描述 |
---|---|---|---|---|
集成 | 字符串 | 路径 | 真正的 | 集成的名称 |
例子的身体
{
“allowed_domain”:“api.example.com”,
“名称”:“my_basic_auth_connection”,
“密码”:“MY_PASSWORD”,
“用户名”:”(电子邮件保护)”
}
代码示例
旋度
旋度https://{子域名}.亚博zendesk.com/api/services/zis/integrations/{集成}/ /连接basic_auth\
- h"授权:Bearer {access_token}"\
- x的帖子\
- h“application / json内容类型:\
- d”{
“名称”:“my_basic_auth_connection”,
“用户名”:“(电子邮件保护)",
“密码”:“MY_PASSWORD”,
“allowed_domain”:“api.example.com”
} '
去
进口(
“fmt”
“输入输出”
“net/http”
“弦”
)
函数主要(){
url:=“https://support.亚博zendesk.com/api/services/zis/integrations/my_integration/connections/basic_auth”
方法:=“职位”
有效载荷:=字符串。NewReader(”{
“allowed_domain”:“api.example.com”,
“名称”:“my_basic_auth_connection”,
“密码”:“MY_PASSWORD”,
“用户名”:“(电子邮件保护)”
} ')
要求的事情,犯错:=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/basic_auth”)
。newBuilder();
RequestBody身体=RequestBody。创建(MediaType。解析(“application / json”),
""”
{
allowed_domain \“\”:\“api。例子。com \”,
\“\”:my_basic_auth_connection \“\”,
\ \“密码”:\”MY_PASSWORD\”,
\ "用户名\”:\ "约翰。(电子邮件保护)。com \”
}""”);
请求请求=新请求。构建器()
。url(urlBuilder。构建())
。方法(“职位”,身体)
。addHeader(“内容类型”,“application / json”)
。构建();
响应响应=客户端。newCall(请求)。执行();
Nodejs
varaxios=需要(“axios”);
var数据=JSON。stringify({
“allowed_domain”:“api.example.com”,
“名称”:“my_basic_auth_connection”,
“密码”:“MY_PASSWORD”,
“用户名”:”(电子邮件保护)”
});
var配置={
方法:“职位”,
url:“https://support.亚博zendesk.com/api/services/zis/integrations/my_integration/connections/basic_auth”,
头:{
“内容类型”:“application / json”,
},
数据:数据,
};
axios(配置)
。然后(函数(响应){
控制台。日志(JSON。stringify(响应。数据));
})
。抓(函数(错误){
控制台。日志(错误);
});
Python
进口请求
进口json
url=“https://support.亚博zendesk.com/api/services/zis/integrations/my_integration/connections/basic_auth”
有效载荷=json。加载(”““{
“allowed_domain”:“api.example.com”,
“名称”:“my_basic_auth_connection”,
“密码”:“MY_PASSWORD”,
“用户名”:“(电子邮件保护)”
}”“”)
头={
“内容类型”:“application / json”,
}
响应=请求。请求(
“职位”,
url,
头=头,
json=有效载荷
)
打印(响应。文本)
鲁比(人名)
需要“net/http”
uri=URI(“https://support.亚博zendesk.com/api/services/zis/integrations/my_integration/connections/basic_auth”)
请求=网::HTTP::帖子。新(uri,“内容类型”:“application / json”)
请求。身体=%问({
“allowed_domain”:“api.example.com”,
“名称”:“my_basic_auth_connection”,
“密码”:“MY_PASSWORD”,
“用户名”:”(电子邮件保护)”
})
响应=网::HTTP。开始uri。主机名,uri。港口,use_ssl:真正的做|http|
http。请求(请求)
结束
示例响应(年代)
201年创建
//状态201创建
{
“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”,
“用户名”:”(电子邮件保护)”
}
}
400错误请求
//状态400错误请求
{
“错误”:(
{
“代码”:“InvalidIntegration”,
“标题”:"指定的集成无效"
}
]
}
401年未经授权
//状态401未授权
{
“错误”:(
{
“代码”:“InvalidCredentials”,
“标题”:"令牌长度无效"
}
]
}
403年被禁止的
//状态403禁止
{
“错误”:(
{
“代码”:“禁止”,
“标题”:"无法访问此资源。缺少作用域写入"
}
]
}
409年冲突
//状态409冲突
{
“错误”:(
{
“代码”:“冲突”,
“标题”:“资源冲突”
}
]
}
请求太多
//状态429请求过多
{
“错误”:(
{
“代码”:“TooManyRequests”,
“标题”:“请求太多了”
}
]
}
显示基本认证连接
GET / api /服务/子/集成/{集成}/联系/ basic_auth /{名称}
返回基本身份验证连接的详细信息。
身份验证
您可以使用OAuth访问令牌。Ze亚博ndesk应用程序也可以使用管理员的浏览器会话授权到该端点的请求。看到从Zendesk应用程序发出API请求亚博。
参数
名字 | 类型 | 在 | 要求 | 描述 |
---|---|---|---|---|
集成 | 字符串 | 路径 | 真正的 | 集成的名称 |
名字 | 字符串 | 路径 | 真正的 | 基本认证连接的名称 |
代码示例
旋度
旋度https://{子域名}.亚博zendesk.com/api/services/zis/integrations/{集成}/ / basic_auth /连接{名字}\
- h"授权:Bearer {access_token}"
去
进口(
“fmt”
“输入输出”
“net/http”
)
函数主要(){
url:=“https://support.亚博zendesk.com/api/services/zis/integrations/my_integration/connections/basic_auth/my_basic_auth_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/integrations/my_integration/connections/basic_auth/my_basic_auth_connection”)
。newBuilder();
请求请求=新请求。构建器()
。url(urlBuilder。构建())
。方法(“获得”,零)
。addHeader(“内容类型”,“application / json”)
。构建();
响应响应=客户端。newCall(请求)。执行();
Nodejs
varaxios=需要(“axios”);
var配置={
方法:“得到”,
url:“https://support.亚博zendesk.com/api/services/zis/integrations/my_integration/connections/basic_auth/my_basic_auth_connection”,
头:{
“内容类型”:“application / json”,
},
};
axios(配置)
。然后(函数(响应){
控制台。日志(JSON。stringify(响应。数据));
})
。抓(函数(错误){
控制台。日志(错误);
});
Python
进口请求
url=“https://support.亚博zendesk.com/api/services/zis/integrations/my_integration/connections/basic_auth/my_basic_auth_connection”
头={
“内容类型”:“application / json”,
}
响应=请求。请求(
“获得”,
url,
头=头
)
打印(响应。文本)
鲁比(人名)
需要“net/http”
uri=URI(“https://support.亚博zendesk.com/api/services/zis/integrations/my_integration/connections/basic_auth/my_basic_auth_connection”)
请求=网::HTTP::得到。新(uri,“内容类型”:“application / json”)
响应=网::HTTP。开始uri。主机名,uri。港口,use_ssl:真正的做|http|
http。请求(请求)
结束
示例响应(年代)
200好了
//状态200 OK
{
“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”,
“用户名”:”(电子邮件保护)”
}
}
401年未经授权
//状态401未授权
{
“错误”:(
{
“代码”:“InvalidCredentials”,
“标题”:"令牌长度无效"
}
]
}
403年被禁止的
//状态403禁止
{
“错误”:(
{
“代码”:“禁止”,
“标题”:"无法访问此资源。缺少作用域写入"
}
]
}
404未找到
//状态404未找到
{
“错误”:(
{
“代码”:“NotFound”,
“标题”:“连接不存在”
}
]
}
请求太多
//状态429请求过多
{
“错误”:(
{
“代码”:“TooManyRequests”,
“标题”:“请求太多了”
}
]
}
更新基本认证连接
补丁/ api /服务/子/集成/{集成}/联系/ basic_auth /{名称}
更新基本身份验证连接的详细信息
身份验证
您可以使用OAuth访问令牌。Ze亚博ndesk应用程序也可以使用管理员的浏览器会话授权到该端点的请求。看到从Zendesk应用程序发出API请求亚博。
参数
名字 | 类型 | 在 | 要求 | 描述 |
---|---|---|---|---|
集成 | 字符串 | 路径 | 真正的 | 集成的名称 |
名字 | 字符串 | 路径 | 真正的 | 基本认证连接的名称 |
例子的身体
{
“密码”:“MY_PASSWORD”,
“用户名”:”(电子邮件保护)”
}
代码示例
旋度
旋度https://{子域名}.亚博zendesk.com/api/services/zis/integrations/{集成}/ / basic_auth /连接{名字}\
- h"授权:Bearer {access_token}"\
- x片\
- h“application / json内容类型:\
- d”{
“用户名”:“(电子邮件保护)",
“密码”:“MY_PASSWORD”
} '
去
进口(
“fmt”
“输入输出”
“net/http”
“弦”
)
函数主要(){
url:=“https://support.亚博zendesk.com/api/services/zis/integrations/my_integration/connections/basic_auth/my_basic_auth_connection”
方法:=“补丁”
有效载荷:=字符串。NewReader(”{
“密码”:“MY_PASSWORD”,
“用户名”:“(电子邮件保护)”
} ')
要求的事情,犯错:=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/basic_auth/my_basic_auth_connection”)
。newBuilder();
RequestBody身体=RequestBody。创建(MediaType。解析(“application / json”),
""”
{
\ \“密码”:\”MY_PASSWORD\”,
\ "用户名\”:\ "约翰。(电子邮件保护)。com \”
}""”);
请求请求=新请求。构建器()
。url(urlBuilder。构建())
。方法(“补丁”,身体)
。addHeader(“内容类型”,“application / json”)
。构建();
响应响应=客户端。newCall(请求)。执行();
Nodejs
varaxios=需要(“axios”);
var数据=JSON。stringify({
“密码”:“MY_PASSWORD”,
“用户名”:”(电子邮件保护)”
});
var配置={
方法:“补丁”,
url:“https://support.亚博zendesk.com/api/services/zis/integrations/my_integration/connections/basic_auth/my_basic_auth_connection”,
头:{
“内容类型”:“application / json”,
},
数据:数据,
};
axios(配置)
。然后(函数(响应){
控制台。日志(JSON。stringify(响应。数据));
})
。抓(函数(错误){
控制台。日志(错误);
});
Python
进口请求
进口json
url=“https://support.亚博zendesk.com/api/services/zis/integrations/my_integration/connections/basic_auth/my_basic_auth_connection”
有效载荷=json。加载(”““{
“密码”:“MY_PASSWORD”,
“用户名”:“(电子邮件保护)”
}”“”)
头={
“内容类型”:“application / json”,
}
响应=请求。请求(
“补丁”,
url,
头=头,
json=有效载荷
)
打印(响应。文本)
鲁比(人名)
需要“net/http”
uri=URI(“https://support.亚博zendesk.com/api/services/zis/integrations/my_integration/connections/basic_auth/my_basic_auth_connection”)
请求=网::HTTP::补丁。新(uri,“内容类型”:“application / json”)
请求。身体=%问({
“密码”:“MY_PASSWORD”,
“用户名”:”(电子邮件保护)”
})
响应=网::HTTP。开始uri。主机名,uri。港口,use_ssl:真正的做|http|
http。请求(请求)
结束
示例响应(年代)
204无内容
//状态204无内容
零
400错误请求
//状态400错误请求
{
“错误”:(
{
“代码”:“InvalidIntegration”,
“标题”:"指定的集成无效"
}
]
}
401年未经授权
//状态401未授权
{
“错误”:(
{
“代码”:“InvalidCredentials”,
“标题”:"令牌长度无效"
}
]
}
403年被禁止的
//状态403禁止
{
“错误”:(
{
“代码”:“禁止”,
“标题”:"无法访问此资源。缺少作用域写入"
}
]
}
404未找到
//状态404未找到
{
“错误”:(
{
“代码”:“NotFound”,
“标题”:“连接不存在”
}
]
}
请求太多
//状态429请求过多
{
“错误”:(
{
“代码”:“TooManyRequests”,
“标题”:“请求太多了”
}
]
}
删除基本认证连接
删除/ api /服务/子/集成/{集成}/联系/ basic_auth /{名称}
删除基本身份验证连接。
身份验证
您可以使用OAuth访问令牌。Ze亚博ndesk应用程序也可以使用管理员的浏览器会话授权到该端点的请求。看到从Zendesk应用程序发出API请求亚博。
参数
名字 | 类型 | 在 | 要求 | 描述 |
---|---|---|---|---|
集成 | 字符串 | 路径 | 真正的 | 集成的名称 |
名字 | 字符串 | 路径 | 真正的 | 基本认证连接的名称 |
代码示例
旋度
旋度https://{子域名}.亚博zendesk.com/api/services/zis/integrations/{集成}/ / basic_auth /连接{名字}\
- h"授权:Bearer {access_token}"\
- x删除
去
进口(
“fmt”
“输入输出”
“net/http”
)
函数主要(){
url:=“https://support.亚博zendesk.com/api/services/zis/integrations/my_integration/connections/basic_auth/my_basic_auth_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/integrations/my_integration/connections/basic_auth/my_basic_auth_connection”)
。newBuilder();
请求请求=新请求。构建器()
。url(urlBuilder。构建())
。方法(“删除”,零)
。addHeader(“内容类型”,“application / json”)
。构建();
响应响应=客户端。newCall(请求)。执行();
Nodejs
varaxios=需要(“axios”);
var配置={
方法:“删除”,
url:“https://support.亚博zendesk.com/api/services/zis/integrations/my_integration/connections/basic_auth/my_basic_auth_connection”,
头:{
“内容类型”:“application / json”,
},
};
axios(配置)
。然后(函数(响应){
控制台。日志(JSON。stringify(响应。数据));
})
。抓(函数(错误){
控制台。日志(错误);
});
Python
进口请求
url=“https://support.亚博zendesk.com/api/services/zis/integrations/my_integration/connections/basic_auth/my_basic_auth_connection”
头={
“内容类型”:“application / json”,
}
响应=请求。请求(
“删除”,
url,
头=头
)
打印(响应。文本)
鲁比(人名)
需要“net/http”
uri=URI(“https://support.亚博zendesk.com/api/services/zis/integrations/my_integration/connections/basic_auth/my_basic_auth_connection”)
请求=网::HTTP::删除。新(uri,“内容类型”:“application / json”)
响应=网::HTTP。开始uri。主机名,uri。港口,use_ssl:真正的做|http|
http。请求(请求)
结束
示例响应(年代)
204无内容
//状态204无内容
零
401年未经授权
//状态401未授权
{
“错误”:(
{
“代码”:“InvalidCredentials”,
“标题”:"令牌长度无效"
}
]
}
403年被禁止的
//状态403禁止
{
“错误”:(
{
“代码”:“禁止”,
“标题”:"无法访问此资源。缺少作用域写入"
}
]
}
404未找到
//状态404未找到
{
“错误”:(
{
“代码”:“NotFound”,
“标题”:“连接不存在”
}
]
}
请求太多
//状态429请求过多
{
“错误”:(
{
“代码”:“TooManyRequests”,
“标题”:“请求太多了”
}
]
}