Get Authorization Status
Interface description: Poll the platform authorization session status. sessionId must come from data.sessionId in the successful response of Start Platform Authorization; do not generate it yourself or reuse it across authorization sessions.
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": "Request succeeded",
"data": {
"sessionId": "string",
"status": "string",
"requiresSelection": "boolean",
"expiresAt": "string"
},
"requestId": "string"
}Authorizations
Need to get API Key from AiToEarn. Click to go to "API Key Obtaining Tutorial".
Path Parameters
Authorization platform. It must match the platform used to start authorization. Supported values: douyin, xhs, wxSph, KWAI, wxGzh, and bilibili.
douyin, xhs, wxSph, KWAI, wxGzh, bilibili "douyin"
The data.sessionId from the successful Start Platform Authorization response.
"session-id-from-auth-start"
Response
The request has been processed by the service. Business success is determined by whether the response body has code === 0.
Business status code. 0 means success; non-zero means a business error.
Response message.
Request ID.
Error response timestamp in Unix milliseconds.
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": "Request succeeded",
"data": {
"sessionId": "string",
"status": "string",
"requiresSelection": "boolean",
"expiresAt": "string"
},
"requestId": "string"
}
