创建认证
使用用户提供的凭据为特定应用创建一个新的认证。
请参阅添加认证指南,以了解认证的工作原理。
要为选定的应用创建一个新的认证,请向/authentications
端点发送一个 POST
请求。这允许您的用户安全地将他们的账户连接到选定的第三方应用。
// POST /authentications
{
"data": {
"title": "My new auth",
"app": "8cdbc496-c95c-4f19-b3a3-fee03ed5f924",
"authentication_fields": {
"secret": "example_E4CrHVvRuxTXrPFLyyZFeRJwJcx2ELQZ"
}
}
}
成功响应将返回新创建的认证对象:
{
"links": {
"next": null,
"prev": null
},
"meta": {
"count": 1,
"limit": 1,
"offset": 0
},
"data": [
{
"type": "authentication",
"id": "example_DOb4nWkz",
"app": "8cdbc496-c95c-4f19-b3a3-fee03ed5f924",
"is_expired": false,
"title": "My new auth"
}
]
}
此端点需要 authentication:write
OAuth 范围。认证与当前用户相关联,并且必须由他们发起。
如果您不确定在创建认证时使用哪个应用 ID,请先从/apps
端点获取它。
此 API 受速率限制。