Channel Management/Authorization
Start Platform Authorization
Interface description: Generate a platform authorization QR code, session ID, and expiration time.
After a successful response, read the authorization session ID from data.sessionId and pass it with the same platform to Get Authorization Status to poll the authorization. Supported values for platform are douyin, xhs, wxSph, KWAI, wxGzh, and bilibili. Check capabilities.auth.supported in the Platform List response to confirm availability.
GET
/
api
/
v2
/
channels
/
accounts
/
auth
/
{platform}
Start Platform Authorization
curl --request GET \
--url https://aitoearn.cn/api/v2/channels/accounts/auth/{platform} \
--header 'X-Api-Key: <api-key>'import requests
url = "https://aitoearn.cn/api/v2/channels/accounts/auth/{platform}"
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}', 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}"
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": {
"url": "string",
"sessionId": "string",
"expiresAt": "string",
"authInstructions": {
"en-US": "string",
"zh-CN": "string"
}
},
"requestId": "string"
}Authorizations
Need to get API Key from AiToEarn. Click to go to "API Key Obtaining Tutorial".
Path Parameters
Query Parameters
Response
200 - application/json
The request has been processed by the service. Business success is determined by whether the response body has code === 0.
⌘I
Start Platform Authorization
curl --request GET \
--url https://aitoearn.cn/api/v2/channels/accounts/auth/{platform} \
--header 'X-Api-Key: <api-key>'import requests
url = "https://aitoearn.cn/api/v2/channels/accounts/auth/{platform}"
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}', 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}"
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": {
"url": "string",
"sessionId": "string",
"expiresAt": "string",
"authInstructions": {
"en-US": "string",
"zh-CN": "string"
}
},
"requestId": "string"
}
