渠道管理/授权
获取授权状态
接口说明:轮询平台授权 Session 状态
GET
/
api
/
v2
/
channels
/
accounts
/
auth
/
{platform}
/
status
/
{sessionId}
获取授权状态
curl --request GET \
--url https://aitoearn.cn/api/v2/channels/accounts/auth/{platform}/status/{sessionId} \
--header 'X-Api-Key: <api-key>'import requests
url = "https://aitoearn.cn/api/v2/channels/accounts/auth/{platform}/status/{sessionId}"
headers = {"X-Api-Key": "<api-key>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {'X-Api-Key': '<api-key>'}};
fetch('https://aitoearn.cn/api/v2/channels/accounts/auth/{platform}/status/{sessionId}', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://aitoearn.cn/api/v2/channels/accounts/auth/{platform}/status/{sessionId}"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("X-Api-Key", "<api-key>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}{
"code": 0,
"message": "请求成功",
"data": {
"sessionId": "string",
"status": "pending",
"requiresSelection": true,
"errorCode": 1,
"expiresAt": "2026-07-02T12:00:00.000Z",
"accountId": "string",
"accountIds": [
"string"
],
"accounts": [
{
"accountId": "string",
"platform": "douyin",
"platformUid": "string",
"displayName": "string",
"account": "string",
"avatarUrl": "string"
}
],
"selectableAccounts": [
{
"platform": "douyin",
"platformUid": "string",
"displayName": "string",
"account": "string",
"avatarUrl": "string",
"parentPlatformUid": "string"
}
]
}
}授权
需要从 AiToEarn 获取 API Key。点击前往「API Key 获取教程」。
响应
200 - application/json
请求已被服务处理。业务是否成功以响应体 code === 0 为准。
业务状态码。0 表示成功,非 0 表示业务错误。
响应消息。
Hide child attributes
Hide child attributes
授权 Session ID
授权 Session 状态
可用选项:
pending, completed, failed 是否需要选择二级账号
授权失败错误码
授权 Session 过期时间
首个本地账号 ID
本地账号 ID 列表
已连接账号列表
Hide child attributes
Hide child attributes
本地账号 ID
平台类型
可用选项:
douyin, xhs, wxSph, KWAI, youtube, wxGzh, bilibili, twitter, tiktok, facebook, instagram, threads, pinterest, linkedin, google_business 平台账号 UID
平台账号展示名
平台账号补充唯一标识
平台账号头像 URL
可选择的平台账号列表
Hide child attributes
Hide child attributes
平台类型
可用选项:
douyin, xhs, wxSph, KWAI, youtube, wxGzh, bilibili, twitter, tiktok, facebook, instagram, threads, pinterest, linkedin, google_business 平台账号 UID
平台账号展示名
平台账号补充唯一标识
平台账号头像 URL
父级平台账号 UID
请求 ID。
错误响应时间戳,Unix 毫秒。
⌘I
获取授权状态
curl --request GET \
--url https://aitoearn.cn/api/v2/channels/accounts/auth/{platform}/status/{sessionId} \
--header 'X-Api-Key: <api-key>'import requests
url = "https://aitoearn.cn/api/v2/channels/accounts/auth/{platform}/status/{sessionId}"
headers = {"X-Api-Key": "<api-key>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {'X-Api-Key': '<api-key>'}};
fetch('https://aitoearn.cn/api/v2/channels/accounts/auth/{platform}/status/{sessionId}', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://aitoearn.cn/api/v2/channels/accounts/auth/{platform}/status/{sessionId}"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("X-Api-Key", "<api-key>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}{
"code": 0,
"message": "请求成功",
"data": {
"sessionId": "string",
"status": "pending",
"requiresSelection": true,
"errorCode": 1,
"expiresAt": "2026-07-02T12:00:00.000Z",
"accountId": "string",
"accountIds": [
"string"
],
"accounts": [
{
"accountId": "string",
"platform": "douyin",
"platformUid": "string",
"displayName": "string",
"account": "string",
"avatarUrl": "string"
}
],
"selectableAccounts": [
{
"platform": "douyin",
"platformUid": "string",
"displayName": "string",
"account": "string",
"avatarUrl": "string",
"parentPlatformUid": "string"
}
]
}
}
