渠道管理/账号
创建发布选项值
接口说明:为某个已授权渠道账号创建平台发布时需要的额外参数值,创建成功后返回可直接用于发布任务的选项 item。
本接口不是所有平台和字段都支持。调用前必须先调用「平台发布选项」接口(GET /api/v2/channels/platforms/{platform}/publish-options),只有返回项明确包含 createSchema 的字段才可以调用本接口;将该返回项的 field 放到路径参数,并严格按照 createSchema 组织 JSON 请求体。若返回项没有 createSchema,请改用「发布选项可选值」接口查询并选择已有值。
例如,当前 Bilibili 返回的 tid 仅支持查询分区,不支持通过本接口创建;使用 Bilibili 的 tid 调用会返回 15080(平台不支持该操作)。
POST
/
api
/
v2
/
channels
/
accounts
/
{accountId}
/
publish-options
/
{field}
/
values
创建发布选项值
curl --request POST \
--url https://aitoearn.cn/api/v2/channels/accounts/{accountId}/publish-options/{field}/values \
--header 'X-Api-Key: <api-key>'import requests
url = "https://aitoearn.cn/api/v2/channels/accounts/{accountId}/publish-options/{field}/values"
headers = {"X-Api-Key": "<api-key>"}
response = requests.post(url, headers=headers)
print(response.text)const options = {method: 'POST', headers: {'X-Api-Key': '<api-key>'}};
fetch('https://aitoearn.cn/api/v2/channels/accounts/{accountId}/publish-options/{field}/values', 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/{accountId}/publish-options/{field}/values"
req, _ := http.NewRequest("POST", 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": {
"field": "string",
"valueType": "list",
"item": {}
}
}授权
需要从 AiToEarn 获取 API Key。点击前往「API Key 获取教程」。
路径参数
渠道账号 ID。必须是当前用户已授权的账号,且账号所属平台应与「平台发布选项」接口中查询的平台一致。
最后修改于 2026年9月29日
⌘I
创建发布选项值
curl --request POST \
--url https://aitoearn.cn/api/v2/channels/accounts/{accountId}/publish-options/{field}/values \
--header 'X-Api-Key: <api-key>'import requests
url = "https://aitoearn.cn/api/v2/channels/accounts/{accountId}/publish-options/{field}/values"
headers = {"X-Api-Key": "<api-key>"}
response = requests.post(url, headers=headers)
print(response.text)const options = {method: 'POST', headers: {'X-Api-Key': '<api-key>'}};
fetch('https://aitoearn.cn/api/v2/channels/accounts/{accountId}/publish-options/{field}/values', 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/{accountId}/publish-options/{field}/values"
req, _ := http.NewRequest("POST", 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": {
"field": "string",
"valueType": "list",
"item": {}
}
}
