创建发布流程
接口说明:创建多平台发布 Flow,一次请求可生成多个单平台任务。
调用本接口前,请先确保你已经了解完整发布流程,点击了解完整发布流程。请求体中的 items[n].accountId 必须来自账号列表接口;content.media[n].url 必须是可公网访问的真实媒体 URL,不能直接复制示例中的占位值。推荐先按资源上传教程完成“生成上传签名 → 直传文件 → 确认资源上传”,再填写确认接口返回的 data.url;也可使用其他可被服务端直接访问和解析的真实媒体 URL。链接不可访问或无法解析时会返回 15051(media_unreachable)。publishAt 必须填写未来的 ISO 8601 时间。调用成功后,data.flowId 可用于查询流程详情,data.tasks[n].id 可用于立即发布、重试、取消或修改发布时间。该接口会创建真实发布任务,请确认参数无误后再发送。
额度说明:所有平台合计共享每月 1,000 次免费发布接口调用额度,额度按月刷新。可在国内站 API Key 页面或国际站 API Key 页面查看当前用量和剩余额度。X/Twitter(推特)发布除占用上述额度外,还会产生由 X/Twitter 官方收取的额外费用,详情请查看定价页「社交平台」。超出免费额度后,后续将支持超额 API 请求,按 1.5 积分/次扣费。
curl --request POST \
--url https://aitoearn.cn/api/v2/channels/publish/flows \
--header 'Content-Type: application/json' \
--header 'X-Api-Key: <api-key>' \
--data '
{
"content": {
"title": "publish-demo-video",
"body": "Publish a video using the AiToEarn API.",
"media": [
{
"url": "https://assets.aitoearn.cn/6a3b48b5ec793a848a671de1/ai/video/doubao-seedance-2-0-260128/202607/I-lRTCBUkjE43NRd77eWC.mp4"
}
],
"cover": {
"url": "https://assets.aitoearn.cn/6a3b48b5ec793a848a671de1/ai/images/gpt-image-2/202607/GlhuS1TEyXtDAyumLezfo.png"
}
},
"publishAt": "2030-01-01T00:00:00.000Z",
"items": [
{
"platform": "douyin",
"accountId": "account-id-from-accounts-list"
}
]
}
'import requests
url = "https://aitoearn.cn/api/v2/channels/publish/flows"
payload = {
"content": {
"title": "publish-demo-video",
"body": "Publish a video using the AiToEarn API.",
"media": [{ "url": "https://assets.aitoearn.cn/6a3b48b5ec793a848a671de1/ai/video/doubao-seedance-2-0-260128/202607/I-lRTCBUkjE43NRd77eWC.mp4" }],
"cover": { "url": "https://assets.aitoearn.cn/6a3b48b5ec793a848a671de1/ai/images/gpt-image-2/202607/GlhuS1TEyXtDAyumLezfo.png" }
},
"publishAt": "2030-01-01T00:00:00.000Z",
"items": [
{
"platform": "douyin",
"accountId": "account-id-from-accounts-list"
}
]
}
headers = {
"X-Api-Key": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'X-Api-Key': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
content: {
title: 'publish-demo-video',
body: JSON.stringify('Publish a video using the AiToEarn API.'),
media: [
{
url: 'https://assets.aitoearn.cn/6a3b48b5ec793a848a671de1/ai/video/doubao-seedance-2-0-260128/202607/I-lRTCBUkjE43NRd77eWC.mp4'
}
],
cover: {
url: 'https://assets.aitoearn.cn/6a3b48b5ec793a848a671de1/ai/images/gpt-image-2/202607/GlhuS1TEyXtDAyumLezfo.png'
}
},
publishAt: '2030-01-01T00:00:00.000Z',
items: [{platform: 'douyin', accountId: 'account-id-from-accounts-list'}]
})
};
fetch('https://aitoearn.cn/api/v2/channels/publish/flows', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://aitoearn.cn/api/v2/channels/publish/flows"
payload := strings.NewReader("{\n \"content\": {\n \"title\": \"publish-demo-video\",\n \"body\": \"Publish a video using the AiToEarn API.\",\n \"media\": [\n {\n \"url\": \"https://assets.aitoearn.cn/6a3b48b5ec793a848a671de1/ai/video/doubao-seedance-2-0-260128/202607/I-lRTCBUkjE43NRd77eWC.mp4\"\n }\n ],\n \"cover\": {\n \"url\": \"https://assets.aitoearn.cn/6a3b48b5ec793a848a671de1/ai/images/gpt-image-2/202607/GlhuS1TEyXtDAyumLezfo.png\"\n }\n },\n \"publishAt\": \"2030-01-01T00:00:00.000Z\",\n \"items\": [\n {\n \"platform\": \"douyin\",\n \"accountId\": \"account-id-from-accounts-list\"\n }\n ]\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("X-Api-Key", "<api-key>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}{
"code": 0,
"message": "请求成功",
"data": {
"flowId": "string",
"tasks": [
{
"id": "string",
"accountId": "string",
"platform": "string",
"status": "number",
"publishTime": "string",
"platformWorkId": "string",
"workLink": "string",
"linkStatus": "string",
"linkError": "string",
"linkMeta": "object",
"errorMsg": "string"
}
]
},
"requestId": "string"
}授权
需要从 AiToEarn 获取 API Key。点击前往「API Key 获取教程」。
请求体
跨平台共享内容
Hide child attributes
Hide child attributes
标题
正文
目标发布时间
平台发布项
1- Option 1
- Option 2
- Option 3
- Option 4
- Option 5
- Option 6
- Option 7
- Option 8
- Option 9
- Option 10
- Option 11
- Option 12
- Option 13
- Option 14
Hide child attributes
Hide child attributes
平台
bilibili 哔哩哔哩发布选项
- Option 1
- Option 2
Hide child attributes
Hide child attributes
分区 ID
0 < x <= 9007199254740991是否允许转载 0-允许,1-不允许
0, 1 话题 ID
0 < x <= 9007199254740991投稿活动 ID
0 < x <= 90071992547409911-原创,2-转载
1 转载来源
账号 ID
平台覆盖内容
Hide child attributes
Hide child attributes
标题覆盖
正文覆盖
主体媒体列表覆盖
Hide child attributes
Hide child attributes
封面覆盖,传 null 表示清空封面
Hide child attributes
Hide child attributes
外部流水 ID
响应
请求已被服务处理。业务是否成功以响应体 code === 0 为准。
业务状态码。0 表示成功,非 0 表示业务错误。
响应消息。
Hide child attributes
Hide child attributes
Hide child attributes
Hide child attributes
请求 ID。
错误响应时间戳,Unix 毫秒。
curl --request POST \
--url https://aitoearn.cn/api/v2/channels/publish/flows \
--header 'Content-Type: application/json' \
--header 'X-Api-Key: <api-key>' \
--data '
{
"content": {
"title": "publish-demo-video",
"body": "Publish a video using the AiToEarn API.",
"media": [
{
"url": "https://assets.aitoearn.cn/6a3b48b5ec793a848a671de1/ai/video/doubao-seedance-2-0-260128/202607/I-lRTCBUkjE43NRd77eWC.mp4"
}
],
"cover": {
"url": "https://assets.aitoearn.cn/6a3b48b5ec793a848a671de1/ai/images/gpt-image-2/202607/GlhuS1TEyXtDAyumLezfo.png"
}
},
"publishAt": "2030-01-01T00:00:00.000Z",
"items": [
{
"platform": "douyin",
"accountId": "account-id-from-accounts-list"
}
]
}
'import requests
url = "https://aitoearn.cn/api/v2/channels/publish/flows"
payload = {
"content": {
"title": "publish-demo-video",
"body": "Publish a video using the AiToEarn API.",
"media": [{ "url": "https://assets.aitoearn.cn/6a3b48b5ec793a848a671de1/ai/video/doubao-seedance-2-0-260128/202607/I-lRTCBUkjE43NRd77eWC.mp4" }],
"cover": { "url": "https://assets.aitoearn.cn/6a3b48b5ec793a848a671de1/ai/images/gpt-image-2/202607/GlhuS1TEyXtDAyumLezfo.png" }
},
"publishAt": "2030-01-01T00:00:00.000Z",
"items": [
{
"platform": "douyin",
"accountId": "account-id-from-accounts-list"
}
]
}
headers = {
"X-Api-Key": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'X-Api-Key': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
content: {
title: 'publish-demo-video',
body: JSON.stringify('Publish a video using the AiToEarn API.'),
media: [
{
url: 'https://assets.aitoearn.cn/6a3b48b5ec793a848a671de1/ai/video/doubao-seedance-2-0-260128/202607/I-lRTCBUkjE43NRd77eWC.mp4'
}
],
cover: {
url: 'https://assets.aitoearn.cn/6a3b48b5ec793a848a671de1/ai/images/gpt-image-2/202607/GlhuS1TEyXtDAyumLezfo.png'
}
},
publishAt: '2030-01-01T00:00:00.000Z',
items: [{platform: 'douyin', accountId: 'account-id-from-accounts-list'}]
})
};
fetch('https://aitoearn.cn/api/v2/channels/publish/flows', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://aitoearn.cn/api/v2/channels/publish/flows"
payload := strings.NewReader("{\n \"content\": {\n \"title\": \"publish-demo-video\",\n \"body\": \"Publish a video using the AiToEarn API.\",\n \"media\": [\n {\n \"url\": \"https://assets.aitoearn.cn/6a3b48b5ec793a848a671de1/ai/video/doubao-seedance-2-0-260128/202607/I-lRTCBUkjE43NRd77eWC.mp4\"\n }\n ],\n \"cover\": {\n \"url\": \"https://assets.aitoearn.cn/6a3b48b5ec793a848a671de1/ai/images/gpt-image-2/202607/GlhuS1TEyXtDAyumLezfo.png\"\n }\n },\n \"publishAt\": \"2030-01-01T00:00:00.000Z\",\n \"items\": [\n {\n \"platform\": \"douyin\",\n \"accountId\": \"account-id-from-accounts-list\"\n }\n ]\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("X-Api-Key", "<api-key>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}{
"code": 0,
"message": "请求成功",
"data": {
"flowId": "string",
"tasks": [
{
"id": "string",
"accountId": "string",
"platform": "string",
"status": "number",
"publishTime": "string",
"platformWorkId": "string",
"workLink": "string",
"linkStatus": "string",
"linkError": "string",
"linkMeta": "object",
"errorMsg": "string"
}
]
},
"requestId": "string"
}
