# 开发者参考 [Orbito Ads · 简体中文 · HTML](https://orbitoads.pro/zh/docs/) 来源核对日期 · 2026-11-27 ### 浏览文档 [全部文档](/zh/docs/) 快速入门 - [API 快速入门](/zh/docs/api/) - [密钥与账户权限](/zh/docs/api/authentication/) - [将 API 文档交给 AI 助手](/zh/docs/api/ai-assistants/) 基础概念 - [解读 API 错误](/zh/docs/api/errors/) - [请求和事件限额](/zh/docs/api/rate-limits/) - [安全重试同一操作](/zh/docs/api/idempotency/) - [跟踪排队中的操作](/zh/docs/api/tasks/) - [逐页读取广告活动](/zh/docs/api/pagination/) API 参考 - [可访问的广告账户](/zh/docs/api/accounts/) - [查询广告活动](/zh/docs/api/campaigns/) - [创建广告活动与上传媒体](/zh/docs/api/create-campaigns/) - [修改现有广告活动](/zh/docs/api/manage-campaigns/) - [广告活动与账户统计](/zh/docs/api/stats/) - [定向词典与群组](/zh/docs/api/targeting/) 集成 - [接收广告活动事件](/zh/docs/api/webhooks/) - [发送已确认的转化](/zh/docs/api/conversions/) - [API 版本与更新](/zh/docs/api/changelog/) 文件与架构 - [OpenAPI · YAML](/docs/api/openapi.yaml) - [OpenAPI · JSON](/docs/api/openapi.json) - [llms.txt](/zh/docs/llms.txt) - [llms-full.txt](/zh/docs/llms-full.txt) [全部文档](/zh/docs/) 快速入门 - [API 快速入门](/zh/docs/api/) - [密钥与账户权限](/zh/docs/api/authentication/) - [将 API 文档交给 AI 助手](/zh/docs/api/ai-assistants/) 基础概念 - [解读 API 错误](/zh/docs/api/errors/) - [请求和事件限额](/zh/docs/api/rate-limits/) - [安全重试同一操作](/zh/docs/api/idempotency/) - [跟踪排队中的操作](/zh/docs/api/tasks/) - [逐页读取广告活动](/zh/docs/api/pagination/) API 参考 - [可访问的广告账户](/zh/docs/api/accounts/) - [查询广告活动](/zh/docs/api/campaigns/) - [创建广告活动与上传媒体](/zh/docs/api/create-campaigns/) - [修改现有广告活动](/zh/docs/api/manage-campaigns/) - [广告活动与账户统计](/zh/docs/api/stats/) - [定向词典与群组](/zh/docs/api/targeting/) 集成 - [接收广告活动事件](/zh/docs/api/webhooks/) - [发送已确认的转化](/zh/docs/api/conversions/) - [API 版本与更新](/zh/docs/api/changelog/) 文件与架构 - [OpenAPI · YAML](/docs/api/openapi.yaml) - [OpenAPI · JSON](/docs/api/openapi.json) - [llms.txt](/zh/docs/llms.txt) - [llms-full.txt](/zh/docs/llms-full.txt) [Orbito Ads](/zh/) 文档 文档涵盖账户权限、活动管理、统计和事件投递。首先用只读密钥列出有权访问的账户。 [查看文档索引](/zh/docs/llms.txt) [API 密钥](/api-keys?lang=en) 本节说明如何从自己的程序调用 Orbito Ads。API 支持读取统计、新建广告活动、修改出价和文案、暂停或恢复投放以及调拨预算。所有广告账户均使用相同的方法和 API 密钥。 ## API - [**快速启动** 关键,第一请求和您的第一次活动通过 API 约五分钟。](/zh/docs/api/) - [**关键与访问** 阅读和广告活动管理关键,广告会计一个关键的到达,机构团队。](/zh/docs/api/authentication/) - [**创建活动** 频道、机器人、搜索和观众目标,每次呼叫一百个活动。](/zh/docs/api/create-campaigns/) - [**管理活动** 编辑、休息和重新编辑、移动预算、复制、删除 - 一场活动或一千次。](/zh/docs/api/manage-campaigns/) - [**网页** 签名状态变化实时和一个小时统计消化。](/zh/docs/api/webhooks/) - [**与 AI 助理相结合** 把这些文件交给克劳德·科德或其他编码代理,让它写入整合。](/zh/docs/api/ai-assistants/) ## 基础 URL 与身份验证 示例 ``` https://orbitoads.pro/api/v1 X-API-Key: orbito_… ``` 在面板中创建密钥:[API 和 Webhooks](/api-keys?lang=en)(Pro和Agency计划). Questions — [@orbitoads](https://t.me/orbitoads). ## 机器可读格式 - [OpenAPI 3.1 SPEC](/docs/api/openapi.yaml) — 每个端点,参数和出错代码. - [llms.txt](/docs/llms.txt) —索引为AI代理已读; [llms-full.txt](/docs/llms-full.txt) — 所有页都是在一个文件中. - 每页都有一个Markdown双:在它的路径上加上`.md`,e.g. [/docs/api.md](/docs/api.md) . 完整广告接口需要为此工作区单独配置供应商凭据。客户端请求使用自己的 Orbito API 密钥。账户订购、开通和外部账单分别处理。 ## 实施说明 ## 连接工作区 完整广告接口需要为此工作区单独配置供应商凭据。客户端请求使用自己的 Orbito API 密钥。账户订购、开通和外部账单分别处理。 ### 开发指南与账户访问 **API 快速入门** API 快速入门 — 在服务端使用密钥获取账户列表,选择账户并查询广告活动。首次写入时使用新的幂等键创建暂停的草稿,再查询返回的任务编号。 [**API 快速入门**](/zh/docs/api/) **密钥与账户权限** 密钥与账户权限 — 从服务端通过 X-API-Key 请求头传递密钥。可授权单个、多个或全部可用账户。写入还需密钥具有管理权限,且持有人为账户管理者或所有者。 [**密钥与账户权限**](/zh/docs/api/authentication/) **创建广告活动与上传媒体** 创建广告活动与上传媒体 — 每个请求可在一个账户内创建最多 100 项活动。选择频道、机器人、搜索或受众定向,提供唯一操作键并跟踪返回的任务。需要媒体时先上传。 [**创建广告活动与上传媒体**](/zh/docs/api/create-campaigns/) **修改现有广告活动** 修改现有广告活动 — 可管理文案、链接、出价、每日限额、排期、预算和投放状态。单个批量请求支持最多 1,000 项活动,请查询任务中的局部失败记录。 [**修改现有广告活动**](/zh/docs/api/manage-campaigns/) **接收广告活动事件** 接收广告活动事件 — 文档区分 status_change、hourly_digest 和测试 ping。通过 HTTPS 接收回调,用原始请求体校验签名,并在处理前对重复投递去重。 [**接收广告活动事件**](/zh/docs/api/webhooks/) **将 API 文档交给 AI 助手** 将 API 文档交给 AI 助手 — 从 OpenAPI 查看字段,用 Markdown 文档了解行为。真实密钥保存在服务端环境。开放写入前先验证只读操作。 [**将 API 文档交给 AI 助手**](/zh/docs/api/ai-assistants/) [管理 API 密钥和 Webhook](/api-keys?lang=en) ## 首次请求 携带 X-API-Key 调用 GET /api/v1/account/info,从 data 中选取 id,在下一次请求中作为 account_id。示例数据和标识均为虚构。 ## 操作与字段 /docs/api/openapi.yaml /docs/llms.txt /docs/llms-full.txt - /docs/api/openapi.yaml - /docs/llms.txt - /docs/llms-full.txt ## 请求示例 GET /api/v1/account/info HTTP/1.1 Host: orbitoads.pro X-API-Key: {key} ## 结构字段与限制 本表依据公开的 v1 契约。参数与字段名称区分大小写。各操作的 HTTP 状态码分别表示成功、输入校验和访问检查。链接规范给出了完整的请求与响应结构。 ### 机器可读的参考资料 [OpenAPI 3.1](/docs/api/openapi.yaml)[llms.txt](/docs/llms.txt)[llms-full.txt](/docs/llms-full.txt)[Markdown](/zh/docs/api.md) ## 协议参考 | 方法 | 路径 | 参数 | 请求内容 | 响应码 | | --- | --- | --- | --- | --- | | GET | /api/v1/account/info | — | — | 200, 401, 429 | | GET | /api/v1/campaigns | account_id, status, title, bot_username, promote_domain, promote_domain_mode, type, limit, cursor, offset, sortBy, sortOrder | — | 200, 400, 401, 404, 429 | | GET | /api/v1/stats | period, startDate, endDate, startHour, endHour | — | 200, 401, 429 | | GET | /api/v1/targeting | — | — | 200, 401 | | GET | /api/v1/conversions | adId, days | — | 200, 401 | 来源 · [数据来源](https://adsly.pro/docs/api/openapi.yaml) ## 结构字段与限制 · 开发者文档 | 字段 | 文档取值 | | --- | --- | | /docs/api/openapi.yaml | OpenAPI 3.1 | | /docs/llms.txt | Markdown | | /docs/llms-full.txt | Markdown | 来源 · [数据来源](https://adsly.pro/docs/) ## Cabinet | 字段 | 字段类型 | | --- | --- | | id | integer | | name | string | | cabinet_type | euro \| ton \| stars | | is_active | boolean | | access_level | owner \| manager \| viewer \| admin | | currency | EUR \| TON \| STARS | | balance | Money | | balance_updated_at | string \| null · date-time | | min_budget | number | | features | object | 来源 · [数据来源](https://adsly.pro/docs/api/openapi.yaml) ## 相关阅读 [API 快速入门](/zh/docs/api/)[密钥与账户权限](/zh/docs/api/authentication/)[创建广告活动与上传媒体](/zh/docs/api/create-campaigns/)[修改现有广告活动](/zh/docs/api/manage-campaigns/)[接收广告活动事件](/zh/docs/api/webhooks/) [下一主题**API 快速入门**](/zh/docs/api/) ## 来源与数据 - [openapi.yaml](https://orbitoads.pro/docs/api/openapi.yaml) - [openapi.json](https://orbitoads.pro/docs/api/openapi.json) --- # API 快速入门 [Orbito Ads · 简体中文 · HTML](https://orbitoads.pro/zh/docs/api/) 来源核对日期 · 2026-11-27 ### 浏览文档 [全部文档](/zh/docs/) 快速入门 - [API 快速入门](/zh/docs/api/) - [密钥与账户权限](/zh/docs/api/authentication/) - [将 API 文档交给 AI 助手](/zh/docs/api/ai-assistants/) 基础概念 - [解读 API 错误](/zh/docs/api/errors/) - [请求和事件限额](/zh/docs/api/rate-limits/) - [安全重试同一操作](/zh/docs/api/idempotency/) - [跟踪排队中的操作](/zh/docs/api/tasks/) - [逐页读取广告活动](/zh/docs/api/pagination/) API 参考 - [可访问的广告账户](/zh/docs/api/accounts/) - [查询广告活动](/zh/docs/api/campaigns/) - [创建广告活动与上传媒体](/zh/docs/api/create-campaigns/) - [修改现有广告活动](/zh/docs/api/manage-campaigns/) - [广告活动与账户统计](/zh/docs/api/stats/) - [定向词典与群组](/zh/docs/api/targeting/) 集成 - [接收广告活动事件](/zh/docs/api/webhooks/) - [发送已确认的转化](/zh/docs/api/conversions/) - [API 版本与更新](/zh/docs/api/changelog/) 文件与架构 - [OpenAPI · YAML](/docs/api/openapi.yaml) - [OpenAPI · JSON](/docs/api/openapi.json) - [llms.txt](/zh/docs/llms.txt) - [llms-full.txt](/zh/docs/llms-full.txt) [全部文档](/zh/docs/) 快速入门 - [API 快速入门](/zh/docs/api/) - [密钥与账户权限](/zh/docs/api/authentication/) - [将 API 文档交给 AI 助手](/zh/docs/api/ai-assistants/) 基础概念 - [解读 API 错误](/zh/docs/api/errors/) - [请求和事件限额](/zh/docs/api/rate-limits/) - [安全重试同一操作](/zh/docs/api/idempotency/) - [跟踪排队中的操作](/zh/docs/api/tasks/) - [逐页读取广告活动](/zh/docs/api/pagination/) API 参考 - [可访问的广告账户](/zh/docs/api/accounts/) - [查询广告活动](/zh/docs/api/campaigns/) - [创建广告活动与上传媒体](/zh/docs/api/create-campaigns/) - [修改现有广告活动](/zh/docs/api/manage-campaigns/) - [广告活动与账户统计](/zh/docs/api/stats/) - [定向词典与群组](/zh/docs/api/targeting/) 集成 - [接收广告活动事件](/zh/docs/api/webhooks/) - [发送已确认的转化](/zh/docs/api/conversions/) - [API 版本与更新](/zh/docs/api/changelog/) 文件与架构 - [OpenAPI · YAML](/docs/api/openapi.yaml) - [OpenAPI · JSON](/docs/api/openapi.json) - [llms.txt](/zh/docs/llms.txt) - [llms-full.txt](/zh/docs/llms-full.txt) [Orbito Ads](/zh/) [文档](/zh/docs/) API 在服务端使用密钥获取账户列表,选择账户并查询广告活动。首次写入时使用新的幂等键创建暂停的草稿,再查询返回的任务编号。 [Markdown](/zh/docs/api.md) 通过 Orbito Ads API,可在自己的应用中执行面板支持的 Telegram Ads 账户管理操作。Euro、TON 和 Stars 账户共用一套方法、一个基础地址和同一密钥。 | 你想这样... You want to... | 使用 | | --- | --- | | 把运动和统计数据拉入仪表板或BI号仪表板 | [活动](/zh/docs/api/campaigns/), [国家](/zh/docs/api/stats/) | | 从脚本、机器人或你的CRM发动运动 | [创建活动](/zh/docs/api/create-campaigns/) | | 出价,暂停输家,自动加注赢家 | [管理活动](/zh/docs/api/manage-campaigns/) | | 了解一项运动何时获得批准、何时遭到拒绝或何时预算用完 | [网页](/zh/docs/api/webhooks/) | | 算上你追踪器的线索和销量 与每次广告活动相对应 | [转换](/zh/docs/api/conversions/) | ## 基础 URL 示例 ``` https://orbitoads.pro/api/v1 ``` 每个请求都将您的密钥带入 `X-API-Key` 头部 请求和回应机构是 JSON. 所有时间都是 UTC. ## 快速开始 ### 1. 创建密钥 在面板中打开**API 和 Webhooks** — **+ 新钥匙** (Pro和Agency计划) 选择键的哪个柜子。 要创建和改变运动, 请选中 **允许管理活动** — 没有它, 键只能读取 。 复制键: 显示一次 。 示例 ``` export ORBITO_API_KEY="orb_…" ``` ### 2. 列出密钥所看到的内阁 示例 ``` curl -s https://orbitoads.pro/api/v1/account/info \ -H "X-API-Key: $ORBITO_API_KEY" ``` 示例 ``` { "success": true, "data": [ { "id": 53, "name": "Main cabinet", "cabinet_type": "euro", "is_active": true, "access_level": "owner", "currency": "EUR", "balance": "250.00", "balance_updated_at": "2026-10-08T09:40:12.000Z", "min_budget": 1, "features": { "ad_button": true, "crypto_filters": true } } ] } ``` 保存`id` — 这是`account_id`的所有其他呼叫用途, 内阁中所有的钱都在`currency`。 ### 3. 阅读运动 示例 ``` curl -s "https://orbitoads.pro/api/v1/campaigns?account_id=53&status=Active&limit=50" \ -H "X-API-Key: $ORBITO_API_KEY" ``` ### 4. 发起一场运动(取消,因此没有花费) 示例 ``` curl -s -X POST https://orbitoads.pro/api/v1/campaigns \ -H "X-API-Key: $ORBITO_API_KEY" \ -H "Content-Type: application/json" \ -H "Idempotency-Key: $(uuidgen)" \ -d '{ "account_id": 53, "title": "API test", "text": "Join the channel for daily market notes", "promote_url": "https://t.me/yourchannel", "cpm": 1.5, "budget": 0, "active": false, "target_type": "channels", "channels": ["@durov"] }' ``` 创造Telegram的谈话,所以它运行在背景。你得到`202 Accepted`和一个任务: 示例 ``` { "success": true, "data": { "id": 81234, "type": "create", "status": "pending", "account_id": 53, "total": 1, "ad_ids": [] } } ``` ### 5. 等待任务 示例 ``` curl -s https://orbitoads.pro/api/v1/tasks/81234 -H "X-API-Key: $ORBITO_API_KEY" ``` 当`status`是`completed`时,`ad_ids`持有新广告活动的身份证。 现在你可以资助它并把它转换为: 示例 ``` curl -s -X POST https://orbitoads.pro/api/v1/campaigns/90412/budget \ -H "X-API-Key: $ORBITO_API_KEY" -H "Content-Type: application/json" \ -H "Idempotency-Key: $(uuidgen)" \ -d '{ "account_id": 53, "action": "add", "amount": 5 }' curl -s -X POST "https://orbitoads.pro/api/v1/campaigns/90412/resume?account_id=53" \ -H "X-API-Key: $ORBITO_API_KEY" ``` Telegram在运行前每条新广告都会评论;广告活动的`status`显示其位置(参见[地位](/zh/docs/api/campaigns/#doc-note-statuses) ) 。 A [网页](/zh/docs/api/webhooks/)告诉您它改变的时刻。 ## 集成的五条规则 1. **`ad_id` 它仅在广告账户内独特。** Telegram 复用广告标识横跨柜子,存储并查看对子`(account_id, ad_id)`的广告活动,每当有钥匙看到一个以上的柜子时通过`account_id`. 2. **发送一 `Idempotency-Key` 创建、复制、大批和预算呼叫** — 每起手术都新鲜出UUID起, 重试时也一样。 重试之后再也没有创造第二次广告活动或两次移动钱财。 见[无能](/zh/docs/api/idempotency/) 。 3. **创建、复制和大批返回任务。** Poll `GET /v1/tasks/{id}` 直到完成,见[任务](/zh/docs/api/tasks/) . 4. **金钱是线条** (`"spent": "3.541000"`) 来保持精确的十进制。在进行算术前将其分析为十进制 。 5. **分支在 `code`展览 `error`.** 每个出错都有稳定的机读`code`和`error`中的人文句子. See [错误](/zh/docs/api/errors/) . ## 响应结构 示例 ``` { "success": true, "data": { … }, "meta": { … } } { "success": false, "error": "Human-readable message", "code": "MACHINE_CODE", "request_id": "…" } ``` ## 后续步骤 - [关键与访问](/zh/docs/api/authentication/) — 只读 vs 广告活动管理密钥, 代理团队. - [与克劳德和其他AI助理一起建造](/zh/docs/api/ai-assistants/) — 让一个编码代理编写集成. - [OpenAPI SPEC](/docs/api/openapi.yaml) — 从Postman, Insomnia 或客户端生成器中导入. ## API 参考 完整广告接口需要为此工作区单独配置供应商凭据。客户端请求使用自己的 Orbito API 密钥。账户订购、开通和外部账单分别处理。 示例 · cURL ``` curl -X GET https://orbitoads.pro/api/v1/account/info \ -H 'X-API-Key: YOUR_ORBITO_KEY' ``` 示例 · JSON ``` { "success": true, "data": [ { "id": 7401, "name": "Example language school", "cabinet_type": "euro", "is_active": true, "access_level": "manager", "currency": "EUR", "balance": "82.50", "balance_updated_at": "2026-11-03T12:00:00Z", "min_budget": 1, "features": { "ad_button": true, "crypto_filters": false } } ] } ``` ## 实施说明 ## 首次请求 携带 X-API-Key 调用 GET /api/v1/account/info,从 data 中选取 id,在下一次请求中作为 account_id。示例数据和标识均为虚构。 ## 账户与广告标识 联合保存 account_id 和 ad_id。不同账户可能重复使用同一 ad_id。密钥可访问多个账户时请传入 account_id 选定记录。 ## 受理与完成 创建、复制和批量操作返回 HTTP 202 及任务 ID。按 Retry-After 轮询 GET /api/v1/tasks/{id}。即使状态为 completed,也要检查 failed 和 errors。 ## 操作与字段 GET /api/v1/account/info GET /api/v1/campaigns POST /api/v1/campaigns GET /api/v1/tasks/{id} - GET /api/v1/account/info - GET /api/v1/campaigns - POST /api/v1/campaigns - GET /api/v1/tasks/{id} ## 请求示例 GET /api/v1/campaigns?limit=10&cursor= HTTP/1.1 Host: orbitoads.pro X-API-Key: {key} ## 结构字段与限制 本表依据公开的 v1 契约。参数与字段名称区分大小写。各操作的 HTTP 状态码分别表示成功、输入校验和访问检查。链接规范给出了完整的请求与响应结构。 ## 协议参考 | 方法 | 路径 | 参数 | 请求内容 | 响应码 | | --- | --- | --- | --- | --- | | GET | /api/v1/account/info | — | — | 200, 401, 429 | | GET | /api/v1/campaigns | account_id, status, title, bot_username, promote_domain, promote_domain_mode, type, limit, cursor, offset, sortBy, sortOrder | — | 200, 400, 401, 404, 429 | | POST | /api/v1/campaigns | Idempotency-Key | application/json · CreateSingleRequest \| CreateBatchRequest | 202, 400, 401, 403, 404, 409, 422, 429, 503 | | GET | /api/v1/tasks/{id} | id | — | 200, 400, 401, 404 | 来源 · [数据来源](https://adsly.pro/docs/api/openapi.yaml) ## 结构字段与限制 · API 快速入门 | 字段 | 文档取值 | | --- | --- | | X-API-Key | HTTP header | | Content-Type | application/json | | 202 | Location, Retry-After | 来源 · [数据来源](https://adsly.pro/docs/api/) ## CampaignStatus | 字段 | 字段类型 | | --- | --- | | CampaignStatus | Active \| In Review \| Declined \| On Hold \| Stopped \| Paused \| Deleted | 来源 · [数据来源](https://adsly.pro/docs/api/openapi.yaml) ## 相关阅读 [开发者文档](/zh/docs/)[密钥与账户权限](/zh/docs/api/authentication/)[将 API 文档交给 AI 助手](/zh/docs/api/ai-assistants/) 参考资料更新日期 2026-10-08 [上一主题**开发者文档**](/zh/docs/)[下一主题**密钥与账户权限**](/zh/docs/api/authentication/) ## 来源与数据 - [openapi.yaml](https://orbitoads.pro/docs/api/openapi.yaml) - [openapi.json](https://orbitoads.pro/docs/api/openapi.json) --- # 可访问的广告账户 [Orbito Ads · 简体中文 · HTML](https://orbitoads.pro/zh/docs/api/accounts/) 来源核对日期 · 2026-11-27 ### 浏览文档 [全部文档](/zh/docs/) 快速入门 - [API 快速入门](/zh/docs/api/) - [密钥与账户权限](/zh/docs/api/authentication/) - [将 API 文档交给 AI 助手](/zh/docs/api/ai-assistants/) 基础概念 - [解读 API 错误](/zh/docs/api/errors/) - [请求和事件限额](/zh/docs/api/rate-limits/) - [安全重试同一操作](/zh/docs/api/idempotency/) - [跟踪排队中的操作](/zh/docs/api/tasks/) - [逐页读取广告活动](/zh/docs/api/pagination/) API 参考 - [可访问的广告账户](/zh/docs/api/accounts/) - [查询广告活动](/zh/docs/api/campaigns/) - [创建广告活动与上传媒体](/zh/docs/api/create-campaigns/) - [修改现有广告活动](/zh/docs/api/manage-campaigns/) - [广告活动与账户统计](/zh/docs/api/stats/) - [定向词典与群组](/zh/docs/api/targeting/) 集成 - [接收广告活动事件](/zh/docs/api/webhooks/) - [发送已确认的转化](/zh/docs/api/conversions/) - [API 版本与更新](/zh/docs/api/changelog/) 文件与架构 - [OpenAPI · YAML](/docs/api/openapi.yaml) - [OpenAPI · JSON](/docs/api/openapi.json) - [llms.txt](/zh/docs/llms.txt) - [llms-full.txt](/zh/docs/llms-full.txt) [全部文档](/zh/docs/) 快速入门 - [API 快速入门](/zh/docs/api/) - [密钥与账户权限](/zh/docs/api/authentication/) - [将 API 文档交给 AI 助手](/zh/docs/api/ai-assistants/) 基础概念 - [解读 API 错误](/zh/docs/api/errors/) - [请求和事件限额](/zh/docs/api/rate-limits/) - [安全重试同一操作](/zh/docs/api/idempotency/) - [跟踪排队中的操作](/zh/docs/api/tasks/) - [逐页读取广告活动](/zh/docs/api/pagination/) API 参考 - [可访问的广告账户](/zh/docs/api/accounts/) - [查询广告活动](/zh/docs/api/campaigns/) - [创建广告活动与上传媒体](/zh/docs/api/create-campaigns/) - [修改现有广告活动](/zh/docs/api/manage-campaigns/) - [广告活动与账户统计](/zh/docs/api/stats/) - [定向词典与群组](/zh/docs/api/targeting/) 集成 - [接收广告活动事件](/zh/docs/api/webhooks/) - [发送已确认的转化](/zh/docs/api/conversions/) - [API 版本与更新](/zh/docs/api/changelog/) 文件与架构 - [OpenAPI · YAML](/docs/api/openapi.yaml) - [OpenAPI · JSON](/docs/api/openapi.json) - [llms.txt](/zh/docs/llms.txt) - [llms-full.txt](/zh/docs/llms-full.txt) [Orbito Ads](/zh/) [文档](/zh/docs/) [API](/zh/docs/api/) 账户列表显示结算货币、可用余额、权限级别及支持的广告字段。保存活动标识时同时保存 account_id。 [Markdown](/zh/docs/api/accounts.md) Orbito 的每个账户对应一个 Telegram Ads 广告账户。每项广告活动仅属于一个账户,通过 `account_id` 标识。 ## GET /v1/account/info 返回此密钥当前可访问的广告账户。 示例 ``` curl -s https://orbitoads.pro/api/v1/account/info -H "X-API-Key: $ORBITO_API_KEY" ``` 示例 ``` { "success": true, "data": [ { "id": 53, "name": "Main cabinet", "cabinet_type": "euro", "is_active": true, "access_level": "owner", "currency": "EUR", "balance": "250.00", "balance_updated_at": "2026-10-08T09:40:12.000Z", "min_budget": 1, "features": { "ad_button": true, "crypto_filters": true } }, { "id": 61, "name": "Client B", "cabinet_type": "ton", "is_active": true, "access_level": "viewer", "currency": "TON", "balance": "84.20", "balance_updated_at": "2026-10-08T09:35:51.000Z", "min_budget": 1, "features": { "ad_button": false, "crypto_filters": false } } ] } ``` | 田野 | 意义 | | --- | --- | | `id` | `account_id`号传到其他电话. | | `cabinet_type` | `euro`, `ton`或`stars` (中文(简体) ). | | `currency` | `EUR`,`TON`或`STARS` — 这个内阁中**每个** 个货币领域的货币:余额,预算,支出,CPM. 永远不要将不同货币的内阁间货币相加. | | `access_level` | 您的访问权限:`owner`、`manager`(机构成员可以改变广告活动)或`viewer`(机构成员,只读)。写作需要`owner`或`manager`。 | | `balance` | 内阁上的钱,还没有给广告活动(十进制字符串). 内阁同步时刷新——见`balance_updated_at`. | | `min_budget` | 这个内阁中最小的一场非零`budget`的新广告活动可以举行. | | `features.ad_button` | 内阁的广告格式有一个自定义按钮(创建/编辑的`button`字段). | | `features.crypto_filters` | 内阁的广告形式有密码通道过滤器. | 对于展示调整后数据的特殊合作伙伴密钥,`balance` 字段为 `null`。 ## 说明 - `GET /v1/account/info`费用1个读取请求——在启动时和写回`ACCOUNT_NOT_FOUND`时拨打,而不是在每通电话之前拨打. - 柜子在被关闭或您无法访问时从列表中消失 。 - Orbito Ads小组增加了内阁;API小组管理内部的广告活动。 ## API 参考 完整广告接口需要为此工作区单独配置供应商凭据。客户端请求使用自己的 Orbito API 密钥。账户订购、开通和外部账单分别处理。 ## GET `/api/v1/account/info` 列出密钥可访问的账户、币种、限额及权限。 | 参数 | 位置 | 格式 | 必填 | | --- | --- | --- | --- | | `X-API-Key` | header | `string` | 是 | cURL ``` curl -X GET https://orbitoads.pro/api/v1/account/info \ -H 'X-API-Key: YOUR_ORBITO_KEY' ``` HTTP 200 ``` { "success": true, "data": [ { "id": 7401, "name": "Example language school", "cabinet_type": "euro", "is_active": true, "access_level": "manager", "currency": "EUR", "balance": "82.50", "balance_updated_at": "2026-11-03T12:00:00Z", "min_budget": 1, "features": { "ad_button": true, "crypto_filters": false } } ] } ``` ## 实施说明 ## 余额与币种 逐账户核对 currency、balance_updated_at 和 min_budget。广告对象中的金额及费率可能是十进制字符串或 null,统计聚合使用数值。EUR、TON 和 Stars 分开汇总。 ## 功能可用性 features.ad_button 表示可用自定义按钮,features.crypto_filters 表示可用加密频道筛选。提供操作前检查 is_active 和 access_level。 ## 操作与字段 GET /api/v1/account/info account_id currency balance - GET /api/v1/account/info - account_id - currency - balance ## 请求示例 GET /api/v1/account/info HTTP/1.1 Host: orbitoads.pro X-API-Key: {key} ## 结构字段与限制 本表依据公开的 v1 契约。参数与字段名称区分大小写。各操作的 HTTP 状态码分别表示成功、输入校验和访问检查。链接规范给出了完整的请求与响应结构。 ## 协议参考 | 方法 | 路径 | 参数 | 请求内容 | 响应码 | | --- | --- | --- | --- | --- | | GET | /api/v1/account/info | — | — | 200, 401, 429 | 来源 · [数据来源](https://adsly.pro/docs/api/openapi.yaml) ## 结构字段与限制 · 可访问的广告账户 | 字段 | 文档取值 | | --- | --- | | cabinet_type | euro, ton, stars | | currency | EUR, TON, STARS | | balance | decimal string \| null | | balance_updated_at | date-time | | features | ad_button, crypto_filters | 来源 · [数据来源](https://adsly.pro/docs/api/accounts/) ## Cabinet | 字段 | 字段类型 | | --- | --- | | id | integer | | name | string | | cabinet_type | euro \| ton \| stars | | is_active | boolean | | access_level | owner \| manager \| viewer \| admin | | currency | EUR \| TON \| STARS | | balance | Money | | balance_updated_at | string \| null · date-time | | min_budget | number | | features | object | 来源 · [数据来源](https://adsly.pro/docs/api/openapi.yaml) ## Money | 字段 | 字段类型 | | --- | --- | | Money | string \| null | 来源 · [数据来源](https://adsly.pro/docs/api/openapi.yaml) ## 相关阅读 [查询广告活动](/zh/docs/api/campaigns/)[创建广告活动与上传媒体](/zh/docs/api/create-campaigns/)[修改现有广告活动](/zh/docs/api/manage-campaigns/)[广告活动与账户统计](/zh/docs/api/stats/)[定向词典与群组](/zh/docs/api/targeting/) 参考资料更新日期 2026-10-08 [上一主题**逐页读取广告活动**](/zh/docs/api/pagination/)[下一主题**查询广告活动**](/zh/docs/api/campaigns/) ## 来源与数据 - [openapi.yaml](https://orbitoads.pro/docs/api/openapi.yaml) - [openapi.json](https://orbitoads.pro/docs/api/openapi.json) --- # 将 API 文档交给 AI 助手 [Orbito Ads · 简体中文 · HTML](https://orbitoads.pro/zh/docs/api/ai-assistants/) 来源核对日期 · 2026-11-27 ### 浏览文档 [全部文档](/zh/docs/) 快速入门 - [API 快速入门](/zh/docs/api/) - [密钥与账户权限](/zh/docs/api/authentication/) - [将 API 文档交给 AI 助手](/zh/docs/api/ai-assistants/) 基础概念 - [解读 API 错误](/zh/docs/api/errors/) - [请求和事件限额](/zh/docs/api/rate-limits/) - [安全重试同一操作](/zh/docs/api/idempotency/) - [跟踪排队中的操作](/zh/docs/api/tasks/) - [逐页读取广告活动](/zh/docs/api/pagination/) API 参考 - [可访问的广告账户](/zh/docs/api/accounts/) - [查询广告活动](/zh/docs/api/campaigns/) - [创建广告活动与上传媒体](/zh/docs/api/create-campaigns/) - [修改现有广告活动](/zh/docs/api/manage-campaigns/) - [广告活动与账户统计](/zh/docs/api/stats/) - [定向词典与群组](/zh/docs/api/targeting/) 集成 - [接收广告活动事件](/zh/docs/api/webhooks/) - [发送已确认的转化](/zh/docs/api/conversions/) - [API 版本与更新](/zh/docs/api/changelog/) 文件与架构 - [OpenAPI · YAML](/docs/api/openapi.yaml) - [OpenAPI · JSON](/docs/api/openapi.json) - [llms.txt](/zh/docs/llms.txt) - [llms-full.txt](/zh/docs/llms-full.txt) [全部文档](/zh/docs/) 快速入门 - [API 快速入门](/zh/docs/api/) - [密钥与账户权限](/zh/docs/api/authentication/) - [将 API 文档交给 AI 助手](/zh/docs/api/ai-assistants/) 基础概念 - [解读 API 错误](/zh/docs/api/errors/) - [请求和事件限额](/zh/docs/api/rate-limits/) - [安全重试同一操作](/zh/docs/api/idempotency/) - [跟踪排队中的操作](/zh/docs/api/tasks/) - [逐页读取广告活动](/zh/docs/api/pagination/) API 参考 - [可访问的广告账户](/zh/docs/api/accounts/) - [查询广告活动](/zh/docs/api/campaigns/) - [创建广告活动与上传媒体](/zh/docs/api/create-campaigns/) - [修改现有广告活动](/zh/docs/api/manage-campaigns/) - [广告活动与账户统计](/zh/docs/api/stats/) - [定向词典与群组](/zh/docs/api/targeting/) 集成 - [接收广告活动事件](/zh/docs/api/webhooks/) - [发送已确认的转化](/zh/docs/api/conversions/) - [API 版本与更新](/zh/docs/api/changelog/) 文件与架构 - [OpenAPI · YAML](/docs/api/openapi.yaml) - [OpenAPI · JSON](/docs/api/openapi.json) - [llms.txt](/zh/docs/llms.txt) - [llms-full.txt](/zh/docs/llms-full.txt) [Orbito Ads](/zh/) [文档](/zh/docs/) [API](/zh/docs/api/) 从 OpenAPI 查看字段,用 Markdown 文档了解行为。真实密钥保存在服务端环境。开放写入前先验证只读操作。 [Markdown](/zh/docs/api/ai-assistants.md) 这些文档同时面向开发者与编程助手。每个页面都提供 Markdown 版本,也可一次下载全套文档。API 的机器可读规范采用 OpenAPI 格式。将任务所需的文档链接提供给助手即可。 ## 供 AI 助手使用的文件 | 文件 | 什么是 | 什么时候用? | | --- | --- | --- | | [`/docs/llms.txt`](/docs/llms.txt) | 每页索引,有一行摘要([格式:txt](https://llmstxt.org/)). | 让经纪人去选它需要的页面 | | [`/docs/llms-full.txt`](/docs/llms-full.txt) | 所有页面在一个Markdown文件中( 大约80 KB) | 装入大文件全体的工具; 网易工具可能缩短它, 因此更倾向于 `llms.txt` + 页面 | | [`/docs/api/openapi.yaml`](/docs/api/openapi.yaml) | OpenAPI 3.1 spec:终点,参数,计划,出错代码 | 输入客户端, 请求验证, Postman | | `.md` | 页面为Markdown, e.g. [/docs/api/create-campaigns.md](/docs/api/create-campaigns.md) | 单一主题 | 每页上还设有**将页面复制为 Markdown** 个最上层——直接粘入聊天. ## 用 Claude Code 接入 API 的提示词 把这放在项目中的Clood Code(或其他编码代理)中,该项目应该与Orbito Ads谈话。 编辑最后一节,说明你正在建造什么。 示例 ``` 请为这个项目接入 Orbito Ads API。 编写代码前,先阅读 https://orbitoads.pro/zh/docs/llms.txt 及其列出的相关 Markdown 页面。完整文档见 https://orbitoads.pro/zh/docs/llms-full.txt,OpenAPI 规范见 https://orbitoads.pro/docs/api/openapi.yaml。 - 使用基础地址 https://orbitoads.pro/api/v1,通过 X-API-Key 请求头验证身份。从环境变量 ORBITO_API_KEY 读取密钥,不要将密钥写入源码或日志。 - 以 (account_id, ad_id) 标识广告活动。不同账户中可能出现相同的 ad_id。 - 每次向 /campaigns、/campaigns/bulk、/campaigns/{id}/copy 或 /campaigns/{id}/budget 发起新的 POST 操作时,均在 Idempotency-Key 中传入新的 UUID。重试同一操作时复用原 UUID。 - 创建、复制和批量操作返回 202 和任务信息。按照 Retry-After 指定的间隔调用 GET /tasks/{id},直到状态为 completed 或 failed。 - 金额以十进制字符串表示。比较前先用十进制数值类型解析,保留原精度。 - 收到 429 时按 Retry-After 等待。写入返回 5xx 时,先用 GET 确认广告活动的状态,再决定是否换用新的 Idempotency-Key 重试。 - 程序依据 code 字段处理错误;面向用户显示 error 字段。 - 编写一个提供类型化方法的小型客户端,并用模拟 HTTP 响应编写测试。 所需功能:<例如,每小时检查账户 53,将过去 24 小时 CPA 超过 4 EUR 的广告活动暂停>。 ``` ## 在聊天中执行一次性任务的提示词 对于一个问题而不是一个代码库的更改(Claude.ai, ChatGPT 或任何与网页访问的聊天): 示例 ``` 阅读 https://orbitoads.pro/zh/docs/llms.txt 及其列出的广告活动和统计页面。编写 Python 脚本,调用 Orbito Ads API,列出我所有账户中状态为 Active 的广告活动及各自在过去 7 天的花费,并按花费排序。从 ORBITO_API_KEY 读取密钥。 ``` ## 项目 CLAUDE.md 文件中的规则 如果您的项目有`CLAUDE.md`(Claude Code在每场会议开始时读取),请添加这个块,这样以后对整合的每次修改都遵循同样的规则: 示例 ``` ## Orbito Ads API 集成 - 更改调用前,查阅 https://orbitoads.pro/zh/docs/llms.txt、相关 .md 页面及 https://orbitoads.pro/docs/api/openapi.yaml。端点名称和字段以规范为准。 - 从环境变量读取 ORBITO_API_KEY。不得把密钥写入提交记录、终端输出或日志。 - 用 (account_id, ad_id) 标识广告活动。每次通过 POST 创建活动或调拨资金时发送 Idempotency-Key。每项操作单独生成 UUID,重试时使用同一 UUID。 - 创建、复制及批量操作后,轮询 GET /v1/tasks/{id}。对线上活动的预算调整、暂停和删除都应经过同一个有测试覆盖的模块。在生产环境运行一次性脚本前先取得授权。 ``` ## 助手的权限与安全 - **用一只阅读关键开发。** 代理可以探索真实数据而无事可改,仅在对写出代码进行审查时才切换到**管理活动** 的密钥上. - **与活动创建 `"active": false` 和 `"budget": 0` 测试时。** 无运行和无用; 事后删除。 - **缩小关键的范围** 到测试柜,而整合则是新式. - **让代理人读错。** 每个错误都说要修什么(`error`)并搭载一个稳定的`code`和错误的`param`——特工们用这些东西自行解决自己的要求而不会猜测. - 所有API的改变都显示在小组的广告活动史上,标有**🔌 API** 号,所以你可以检视经纪人的行为. ## API 参考 完整广告接口需要为此工作区单独配置供应商凭据。客户端请求使用自己的 Orbito API 密钥。账户订购、开通和外部账单分别处理。 示例 · cURL ``` curl -X GET 'https://orbitoads.pro/api/v1/campaigns?account_id=7401&status=Active%2COn+Hold&limit=25&cursor=' \ -H 'X-API-Key: YOUR_ORBITO_KEY' ``` ## 实施说明 ## 密钥与账户权限 在服务端保管 X-API-Key。报表使用只读权限;写入需要广告管理权限、指定账户的所有者或经理角色,以及有效的功能套餐。 ## 可复现的集成说明 提供本地 OpenAPI 合约、虚构账户 ID、操作、预期响应及重试测试。由服务端读取实际密钥。只读报表可先获取账户和广告列表。 ## 操作与字段 /docs/api/openapi.yaml /docs/llms.txt /docs/llms-full.txt /docs/api.md - /docs/api/openapi.yaml - /docs/llms.txt - /docs/llms-full.txt - /docs/api.md ## 请求示例 GET /docs/api/openapi.yaml ## 结构字段与限制 本表依据公开的 v1 契约。参数与字段名称区分大小写。各操作的 HTTP 状态码分别表示成功、输入校验和访问检查。链接规范给出了完整的请求与响应结构。 ## 协议参考 | 方法 | 路径 | 参数 | 请求内容 | 响应码 | | --- | --- | --- | --- | --- | | GET | /api/v1/account/info | — | — | 200, 401, 429 | | GET | /api/v1/targeting | — | — | 200, 401 | 来源 · [数据来源](https://adsly.pro/docs/api/openapi.yaml) ## 结构字段与限制 · 将 API 文档交给 AI 助手 | 字段 | 文档取值 | | --- | --- | | /docs/llms.txt | index | | /docs/llms-full.txt | Markdown | | /docs/api/openapi.yaml | OpenAPI 3.1 | | /docs/api/create-campaigns.md | Markdown | 来源 · [数据来源](https://adsly.pro/docs/api/ai-assistants/) ## 相关阅读 [开发者文档](/zh/docs/)[API 快速入门](/zh/docs/api/)[密钥与账户权限](/zh/docs/api/authentication/) 参考资料更新日期 2026-10-08 [上一主题**密钥与账户权限**](/zh/docs/api/authentication/)[下一主题**解读 API 错误**](/zh/docs/api/errors/) ## 来源与数据 - [openapi.json](https://orbitoads.pro/docs/api/openapi.json) --- # 密钥与账户权限 [Orbito Ads · 简体中文 · HTML](https://orbitoads.pro/zh/docs/api/authentication/) 来源核对日期 · 2026-11-27 ### 浏览文档 [全部文档](/zh/docs/) 快速入门 - [API 快速入门](/zh/docs/api/) - [密钥与账户权限](/zh/docs/api/authentication/) - [将 API 文档交给 AI 助手](/zh/docs/api/ai-assistants/) 基础概念 - [解读 API 错误](/zh/docs/api/errors/) - [请求和事件限额](/zh/docs/api/rate-limits/) - [安全重试同一操作](/zh/docs/api/idempotency/) - [跟踪排队中的操作](/zh/docs/api/tasks/) - [逐页读取广告活动](/zh/docs/api/pagination/) API 参考 - [可访问的广告账户](/zh/docs/api/accounts/) - [查询广告活动](/zh/docs/api/campaigns/) - [创建广告活动与上传媒体](/zh/docs/api/create-campaigns/) - [修改现有广告活动](/zh/docs/api/manage-campaigns/) - [广告活动与账户统计](/zh/docs/api/stats/) - [定向词典与群组](/zh/docs/api/targeting/) 集成 - [接收广告活动事件](/zh/docs/api/webhooks/) - [发送已确认的转化](/zh/docs/api/conversions/) - [API 版本与更新](/zh/docs/api/changelog/) 文件与架构 - [OpenAPI · YAML](/docs/api/openapi.yaml) - [OpenAPI · JSON](/docs/api/openapi.json) - [llms.txt](/zh/docs/llms.txt) - [llms-full.txt](/zh/docs/llms-full.txt) [全部文档](/zh/docs/) 快速入门 - [API 快速入门](/zh/docs/api/) - [密钥与账户权限](/zh/docs/api/authentication/) - [将 API 文档交给 AI 助手](/zh/docs/api/ai-assistants/) 基础概念 - [解读 API 错误](/zh/docs/api/errors/) - [请求和事件限额](/zh/docs/api/rate-limits/) - [安全重试同一操作](/zh/docs/api/idempotency/) - [跟踪排队中的操作](/zh/docs/api/tasks/) - [逐页读取广告活动](/zh/docs/api/pagination/) API 参考 - [可访问的广告账户](/zh/docs/api/accounts/) - [查询广告活动](/zh/docs/api/campaigns/) - [创建广告活动与上传媒体](/zh/docs/api/create-campaigns/) - [修改现有广告活动](/zh/docs/api/manage-campaigns/) - [广告活动与账户统计](/zh/docs/api/stats/) - [定向词典与群组](/zh/docs/api/targeting/) 集成 - [接收广告活动事件](/zh/docs/api/webhooks/) - [发送已确认的转化](/zh/docs/api/conversions/) - [API 版本与更新](/zh/docs/api/changelog/) 文件与架构 - [OpenAPI · YAML](/docs/api/openapi.yaml) - [OpenAPI · JSON](/docs/api/openapi.json) - [llms.txt](/zh/docs/llms.txt) - [llms-full.txt](/zh/docs/llms-full.txt) [Orbito Ads](/zh/) [文档](/zh/docs/) [API](/zh/docs/api/) 从服务端通过 X-API-Key 请求头传递密钥。可授权单个、多个或全部可用账户。写入还需密钥具有管理权限,且持有人为账户管理者或所有者。 [Markdown](/zh/docs/api/authentication.md) ## 传递密钥 每次请求都通过 HTTP 请求头发送 API 密钥。 示例 ``` X-API-Key: orb_0f3c… (共 68 个字符:orb_ 前缀加 64 个十六进制字符) ``` 直接使用密钥认证,无需 OAuth 流程或令牌交换。密钥应保存在服务器端,不要打包进浏览器代码或移动应用。 ## 获取密钥 在面板的“API 与 Webhook”中选择“新建密钥”。Pro 和 Agency 套餐支持每人最多 5 个有效密钥。密钥仅在创建时显示一次,服务端只保存其 SHA-256 哈希值。遗失后请撤销旧密钥并创建新密钥。 ## 密钥权限 | 许可 | 怎样得到它 | 它允许什么 | | --- | --- | --- | | **阅读** | 每一个钥匙 | 运动、统计、转换、任务、目标代码、网络呼克、向我们发送转换 | | **管理活动** | 勾选 **允许管理活动** 当您创建密钥时, 或者在密钥卡的后期切换 | 阅读中的所有内容, 加上创建、 编辑、 暂停/ 重置、 预算、 复制、 批量动作、 删除、 媒体上传 | 只读密钥调用写入接口会收到 `403 READ_ONLY_KEY`。报表和看板适合使用只读密钥,仅向可信的广告管理程序授予写权限。两类密钥都只能在账户余额与其广告活动之间调拨预算,无法提现。 写入时会检查当前的 Pro 或 Agency 套餐,以及面板中此功能的权限。套餐不支持时返回 `403 FEATURE_NOT_AVAILABLE`。 ## 密钥可访问的账户 创建密钥时,请选择它有权访问的广告账户。 | 权限范围 | 密钥到达 | | --- | --- | | 我所有的柜子( 默认) | 在面板上可以打开的每个柜子,包括后面添加的柜子 | | 多种 | 你抽查过的柜子 | | 1 广告账户 | 仅存的柜子 | 只有**微笑** 的镜面才能打开面板——它永远不会拓宽它。每一次请求都要重新检查它:当您无法进入一个柜子时,您的钥匙会在同一时刻丢失。`GET /v1/account/info`总是准确列出钥匙现在到达的地方。 当密钥可访问多个账户,而请求只操作其中一个时,请传入 `account_id`。缺少该字段会返回 `400 ACCOUNT_ID_REQUIRED`。 ## 代理机构与团队成员的访问权限 API 访问权限与您在面板上的访问权限, 内阁: | 你是谁 | 柜子,你的钥匙 | 能够管理在以下领域的运动: | | --- | --- | --- | | 账户所有者(经常用户) | 自己的橱柜 | 所有这些 | | Agency 车主 | 您的个人和代理内阁 | 所有这些 | | Agency名小组成员 | 与您共享的内阁 | 与**管理员** 次访问共用的柜子;**观察员** 次只读的柜子 | - 团队成员在自己的**API 和 Webhooks** 页上创建自己的钥匙,该机构的计划涵盖这些钥匙。 - 机构所有人看到**API 网页 > 团队 > 团队** 所创立的小组的每一个关键——它是谁的,它是否能够管理广告活动,它能到达多少个柜子,在它最后被使用的时候——并且可以撤销其中的任何一个. - `GET /v1/account/info`回每柜`access_level`回:`owner`回,`manager`回或`viewer`回. `viewer`回一册回回`403 VIEW_ONLY_ACCESS`回. - 如果所有者移除一个成员,将他们降格为Viewer,或者代理计划结束,则成员的密钥会立即跟进——没有什么可以手取而代之. 这些角色在小组中的含义是:**管理员** — — 该内阁中完全的广告活动管理;**观察员** — — 广告活动和统计。 业主还可以让成员加入内阁,邀请队友或分享自己的内阁(从未超过自己的级别 ) 。 ## 撤销与轮换密钥 - **回归** 在面板上的卡片键,它立刻停止工作. - **旋转** = 创建新密钥,部署后再取消旧密钥,可一并活出两个密钥,因此没有停机时间. - **Webhook 秘密** 型(用于验证[网页](/zh/docs/api/webhooks/))与键相分离,可自行旋转. ## 安全存储密钥 - 每集成一个密钥,这样你就可以取消一个而不打破其他的. - 将密钥存储在环境变量或密钥管理器中。 永远不要将密钥粘贴在聊天或门票中 。 - 偏好只读键;仅在代码更改运动时才添加**管理活动** . - 将内阁的范围缩小为一体化需要。 - 如果钥匙可能漏出,那么首先撤销它,然后调查第二处。 通过API型机车所做的每一处改变都出现在广告活动史上,标有**🔌 API** 号的板块上。 ## 身份验证错误 | HTTP | `code` | 意义 | | --- | --- | --- | | 401 | `API_KEY_MISSING` | 无 `X-API-Key` 页眉 | | 401 | `API_KEY_INVALID` | 错误、 被撤销或过期的密钥 | | 401 | `NO_ACCOUNTS` | 键目前没有到达活动柜中 | | 403 | `READ_ONLY_KEY` | 写着没有管理运动的密钥 | | 403 | `VIEW_ONLY_ACCESS` | 写给作为查看器与您共享的柜子 | | 403 | `FEATURE_NOT_AVAILABLE` | 计划并未包含此行动 | | 403 | `WRITE_NOT_ALLOWED` | 这种密钥( 由 Orbito Ads 为合伙人发行) 无法写入 | 完整的状态码列表见“API [错误](/zh/docs/api/errors/)”。 完整广告接口需要为此工作区单独配置供应商凭据。客户端请求使用自己的 Orbito API 密钥。账户订购、开通和外部账单分别处理。 ## 实施说明 ## 连接工作区 完整广告接口需要为此工作区单独配置供应商凭据。客户端请求使用自己的 Orbito API 密钥。账户订购、开通和外部账单分别处理。 ## 密钥与账户权限 在服务端保管 X-API-Key。报表使用只读权限;写入需要广告管理权限、指定账户的所有者或经理角色,以及有效的功能套餐。 请求结果与响应字段 | API | HTTP | 含义 | | --- | --- | --- | | API_KEY_MISSING | 401 | 请通过 X-API-Key 请求头发送密钥。 | | API_KEY_INVALID | 401 | 密钥无效、已过期或已撤销。 | | NO_ACCOUNTS | 401 | 密钥目前无法访问任何活跃广告账户。 | | READ_ONLY_KEY | 403 | 此密钥只允许读取,写入广告活动需要管理权限。 | | VIEW_ONLY_ACCESS | 403 | Viewer 可查看该账户,修改则需要账户级写权限。 | | FEATURE_NOT_AVAILABLE | 403 | 当前套餐未包含此操作。 | | WRITE_NOT_ALLOWED | 403 | 服务商向合作伙伴签发的这类密钥不允许写入。 | [解读 API 错误](/zh/docs/api/errors/) ## 访问范围与撤销 供应商密钥可限定一个、多个或所有获准账户,每次调用核实范围。符合条件的套餐每人最多五个有效密钥。遗失时撤销密钥,webhook 密钥可单独轮换。 ## 操作与字段 X-API-Key read manage campaigns account_id - X-API-Key - read - manage campaigns - account_id ## 请求示例 GET /api/v1/account/info HTTP/1.1 Host: orbitoads.pro X-API-Key: {key} ## 结构字段与限制 本表依据公开的 v1 契约。参数与字段名称区分大小写。各操作的 HTTP 状态码分别表示成功、输入校验和访问检查。链接规范给出了完整的请求与响应结构。 ## 协议参考 | 方法 | 路径 | 参数 | 请求内容 | 响应码 | | --- | --- | --- | --- | --- | | GET | /api/v1/account/info | — | — | 200, 401, 429 | | GET | /api/v1/campaigns/{ad_id} | ad_id, account_id | — | 200, 400, 401, 404, 429 | | PATCH | /api/v1/campaigns/{ad_id} | ad_id, account_id | application/json · UpdateRequest | 200, 400, 401, 403, 404, 409, 429 | 来源 · [数据来源](https://adsly.pro/docs/api/openapi.yaml) ## 结构字段与限制 · 密钥与账户权限 | 字段 | 文档取值 | | --- | --- | | X-API-Key | HTTP header | | account_id | integer | | access_level | owner \| manager \| viewer | | cabinet_type | euro \| ton \| stars | 来源 · [数据来源](https://adsly.pro/docs/api/authentication/) ## Cabinet | 字段 | 字段类型 | | --- | --- | | id | integer | | name | string | | cabinet_type | euro \| ton \| stars | | is_active | boolean | | access_level | owner \| manager \| viewer \| admin | | currency | EUR \| TON \| STARS | | balance | Money | | balance_updated_at | string \| null · date-time | | min_budget | number | | features | object | 来源 · [数据来源](https://adsly.pro/docs/api/openapi.yaml) ## 相关阅读 [开发者文档](/zh/docs/)[API 快速入门](/zh/docs/api/)[将 API 文档交给 AI 助手](/zh/docs/api/ai-assistants/) 参考资料更新日期 2026-10-08 [上一主题**API 快速入门**](/zh/docs/api/)[下一主题**将 API 文档交给 AI 助手**](/zh/docs/api/ai-assistants/) ## 来源与数据 - [openapi.yaml](https://orbitoads.pro/docs/api/openapi.yaml) - [openapi.json](https://orbitoads.pro/docs/api/openapi.json) --- # 查询广告活动 [Orbito Ads · 简体中文 · HTML](https://orbitoads.pro/zh/docs/api/campaigns/) 来源核对日期 · 2026-11-27 ### 浏览文档 [全部文档](/zh/docs/) 快速入门 - [API 快速入门](/zh/docs/api/) - [密钥与账户权限](/zh/docs/api/authentication/) - [将 API 文档交给 AI 助手](/zh/docs/api/ai-assistants/) 基础概念 - [解读 API 错误](/zh/docs/api/errors/) - [请求和事件限额](/zh/docs/api/rate-limits/) - [安全重试同一操作](/zh/docs/api/idempotency/) - [跟踪排队中的操作](/zh/docs/api/tasks/) - [逐页读取广告活动](/zh/docs/api/pagination/) API 参考 - [可访问的广告账户](/zh/docs/api/accounts/) - [查询广告活动](/zh/docs/api/campaigns/) - [创建广告活动与上传媒体](/zh/docs/api/create-campaigns/) - [修改现有广告活动](/zh/docs/api/manage-campaigns/) - [广告活动与账户统计](/zh/docs/api/stats/) - [定向词典与群组](/zh/docs/api/targeting/) 集成 - [接收广告活动事件](/zh/docs/api/webhooks/) - [发送已确认的转化](/zh/docs/api/conversions/) - [API 版本与更新](/zh/docs/api/changelog/) 文件与架构 - [OpenAPI · YAML](/docs/api/openapi.yaml) - [OpenAPI · JSON](/docs/api/openapi.json) - [llms.txt](/zh/docs/llms.txt) - [llms-full.txt](/zh/docs/llms-full.txt) [全部文档](/zh/docs/) 快速入门 - [API 快速入门](/zh/docs/api/) - [密钥与账户权限](/zh/docs/api/authentication/) - [将 API 文档交给 AI 助手](/zh/docs/api/ai-assistants/) 基础概念 - [解读 API 错误](/zh/docs/api/errors/) - [请求和事件限额](/zh/docs/api/rate-limits/) - [安全重试同一操作](/zh/docs/api/idempotency/) - [跟踪排队中的操作](/zh/docs/api/tasks/) - [逐页读取广告活动](/zh/docs/api/pagination/) API 参考 - [可访问的广告账户](/zh/docs/api/accounts/) - [查询广告活动](/zh/docs/api/campaigns/) - [创建广告活动与上传媒体](/zh/docs/api/create-campaigns/) - [修改现有广告活动](/zh/docs/api/manage-campaigns/) - [广告活动与账户统计](/zh/docs/api/stats/) - [定向词典与群组](/zh/docs/api/targeting/) 集成 - [接收广告活动事件](/zh/docs/api/webhooks/) - [发送已确认的转化](/zh/docs/api/conversions/) - [API 版本与更新](/zh/docs/api/changelog/) 文件与架构 - [OpenAPI · YAML](/docs/api/openapi.yaml) - [OpenAPI · JSON](/docs/api/openapi.json) - [llms.txt](/zh/docs/llms.txt) - [llms-full.txt](/zh/docs/llms-full.txt) [Orbito Ads](/zh/) [文档](/zh/docs/) [API](/zh/docs/api/) 可按状态或目标链接过滤列表,也可读取单项活动和历史记录。不同账户的广告 ID 可能相同,定位时需同时使用 account_id 与 ad_id。 [Markdown](/zh/docs/api/campaigns.md) 在 API 中,一项广告活动对应一条 Telegram 广告。请用 `(account_id, ad_id)` 标识;不同账户可能重复使用同一 `ad_id`。 ## 广告活动对象字段 `GET /v1/campaigns/{ad_id}` 返回 : 示例 ``` { "ad_id": 90412, "account_id": 53, "title": "API test", "text": "Join the channel for daily market notes", "status": "Active", "active": true, "promote_url": "https://t.me/yourchannel", "tme_path": "yourchannel", "target_type": "channels", "targets": ["durov"], "cpm": "1.50", "budget": "3.54100", "spent": "1.45900", "daily_budget": null, "views": 1043, "opens": 0, "clicks": 12, "actions": 4, "ctr": "1.15", "cvr": "33.33", "cpc": "0.1215833333", "cpa": "0.3647500000", "views_per_user": 1, "schedule": { "days": { "mon": [9, 10, 11, 12, 13, 14, 15, 16, 17], "tue": [9, 10, 11, 12, 13, 14, 15, 16, 17], "wed": [9, 10, 11, 12, 13, 14, 15, 16, 17], "thu": [9, 10, 11, 12, 13, 14, 15, 16, 17], "fri": [9, 10, 11, 12, 13, 14, 15, 16, 17], "sat": [], "sun": [] }, "timezone": "+03:00" }, "has_media": false, "media_type": null, "button": null, "website_name": null, "group_id": 7, "auto_cpm_enabled": false, "date": "1791364800", "synced_at": "2026-10-08T10:29:41.000Z", "status_changed_at": "2026-10-08T10:31:07.112Z" } ``` | 田野 | 意义 | | --- | --- | | `title` | 你的广告内部名字。 | | `text` | 广告短信人们看到。 | | `status` | Telegram正在做的广告——见[状态](/zh/docs/api/campaigns/#doc-note-statuses). | | `active` | 你要求的:`true`=应该运行. `active: true`和`Stopped`状态的广告活动一旦再次获得预算,即恢复. | | `promote_url` / `tme_path` | 广告内容包括:网站URL,或`t.me/`链接(频道,bot,迷你应用,帖子). | | `target_type` | `channels`,`bots`,`search`或`users` —见[创建活动](/zh/docs/api/create-campaigns/). | | `targets` | 用户名称为广告目标(频道或bots),当知道时。 | | `cpm` | 每1000次观看,在广告账户的货币中。 | | `budget` | **左** 钱在广告活动中。 `budget + spent` 是它得到的一切。 | | `spent` | 至今所花之钱. | | `daily_budget` | 每日开支上限,如果设置了的话。 | | `views`, `clicks`, `actions`, `opens` | 生活计数器. `actions`是平台动作(joins,bot start)——而不是你的转换;对于那些,参见[转换](/zh/docs/api/conversions/). | | `ctr`, `cvr` | 百分比:`"1.15"`意味着1.15%。 | | `cpc`, `cpa` | 每点击一次和每起行动的费用。 | | `views_per_user` | 一个人能看多少次广告(1–4). | | `schedule` | 周日与时日广告显示,或`null` — 它全天候运行。见[时间表](/zh/docs/api/manage-campaigns/#doc-note-schedule) 。 | | `group_id` | 广告活动团体在小组中, | | `auto_cpm_enabled` | Orbito Ads的CPM号汽车管理出价. | | `date` | 当广告创建时:unix秒,作为字符串. | | `status_changed_at` | 最后地位变化:不受最新数据的影响——对“此后的变化”有利。 | | `synced_at` | 当广告本身的设置——`schedule`,`text`,`views_per_user`,目标设定——最后从Telegram读取. 见[新鲜](/zh/docs/api/campaigns/#doc-heading-freshness). | **金钱领域是十字线** (`cpm`,`budget`,`spent`,`ctr`,`cvr`,`cpc`,`cpa`)所以十进制不变,计数器(`views`,`clicks`,`actions`,`opens`)都是数字,所有的钱都在内阁的货币中(参见[广告账户](/zh/docs/api/accounts/)). ## 状态 | 状态 | 意义 | 做你该做的 | | --- | --- | --- | | `Active` | 跑步。 | 暂停,变更出价,增加预算. | | `In Review` | 等待Telegram的检讨;尚未显示. | 等等,一个网友告诉你,当它改变。 | | `Declined` | Telegram拒绝了该广告. | 编辑文本或链接(重新提交),或创建新的文本或链接。 | | `On Hold` | 关机了——由你或自动化规则。 | 回复。 | | `Stopped` | 预算用光了。 | 增加预算;如果`active`是`true`,则再次运行。 | | `Paused` | 全柜被Telegram停用(稀有). | 联系[@orbitoads](https://t.me/orbitoads) | | `Deleted` | 被删除,在历史中保存,隐藏在列表中. | — | ## GET /v1/campaigns 每个内阁的广告活动都是关键所在。 示例 ``` curl -s "https://orbitoads.pro/api/v1/campaigns?account_id=53&status=Active,On%20Hold&limit=100&cursor=" \ -H "X-API-Key: $ORBITO_API_KEY" ``` | 参数 | 默认 | 意义 | | --- | --- | --- | | `account_id` | — | 只有这个柜子(`accountId`也有效. ) | | `status` | 全部删除 | 一个或几个状态,逗号分隔. | | `title` | — | 标题载有本案文。 | | `bot_username` | — | 一个bot或通道的广告:匹配`tme_path`中的用户名,大小写不敏感,编号为`@`. `foo`不匹配`foobar`. | | `promote_domain` | — | 链接在这个主机上的网站广告。 接受`example.com`或一个完整的URL; `www.`, 方案, 路径和端口被忽略 。 | | `promote_domain_mode` | `exact` | `suffix`也匹配子域(`x.example.com`). | | `type` | — | `bot` (机器人和微型应用程序),`channel`(频道,组,站)或`site`(外部网站). | | `limit` | 100 | 1–500. | | `cursor` | — | 铺设-见[页面](/zh/docs/api/pagination/). 建议。 | | `offset`, `sortBy`, `sortOrder` | — | 抵消平面图(每柜500美元)。 | 过滤器与 AND 结合。 一个未知的bot 或域返回一个空列表,而不是错误 。 示例 ``` { "success": true, "data": [ { "ad_id": 90412, "account_id": 53, "title": "API test", "text": "…", "status": "Active", "tme_path": "yourchannel", "promote_url": null, "views": 1043, "opens": 0, "clicks": 12, "actions": 4, "spent": "1.45900", "budget": "3.54100", "cpm": "1.50", "cpc": "0.12", "cpa": "0.36", "ctr": "1.15", "cvr": "33.33", "date": "1791364800", "group_id": 7, "status_changed_at": "2026-10-08T10:31:07.112Z" } ], "meta": { "limit": 100, "cursor": null, "next_cursor": null, "hasMore": false } } ``` ## 获取单个广告活动 `GET /v1/campaigns/{ad_id}` — 上面的全部对象,包括瞄准,创意字段和`schedule`(列表终点将那些留作快速停留). 已删除的战役也被还原,有`status: "Deleted"`. 示例 ``` curl -s "https://orbitoads.pro/api/v1/campaigns/90412?account_id=53" -H "X-API-Key: $ORBITO_API_KEY" ``` `account_id`只有在你几个柜子里存在同样的`ad_id`时才需要(`400 ACCOUNT_ID_REQUIRED`告诉你). ### 新鲜 每一场运动的柜台和状态每时每刻都在刷新。广告本身的设置 — — `schedule`,`text`,`views_per_user` — — 目标来自阅读广告本身,所以: - `GET /v1/campaigns/{ad_id}`在回答之前从Telegram重新读取了这个广告,因为我们的复制时间已经超过**5分钟** 年。 Telegram年的广告界面中有人直接做了改动,就出现在了窗外。 - 活动活动(`Active`, `In Review`, `On Hold`此外,在背景下每3小时都会重新阅读。 - 通过Orbito Ads——面板或这API——所作的修改,一并抄入. 如果Telegram没有及时回答,你就能拿到存储的拷贝;`synced_at`告诉你它多大了. ## GET /v1/campaigns/{ad_id}/history 一个运动的总数在一段时间内——一个总数,而不是一个小时的分数。 示例 ``` curl -s "https://orbitoads.pro/api/v1/campaigns/90412/history?account_id=53&period=7d" -H "X-API-Key: $ORBITO_API_KEY" ``` 示例 ``` { "success": true, "data": { "views": 640, "clicks": 7, "spent": 0.96, "ctr": 1.09, "cpm": 1.5, "cpa": 0.32 }, "meta": { "adId": 90412, "accountId": 53, "period": "7d" } } ``` `period`:`24h`(默认),`7d`,`30d`或`custom`,有`startDate`/`endDate`(`YYYY-MM-DD`,UTC)和可选的`startHour`/`endHour`(0–23). 该时期没有数据~`404 NOT_FOUND`. ## 同步本地副本 1. 页面通过`GET /v1/campaigns?cursor=`,上升由`(account_id, ad_id)`. 2. 订阅[网页](/zh/docs/api/webhooks/),用于状态变化和小时统计,而不是每分钟投票. 3. 一天一次重新同步 捕捉到任何被网友错过的东西 ## API 参考 完整广告接口需要为此工作区单独配置供应商凭据。客户端请求使用自己的 Orbito API 密钥。账户订购、开通和外部账单分别处理。 ## GET `/api/v1/campaigns` 按筛选条件分页读取广告列表。 | 参数 | 位置 | 格式 | 必填 | | --- | --- | --- | --- | | `account_id` | query | `integer` | — | | `status` | query | `string` | — | | `title` | query | `string` | — | | `bot_username` | query | `string` | — | | `promote_domain` | query | `string` | — | | `promote_domain_mode` | query | `string` | — | | `type` | query | `string` | — | | `limit` | query | `integer` | — | | `cursor` | query | `string` | — | | `offset` | query | `integer` | — | | `sortBy` | query | `string` | — | | `sortOrder` | query | `string` | — | | `X-API-Key` | header | `string` | 是 | cURL ``` curl -X GET 'https://orbitoads.pro/api/v1/campaigns?account_id=7401&status=Active%2COn+Hold&limit=25&cursor=' \ -H 'X-API-Key: YOUR_ORBITO_KEY' ``` HTTP 200 ``` { "success": true, "data": [ { "ad_id": 38017, "account_id": 7401, "title": "Conversation club · November", "text": "See this month’s language club schedule.", "status": "Active", "tme_path": null, "promote_url": "https://school.example/club", "views": 3200, "opens": 0, "clicks": 32, "actions": 4, "spent": "4.00", "budget": "36.00", "cpm": "1.25", "cpc": "0.125", "cpa": "1.00", "ctr": "1.00", "cvr": "12.50", "date": "1793620800", "group_id": 516, "status_changed_at": "2026-11-03T12:00:00Z" } ], "meta": { "limit": 25, "cursor": null, "next_cursor": null, "hasMore": false } } ``` ## GET `/api/v1/campaigns/{ad_id}` 获取单条广告的定向、素材与时段安排。 | 参数 | 位置 | 格式 | 必填 | | --- | --- | --- | --- | | `ad_id` | path | `integer` | 是 | | `account_id` | query | `integer` | — | | `X-API-Key` | header | `string` | 是 | cURL ``` curl -X GET 'https://orbitoads.pro/api/v1/campaigns/38017?account_id=7401' \ -H 'X-API-Key: YOUR_ORBITO_KEY' ``` HTTP 200 ``` { "success": true, "data": { "account_id": 7401, "ad_id": 38017, "title": "Conversation club · November", "text": "See this month’s language club schedule.", "status": "Active", "active": true, "promote_url": "https://school.example/club", "tme_path": null, "target_type": "users", "targets": [], "cpm": "1.25", "budget": "36.00", "spent": "4.00", "daily_budget": "8.00", "views": 3200, "opens": 0, "clicks": 32, "actions": 4, "ctr": "1.00", "cvr": "12.50", "cpc": "0.125", "cpa": "1.00", "views_per_user": 2, "schedule": null, "has_media": false, "media_type": null, "button": "learn_more", "website_name": "Example language school", "group_id": 516, "auto_cpm_enabled": false, "date": "1793620800", "synced_at": "2026-11-03T12:00:00Z", "status_changed_at": "2026-11-03T12:00:00Z" } } ``` ## GET `/api/v1/campaigns/{ad_id}/history` 读取一条广告在日期或小时范围内的汇总指标。 | 参数 | 位置 | 格式 | 必填 | | --- | --- | --- | --- | | `ad_id` | path | `integer` | 是 | | `account_id` | query | `integer` | — | | `period` | query | `string` | — | | `startDate` | query | `string` | — | | `endDate` | query | `string` | — | | `startHour` | query | `integer` | — | | `endHour` | query | `integer` | — | | `X-API-Key` | header | `string` | 是 | cURL ``` curl -X GET 'https://orbitoads.pro/api/v1/campaigns/38017/history?account_id=7401&period=7d' \ -H 'X-API-Key: YOUR_ORBITO_KEY' ``` HTTP 200 ``` { "success": true, "data": { "views": 3200, "clicks": 32, "actions": 4, "spent": 4, "ctr": 1, "cpm": 1.25, "cpa": 1 }, "meta": { "adId": 38017, "accountId": 7401, "period": "7d" } } ``` ## 实施说明 ## 账户与广告标识 联合保存 account_id 和 ad_id。不同账户可能重复使用同一 ad_id。密钥可访问多个账户时请传入 account_id 选定记录。 ## 筛选与状态 筛选条件按 AND 合并,status 可传逗号分隔值。列表默认省略 Deleted,详情仍可返回。active 为期望投放状态,status 为平台实际状态。 ## 操作与字段 GET /api/v1/campaigns GET /api/v1/campaigns/{ad_id} GET /api/v1/campaigns/{ad_id}/history account_id ad_id - GET /api/v1/campaigns - GET /api/v1/campaigns/{ad_id} - GET /api/v1/campaigns/{ad_id}/history - account_id - ad_id ## 请求示例 GET /api/v1/campaigns?account_id={account_id}&status=Active&limit=25&cursor= HTTP/1.1 Host: orbitoads.pro X-API-Key: {key} ## 结构字段与限制 本表依据公开的 v1 契约。参数与字段名称区分大小写。各操作的 HTTP 状态码分别表示成功、输入校验和访问检查。链接规范给出了完整的请求与响应结构。 ## 协议参考 | 方法 | 路径 | 参数 | 请求内容 | 响应码 | | --- | --- | --- | --- | --- | | GET | /api/v1/campaigns | account_id, status, title, bot_username, promote_domain, promote_domain_mode, type, limit, cursor, offset, sortBy, sortOrder | — | 200, 400, 401, 404, 429 | | GET | /api/v1/campaigns/{ad_id} | ad_id, account_id | — | 200, 400, 401, 404, 429 | | GET | /api/v1/campaigns/{ad_id}/history | ad_id, account_id, period, startDate, endDate, startHour, endHour | — | 200, 400, 401, 404 | 来源 · [数据来源](https://adsly.pro/docs/api/openapi.yaml) ## 结构字段与限制 · 查询广告活动 | 字段 | 文档取值 | | --- | --- | | account_id + ad_id | integer + integer | | promote_domain_mode | exact \| suffix | | type | bot \| channel \| site | | sortOrder | ASC \| DESC | | status | Active \| In Review \| Declined \| On Hold \| Stopped \| Paused \| Deleted | 来源 · [数据来源](https://adsly.pro/docs/api/campaigns/) ## CampaignListItem | 字段 | 字段类型 | | --- | --- | | ad_id | integer | | account_id | integer | | title | string | | text | string \| null | | status | CampaignStatus | | tme_path | string \| null | | promote_url | string \| null | | views | integer | | opens | integer | | clicks | integer | | actions | integer | | spent | Money | | budget | Money | | cpm | Money | | cpc | Money | | cpa | Money | | ctr | string \| null | | cvr | string \| null | | date | string \| null | | group_id | integer \| null | | status_changed_at | string \| null · date-time | 来源 · [数据来源](https://adsly.pro/docs/api/openapi.yaml) ## Campaign | 字段 | 字段类型 | | --- | --- | | ad_id | integer | | account_id | integer | | title | string | | text | string \| null | | status | CampaignStatus | | active | boolean | | promote_url | string \| null | | tme_path | string \| null | | target_type | channels \| bots \| search \| users \| | | targets | array · [string] | | cpm | Money | | budget | Money | | spent | Money | | daily_budget | number \| string \| null | | views | integer | | opens | integer | | clicks | integer | | actions | integer | | ctr | string \| null | | cvr | string \| null | | cpc | Money | | cpa | Money | | views_per_user | integer \| null | | schedule | Schedule | | has_media | boolean | | media_type | image \| video \| | | button | string \| null | | website_name | string \| null | | group_id | integer \| null | | auto_cpm_enabled | boolean | | date | string \| null | | synced_at | string \| null · date-time | | status_changed_at | string \| null · date-time | 来源 · [数据来源](https://adsly.pro/docs/api/openapi.yaml) ## CampaignStatus | 字段 | 字段类型 | | --- | --- | | CampaignStatus | Active \| In Review \| Declined \| On Hold \| Stopped \| Paused \| Deleted | 来源 · [数据来源](https://adsly.pro/docs/api/openapi.yaml) ## 相关阅读 [可访问的广告账户](/zh/docs/api/accounts/)[创建广告活动与上传媒体](/zh/docs/api/create-campaigns/)[修改现有广告活动](/zh/docs/api/manage-campaigns/)[广告活动与账户统计](/zh/docs/api/stats/)[定向词典与群组](/zh/docs/api/targeting/) 参考资料更新日期 2026-10-08 [上一主题**可访问的广告账户**](/zh/docs/api/accounts/)[下一主题**创建广告活动与上传媒体**](/zh/docs/api/create-campaigns/) ## 来源与数据 - [openapi.yaml](https://orbitoads.pro/docs/api/openapi.yaml) - [openapi.json](https://orbitoads.pro/docs/api/openapi.json) --- # API 版本与更新 [Orbito Ads · 简体中文 · HTML](https://orbitoads.pro/zh/docs/api/changelog/) 来源核对日期 · 2026-11-27 ### 浏览文档 [全部文档](/zh/docs/) 快速入门 - [API 快速入门](/zh/docs/api/) - [密钥与账户权限](/zh/docs/api/authentication/) - [将 API 文档交给 AI 助手](/zh/docs/api/ai-assistants/) 基础概念 - [解读 API 错误](/zh/docs/api/errors/) - [请求和事件限额](/zh/docs/api/rate-limits/) - [安全重试同一操作](/zh/docs/api/idempotency/) - [跟踪排队中的操作](/zh/docs/api/tasks/) - [逐页读取广告活动](/zh/docs/api/pagination/) API 参考 - [可访问的广告账户](/zh/docs/api/accounts/) - [查询广告活动](/zh/docs/api/campaigns/) - [创建广告活动与上传媒体](/zh/docs/api/create-campaigns/) - [修改现有广告活动](/zh/docs/api/manage-campaigns/) - [广告活动与账户统计](/zh/docs/api/stats/) - [定向词典与群组](/zh/docs/api/targeting/) 集成 - [接收广告活动事件](/zh/docs/api/webhooks/) - [发送已确认的转化](/zh/docs/api/conversions/) - [API 版本与更新](/zh/docs/api/changelog/) 文件与架构 - [OpenAPI · YAML](/docs/api/openapi.yaml) - [OpenAPI · JSON](/docs/api/openapi.json) - [llms.txt](/zh/docs/llms.txt) - [llms-full.txt](/zh/docs/llms-full.txt) [全部文档](/zh/docs/) 快速入门 - [API 快速入门](/zh/docs/api/) - [密钥与账户权限](/zh/docs/api/authentication/) - [将 API 文档交给 AI 助手](/zh/docs/api/ai-assistants/) 基础概念 - [解读 API 错误](/zh/docs/api/errors/) - [请求和事件限额](/zh/docs/api/rate-limits/) - [安全重试同一操作](/zh/docs/api/idempotency/) - [跟踪排队中的操作](/zh/docs/api/tasks/) - [逐页读取广告活动](/zh/docs/api/pagination/) API 参考 - [可访问的广告账户](/zh/docs/api/accounts/) - [查询广告活动](/zh/docs/api/campaigns/) - [创建广告活动与上传媒体](/zh/docs/api/create-campaigns/) - [修改现有广告活动](/zh/docs/api/manage-campaigns/) - [广告活动与账户统计](/zh/docs/api/stats/) - [定向词典与群组](/zh/docs/api/targeting/) 集成 - [接收广告活动事件](/zh/docs/api/webhooks/) - [发送已确认的转化](/zh/docs/api/conversions/) - [API 版本与更新](/zh/docs/api/changelog/) 文件与架构 - [OpenAPI · YAML](/docs/api/openapi.yaml) - [OpenAPI · JSON](/docs/api/openapi.json) - [llms.txt](/zh/docs/llms.txt) - [llms-full.txt](/zh/docs/llms-full.txt) [Orbito Ads](/zh/) [文档](/zh/docs/) [API](/zh/docs/api/) 版本位于 API 路径中。客户端应能处理新增字段和枚举值。2026 年 10 月的更新涵盖投放排期、管理操作及期间汇总。 [Markdown](/zh/docs/api/changelog.md) ## API 版本 该版本在路径:`/api/v1`。在`v1`之内,我们只做了**添加剂** 个修改: | 添加( 随时可能发生) | 断开( 仅在新版本中) | | --- | --- | | 新终点 | 删除或重命名一个终点或字段 | | 新可选请求字段 | 需要新建的字段 | | 新反应领域 | 更改字段的类型或含义 | | enums中的新值( `status`, 错误 `code`) | 删除 enum 值 | | 新错误代码 | 无效的有效请求 | 因此,请给客户写**忽略他们不了解的领域** 和**处理未知的 enum 值和错误代码** 的优雅信息。 一次突破性改变会以`/api/v2`的船位,首先在这里宣布,`v1`一直在同时运行。 ## 更新记录 ### 2026-10-26年——期间合计. - **新:** 每`topCampaigns`行[`GET /v1/stats/analytics`](/zh/docs/api/stats/#doc-note-get-v1statsanalytics)行搭载了`cpm`——在此期间每1000个取景地花费了`cpc`和`cpa`相邻. - **修复:** 个一到两天的窗口现在正好等于同一个距离。 午夜后的第一分钟(UTC)曾经从这些窗口中跳出,所以一天的距离就低了1–2 % ; 三天和多的距离已经对了,而且没有改变。 - **修复:** 窗口长达两天, 开始于29多天后返回零; 它现在返回当天的数字 。 ### 2026-10-08-广告时间表. - **新: `schedule`** — 只在选定的工作日和工作时段进行广告活动。 设定为创建, `PATCH /v1/campaigns/{ad_id}` , 复制, 或随批量动作**set_schedule** 同时进行许多广告活动; `null`将其删除。 `GET /v1/campaigns/{ad_id}` 返回。 格式: [时间表](/zh/docs/api/manage-campaigns/#doc-note-schedule) 。 它不会打开或关闭广告活动。 - 暂停、恢复和编辑一项运动,保留其时间表;复制和重新制作的运动继承它。 - **修复:** `PATCH /v1/campaigns/{ad_id}`,只有`cpm`,`active`和/或`schedule`将广告活动结果退回到Telegram的检讨中去,这些现在都经过了Telegram自己的出价和状况表,从不触发检讨;其他领域仍然如此(Telegram的规则)——参见[编辑](/zh/docs/api/manage-campaigns/#doc-note-edit). - **修复:** 在没有预算的情况下制定广告活动时间表,可以将其送回检讨。 这一运动现在以`param: "schedule"`回答`400`, 并且没有受到任何影响 — — 先增加预算,然后确定日程。 - **`GET /v1/campaigns/{ad_id}` 现在是当前的:** 它从Telegram重新读取了我们的复制时间超过5分钟的广告,所以`schedule`,`text`和`views_per_user`直接反映了Telegram的修改. New field **synced_at** 说广告是上次读取时,参见[新鲜](/zh/docs/api/campaigns/#doc-heading-freshness). ### 2026-10-08-运动管理. - **新:写入访问。** 键可以现在携带**管理活动** 键:`POST /v1/campaigns`(创建,每通呼叫最多可达100),`PATCH /v1/campaigns/{ad_id}`,`POST …/pause`,`…/resume`,`…/budget`,`…/copy`,`POST /v1/campaigns/bulk`,`DELETE /v1/campaigns/{ad_id}`,`POST /v1/media` 键可保持只读,直到开通. - **新读者:** `GET /v1/campaigns/{ad_id}`(一次有目标的运动),`GET /v1/tasks/{id}`,`GET /v1/groups`,`GET /v1/targeting`。 - **公司团队成员** 可以创建密钥;一个密钥到达与成员共享的柜子,在他们的访问级别上. 机构所有者看到所有的团队密钥(API & Webhooks ~ Team密钥),可以撤销. - **Idempotency-Key** 需要用于创建、复制、批量和预算。 - 每分钟**单独写字率限制:** 个30个请求,除了60个读数之外. - **`GET /v1/account/info`** 又增加了`access_level`,`currency`,`balance`,`balance_updated_at`,`min_budget`,`features`. - **错误** 在未修改的`error`文本旁边加上了`code`和`request_id`. A`500`不再包括内部出错文本. - `account_id`在`accountId`的任何地方被接受(两者都是工作)。 - **修复:** `GET /v1/stats?period=all` 每点击一次返回成本为`cpa`;现在是每起行动的成本,与其他期间一样。 ### 2026-10-04 - URL过滤器适用于两个webhooks;`status_change`只到达其所有者能看见柜子的密钥. ### 2026-09-18 - 转会除读取限制外,还可得到自己的预算(20个活动/s);分批最多可达1000个活动. ### 2026-06-30 - 出入境转换:`POST /v1/postback`,`GET /v1/ingest/{token}`,`GET /v1/conversions`. ### 早期 - `GET /v1/campaigns` 有光标平面和`bot_username`,`promote_domain`和`type`等滤波器;统计端点;`status_change`和`hourly_digest`网点. 完整广告接口需要为此工作区单独配置供应商凭据。客户端请求使用自己的 Orbito API 密钥。账户订购、开通和外部账单分别处理。 ## 实施说明 ## 路径版本 本契约使用 /api/v1。兼容更新可加入可选字段、端点、枚举值和错误码。客户端应保留未知状态,并忽略未使用的响应字段。 ## 需要关注的变更 当前支持每周排期、按账户写入广告及 topCampaigns 中的 CPM。改变字段类型、移除字段或新增必填输入属于破坏性变更,需使用新版本。 ## 操作与字段 /api/v1 2026-10-26 2026-10-08 2026-10-04 2026-09-18 2026-06-30 - /api/v1 - 2026-10-26 - 2026-10-08 - 2026-10-04 - 2026-09-18 - 2026-06-30 ## 请求示例 GET /api/v1/stats/total?period=30d HTTP/1.1 Host: orbitoads.pro X-API-Key: {key} ## 结构字段与限制 本表依据公开的 v1 契约。参数与字段名称区分大小写。各操作的 HTTP 状态码分别表示成功、输入校验和访问检查。链接规范给出了完整的请求与响应结构。 ## 协议参考 | 方法 | 路径 | 参数 | 请求内容 | 响应码 | | --- | --- | --- | --- | --- | | GET | /api/v1/stats/total | period, startDate, endDate, startHour, endHour | — | 200, 401, 429 | | PATCH | /api/v1/campaigns/{ad_id} | ad_id, account_id | application/json · UpdateRequest | 200, 400, 401, 403, 404, 409, 429 | | POST | /api/v1/campaigns/bulk | Idempotency-Key | application/json · BulkRequest | 202, 400, 401, 403, 404, 409, 422, 429 | 来源 · [数据来源](https://adsly.pro/docs/api/openapi.yaml) ## 结构字段与限制 · API 版本与更新 | 字段 | 文档取值 | | --- | --- | | 2026-10-26 | GET /api/v1/stats/total | | 2026-10-08 | schedule | | 2026-10-08 | create, edit, copy, pause, resume, bulk | | OpenAPI | 3.1.0 | 来源 · [数据来源](https://adsly.pro/docs/api/changelog/) ## 相关阅读 [接收广告活动事件](/zh/docs/api/webhooks/)[发送已确认的转化](/zh/docs/api/conversions/) 参考资料更新日期 2026-10-26 [上一主题**发送已确认的转化**](/zh/docs/api/conversions/) ## 来源与数据 - [openapi.yaml](https://orbitoads.pro/docs/api/openapi.yaml) - [openapi.json](https://orbitoads.pro/docs/api/openapi.json) --- # 发送已确认的转化 [Orbito Ads · 简体中文 · HTML](https://orbitoads.pro/zh/docs/api/conversions/) 来源核对日期 · 2026-11-27 ### 浏览文档 [全部文档](/zh/docs/) 快速入门 - [API 快速入门](/zh/docs/api/) - [密钥与账户权限](/zh/docs/api/authentication/) - [将 API 文档交给 AI 助手](/zh/docs/api/ai-assistants/) 基础概念 - [解读 API 错误](/zh/docs/api/errors/) - [请求和事件限额](/zh/docs/api/rate-limits/) - [安全重试同一操作](/zh/docs/api/idempotency/) - [跟踪排队中的操作](/zh/docs/api/tasks/) - [逐页读取广告活动](/zh/docs/api/pagination/) API 参考 - [可访问的广告账户](/zh/docs/api/accounts/) - [查询广告活动](/zh/docs/api/campaigns/) - [创建广告活动与上传媒体](/zh/docs/api/create-campaigns/) - [修改现有广告活动](/zh/docs/api/manage-campaigns/) - [广告活动与账户统计](/zh/docs/api/stats/) - [定向词典与群组](/zh/docs/api/targeting/) 集成 - [接收广告活动事件](/zh/docs/api/webhooks/) - [发送已确认的转化](/zh/docs/api/conversions/) - [API 版本与更新](/zh/docs/api/changelog/) 文件与架构 - [OpenAPI · YAML](/docs/api/openapi.yaml) - [OpenAPI · JSON](/docs/api/openapi.json) - [llms.txt](/zh/docs/llms.txt) - [llms-full.txt](/zh/docs/llms-full.txt) [全部文档](/zh/docs/) 快速入门 - [API 快速入门](/zh/docs/api/) - [密钥与账户权限](/zh/docs/api/authentication/) - [将 API 文档交给 AI 助手](/zh/docs/api/ai-assistants/) 基础概念 - [解读 API 错误](/zh/docs/api/errors/) - [请求和事件限额](/zh/docs/api/rate-limits/) - [安全重试同一操作](/zh/docs/api/idempotency/) - [跟踪排队中的操作](/zh/docs/api/tasks/) - [逐页读取广告活动](/zh/docs/api/pagination/) API 参考 - [可访问的广告账户](/zh/docs/api/accounts/) - [查询广告活动](/zh/docs/api/campaigns/) - [创建广告活动与上传媒体](/zh/docs/api/create-campaigns/) - [修改现有广告活动](/zh/docs/api/manage-campaigns/) - [广告活动与账户统计](/zh/docs/api/stats/) - [定向词典与群组](/zh/docs/api/targeting/) 集成 - [接收广告活动事件](/zh/docs/api/webhooks/) - [发送已确认的转化](/zh/docs/api/conversions/) - [API 版本与更新](/zh/docs/api/changelog/) 文件与架构 - [OpenAPI · YAML](/docs/api/openapi.yaml) - [OpenAPI · JSON](/docs/api/openapi.json) - [llms.txt](/zh/docs/llms.txt) - [llms-full.txt](/zh/docs/llms-full.txt) [Orbito Ads](/zh/) [文档](/zh/docs/) [API](/zh/docs/api/) 从服务端或追踪器发送活动引用或邀请链接、事件类型及唯一交易 ID。可选的金额和货币字段可用于关联收入与广告支出。 [Markdown](/zh/docs/api/conversions.md) Telegram 记录展示、点击和加入频道等行为。之后发生的留资、入金或成交由您的后端或跟踪系统记录。将这些事件上报至 Orbito Ads 后,就能在面板、报告和自动化规则中查看并使用各活动的转化和收入。 ## 启用转化跟踪 在面板上的密钥卡片上,切换到**收到邮件** 。没有它,就发送回`403 INGEST_DISABLED`。对于一个追踪器,请按**创建Tracker URL** — — 您只能收到URL(一次下)的写出,它可以张贴转换,但不能读出任何东西。 ## 转化如何归因到广告活动 每条广告都与您控制的标识符连接到某个地方: - 机器人或微型应用程序:`t.me/yourbot?start=REF`或`?startapp=REF` - 网站:您追踪器在链接中的点击 id 或 sub id, e.g . `https://site.com/?subid=REF` 当您发送一个转换时, 包括`REF` 和 `ref` 。 Orbito Ads 在内阁中找到其链接的广告活动。 如果一个内阁的几次广告活动共用同样的`ref`, 那么每个内阁的转换都算得上。 ## 从服务器发送 · POST /v1/postback 示例 ``` curl -s -X POST https://orbitoads.pro/api/v1/postback \ -H "X-API-Key: $ORBITO_API_KEY" -H "Content-Type: application/json" \ -d '{ "ref": "promo_oct", "event": "purchase", "amount": 49.90, "currency": "USD", "txid": "order-10087" }' ``` 示例 ``` { "success": true, "data": { "id": 551203, "ad_id": 90412, "account_id": 53, "event_type": "purchase", "deduped": false } } ``` 一次多达1000起事件:`{ "events": [ {…}, {…} ] }`起(或一阵赤裸). 反应报告每起事件——`{ "accepted": 998, "failed": 2, "results": [ … ] }`起,因此一个坏事件从未下沉过批次. ## 从跟踪工具发送 · GET /v1/ingest/{token} 将URL跟踪器粘入您的跟踪器的后置设置, 并带有其宏 : 示例 ``` # Keitaro https://orbitoads.pro/api/v1/ingest/?ref={subid}&event={status}&amount={payout}¤cy={currency}&txid={subid}_{status} # RedTrack https://orbitoads.pro/api/v1/ingest/?ref={clickid}&event={type}&status={status}&amount={sum}&txid={rdtk_event_id} # Binom https://orbitoads.pro/api/v1/ingest/?ref={clickid}&event={status}&amount={payout}&txid={clickid} # Voluum https://orbitoads.pro/api/v1/ingest/?ref={clickid}&event={et}&amount={payout}¤cy={currency}&txid={txid} ``` 在您自己的文档中检查宏名称。 答案是纯文本: `OK`, `OK (deduped)`, 或带有HTTP状态的错误信息( 4xx — 不重试, 5xxx — 重试 ) 。 ## 字段 | 田野 | 亦被接受为 | 需要 | 意义 | | --- | --- | --- | --- | | `ref` | `subid`, `sub_id`, `clickid`, `click_id`, `cnv_id`, `cid` | 是1 | 广告链接中的标识符。最多512个字符。 | | `invite_link` | `invitelink`, `link` | 是1 | 为频道广告:所创建的独有邀请链接Orbito Ads. | | `event` | `event_type`, `type`, `goal`, `cnv_status` | 是的 | 成为`lead`,`conversion`或`purchase`(字相通有`signup`,`ftd`,`deposit`,`sale`等). 未知的字被拒绝. | | `txid` | `tid`, `transaction_id`, `order_id`, `rdtk_event_id`首席 `X-Idempotency-Key` | 是的 | 您的此事件的代号 。 发送相同的 `txid` 重新更新事件, 而不是重复计算 。 最多 128 个字符 。 | | `amount` | `payout`, `sum`, `revenue`, `value` | 无 | 数字; 充值为负. | | `currency` | `cur`, `cnv_currency` | 无 | ISO 4217 代码,没有一个,一个金额记录为USD . | | `status` | — | 无 | 您的网络状态单词( 已核准, 待定. ) , 已保存 。 | | `event_time` | `timestamp`, `date` | 无 | ISO或unix时间;保存在后90天以内. | | `account_id` | `accountId` | 有时 | 需要时,你的几个柜子里有同样的`ref`个(另`409`个)。 | | `meta` | — | 无 | 你自己的JSON天体,最高可达4个KB . | 1,`ref`或`invite_link` (中文(简体) ). ## 限额与重试 每把钥匙每秒有20个事件,连发可达1000个——与读写预算分开. `429`等`Retry-After`;再试总是安全的,因为`txid`个去重试. ## GET /v1/conversions 每项运动的总数,每活动计算一次: 示例 ``` curl -s "https://orbitoads.pro/api/v1/conversions?days=30" -H "X-API-Key: $ORBITO_API_KEY" ``` 示例 ``` { "success": true, "data": [ { "account_id": 53, "ad_id": 90412, "leads": 12, "conversions": 3, "purchases": 1, "revenue": { "USD": 49.9 } } ] } ``` | 参数 | 意义 | | --- | --- | | `adId` | 一场广告活动. | | `days` | 过去1至365天只收到事件。 | - `revenue`是按货币计算——金额从不兑换. - `ad_id`是`null`,与多个运动共享的`ref`对应的事件. - 您发送的金额是您自己的报告。 这些金额没有计费, 也不改变您支付Orbito Ads美元的任何费用 。 ## API 参考 完整广告接口需要为此工作区单独配置供应商凭据。客户端请求使用自己的 Orbito API 密钥。账户订购、开通和外部账单分别处理。 ## POST `/api/v1/postback` 提交单个转化或最多 1,000 个事件。 | 参数 | 位置 | 格式 | 必填 | | --- | --- | --- | --- | | `X-API-Key` | header | `string` | 是 | cURL ``` curl -X POST https://orbitoads.pro/api/v1/postback \ -H 'X-API-Key: YOUR_ORBITO_KEY' \ -H 'Content-Type: application/json' \ --data '{ "ref": "club-november", "event": "purchase", "txid": "example-order-2048", "amount": 18, "currency": "EUR", "account_id": 7401 }' ``` HTTP 202 ``` { "success": true, "data": { "id": 61176, "ad_id": 38017, "account_id": 7401, "event_type": "purchase", "deduped": false } } ``` ### 请求体结构 JSON Schema ``` { "oneOf": [ { "properties": { "account_id": { "type": "integer" }, "amount": { "type": "number" }, "currency": { "type": "string" }, "event": { "type": "string" }, "event_time": { "type": [ "string", "integer" ] }, "invite_link": { "type": "string" }, "meta": { "type": "object" }, "ref": { "maxLength": 512, "type": "string" }, "status": { "maxLength": 64, "type": "string" }, "txid": { "maxLength": 128, "type": "string" } }, "required": [ "event", "txid" ], "type": "object" }, { "properties": { "events": { "items": { "properties": { "account_id": { "type": "integer" }, "amount": { "type": "number" }, "currency": { "type": "string" }, "event": { "type": "string" }, "event_time": { "type": [ "string", "integer" ] }, "invite_link": { "type": "string" }, "meta": { "type": "object" }, "ref": { "maxLength": 512, "type": "string" }, "status": { "maxLength": 64, "type": "string" }, "txid": { "maxLength": 128, "type": "string" } }, "required": [ "event", "txid" ], "type": "object" }, "maxItems": 1000, "type": "array" } }, "required": [ "events" ], "type": "object" }, { "items": { "properties": { "account_id": { "type": "integer" }, "amount": { "type": "number" }, "currency": { "type": "string" }, "event": { "type": "string" }, "event_time": { "type": [ "string", "integer" ] }, "invite_link": { "type": "string" }, "meta": { "type": "object" }, "ref": { "maxLength": 512, "type": "string" }, "status": { "maxLength": 64, "type": "string" }, "txid": { "maxLength": 128, "type": "string" } }, "required": [ "event", "txid" ], "type": "object" }, "maxItems": 1000, "type": "array" } ] } ``` ## GET `/api/v1/ingest/{token}` 通过仅写入的网址回传追踪转化。 | 参数 | 位置 | 格式 | 必填 | | --- | --- | --- | --- | | `token` | path | `string` | 是 | | `ref` | query | `string` | — | | `event` | query | `string` | — | | `txid` | query | `string` | — | | `amount` | query | `string` | — | | `currency` | query | `string` | — | cURL ``` curl -X GET 'https://orbitoads.pro/api/v1/ingest/YOUR_ORBITO_TRACKER_TOKEN?ref=club-november&event=purchase&txid=example-order-2048&amount=18¤cy=EUR' ``` HTTP 200 ``` "OK" ``` ## GET `/api/v1/conversions` 按原始币种列出转化量与收入。 | 参数 | 位置 | 格式 | 必填 | | --- | --- | --- | --- | | `adId` | query | `integer` | — | | `days` | query | `integer` | — | | `X-API-Key` | header | `string` | 是 | cURL ``` curl -X GET 'https://orbitoads.pro/api/v1/conversions?adId=38017&days=7' \ -H 'X-API-Key: YOUR_ORBITO_KEY' ``` HTTP 200 ``` { "success": true, "data": [ { "account_id": 7401, "ad_id": 38017, "leads": 2, "conversions": 1, "purchases": 1, "revenue": { "EUR": 18 } } ] } ``` ## 实施说明 ## 关联转化与广告 先在供应商密钥上启用接收回传。传 ref 或 invite_link、event 和稳定的 txid。标准事件为 lead、conversion、purchase。多个账户匹配时指定 account_id。 请求结果与响应字段 | API | 含义 | | --- | --- | | account_id / accountId | account_id 也可以写成 accountId。同一 ref 出现在多个账户时需指定账户,匹配不明确会返回 HTTP 409。 | ## 去重与币种 相同 txid 更新既有事件,批次可部分成功。收入采用 ISO 币种,缺省 USD;负值可表示退款。追踪链接只可写入,以纯文本返回 OK 或 OK (deduped)。 ## 操作与字段 POST /api/v1/postback GET /api/v1/ingest/{token} GET /api/v1/conversions ref invite_link event txid amount currency - POST /api/v1/postback - GET /api/v1/ingest/{token} - GET /api/v1/conversions - ref - invite_link - event - txid - amount - currency ## 请求示例 GET /api/v1/conversions?days=7 HTTP/1.1 Host: orbitoads.pro X-API-Key: {key} ## 结构字段与限制 本表依据公开的 v1 契约。参数与字段名称区分大小写。各操作的 HTTP 状态码分别表示成功、输入校验和访问检查。链接规范给出了完整的请求与响应结构。 ## 协议参考 | 方法 | 路径 | 参数 | 请求内容 | 响应码 | | --- | --- | --- | --- | --- | | POST | /api/v1/postback | — | application/json · ConversionEvent \| object \| array · [ConversionEvent] · 0 … 1000 | 202, 400, 401, 403, 404, 409, 429 | | GET | /api/v1/ingest/{token} | token, ref, event, txid, amount, currency | — | 200, 400, 401, 403, 404, 429 | | GET | /api/v1/conversions | adId, days | — | 200, 401 | 来源 · [数据来源](https://adsly.pro/docs/api/openapi.yaml) ## 结构字段与限制 · 发送已确认的转化 | 字段 | 文档取值 | | --- | --- | | ref \| invite_link | string | | event | lead \| conversion \| purchase | | txid | string | | amount | number | | currency | ISO 4217 | | GET conversions · days | 1 … 365 | 来源 · [数据来源](https://adsly.pro/docs/api/conversions/) ## ConversionEvent | 字段 | 字段类型 | | --- | --- | | ref | string | | invite_link | string | | event | string | | txid | string | | amount | number | | currency | string | | status | string | | event_time | string \| integer | | account_id | integer | | meta | object | 来源 · [数据来源](https://adsly.pro/docs/api/openapi.yaml) ## ConversionsRow | 字段 | 字段类型 | | --- | --- | | account_id | integer | | ad_id | integer \| null | | leads | integer | | conversions | integer | | purchases | integer | | revenue | object | 来源 · [数据来源](https://adsly.pro/docs/api/openapi.yaml) ## 相关阅读 [接收广告活动事件](/zh/docs/api/webhooks/)[API 版本与更新](/zh/docs/api/changelog/) 参考资料更新日期 2026-10-08 [上一主题**接收广告活动事件**](/zh/docs/api/webhooks/)[下一主题**API 版本与更新**](/zh/docs/api/changelog/) ## 来源与数据 - [openapi.yaml](https://orbitoads.pro/docs/api/openapi.yaml) - [openapi.json](https://orbitoads.pro/docs/api/openapi.json) --- # 创建广告活动与上传媒体 [Orbito Ads · 简体中文 · HTML](https://orbitoads.pro/zh/docs/api/create-campaigns/) 来源核对日期 · 2026-11-27 ### 浏览文档 [全部文档](/zh/docs/) 快速入门 - [API 快速入门](/zh/docs/api/) - [密钥与账户权限](/zh/docs/api/authentication/) - [将 API 文档交给 AI 助手](/zh/docs/api/ai-assistants/) 基础概念 - [解读 API 错误](/zh/docs/api/errors/) - [请求和事件限额](/zh/docs/api/rate-limits/) - [安全重试同一操作](/zh/docs/api/idempotency/) - [跟踪排队中的操作](/zh/docs/api/tasks/) - [逐页读取广告活动](/zh/docs/api/pagination/) API 参考 - [可访问的广告账户](/zh/docs/api/accounts/) - [查询广告活动](/zh/docs/api/campaigns/) - [创建广告活动与上传媒体](/zh/docs/api/create-campaigns/) - [修改现有广告活动](/zh/docs/api/manage-campaigns/) - [广告活动与账户统计](/zh/docs/api/stats/) - [定向词典与群组](/zh/docs/api/targeting/) 集成 - [接收广告活动事件](/zh/docs/api/webhooks/) - [发送已确认的转化](/zh/docs/api/conversions/) - [API 版本与更新](/zh/docs/api/changelog/) 文件与架构 - [OpenAPI · YAML](/docs/api/openapi.yaml) - [OpenAPI · JSON](/docs/api/openapi.json) - [llms.txt](/zh/docs/llms.txt) - [llms-full.txt](/zh/docs/llms-full.txt) [全部文档](/zh/docs/) 快速入门 - [API 快速入门](/zh/docs/api/) - [密钥与账户权限](/zh/docs/api/authentication/) - [将 API 文档交给 AI 助手](/zh/docs/api/ai-assistants/) 基础概念 - [解读 API 错误](/zh/docs/api/errors/) - [请求和事件限额](/zh/docs/api/rate-limits/) - [安全重试同一操作](/zh/docs/api/idempotency/) - [跟踪排队中的操作](/zh/docs/api/tasks/) - [逐页读取广告活动](/zh/docs/api/pagination/) API 参考 - [可访问的广告账户](/zh/docs/api/accounts/) - [查询广告活动](/zh/docs/api/campaigns/) - [创建广告活动与上传媒体](/zh/docs/api/create-campaigns/) - [修改现有广告活动](/zh/docs/api/manage-campaigns/) - [广告活动与账户统计](/zh/docs/api/stats/) - [定向词典与群组](/zh/docs/api/targeting/) 集成 - [接收广告活动事件](/zh/docs/api/webhooks/) - [发送已确认的转化](/zh/docs/api/conversions/) - [API 版本与更新](/zh/docs/api/changelog/) 文件与架构 - [OpenAPI · YAML](/docs/api/openapi.yaml) - [OpenAPI · JSON](/docs/api/openapi.json) - [llms.txt](/zh/docs/llms.txt) - [llms-full.txt](/zh/docs/llms-full.txt) [Orbito Ads](/zh/) [文档](/zh/docs/) [API](/zh/docs/api/) 每个请求可在一个账户内创建最多 100 项活动。选择频道、机器人、搜索或受众定向,提供唯一操作键并跟踪返回的任务。需要媒体时先上传。 [Markdown](/zh/docs/api/create-campaigns.md) `POST /v1/campaigns` 在一个账户中创建广告活动。需要有管理权限的密钥以及 `Idempotency-Key` 请求头。`202` 响应包含[任务](/zh/docs/api/tasks/)信息,任务完成后才会出现新活动。 ## 创建广告活动示例 示例 ``` curl -s -X POST https://orbitoads.pro/api/v1/campaigns \ -H "X-API-Key: $ORBITO_API_KEY" \ -H "Content-Type: application/json" \ -H "Idempotency-Key: $(uuidgen)" \ -d '{ "account_id": 53, "title": "Crypto channels — notes", "text": "Daily market notes in 3 minutes. No noise.", "promote_url": "https://t.me/yourchannel", "cpm": 1.5, "budget": 20, "target_type": "channels", "channels": ["@durov", "t.me/telegram"] }' ``` 示例 ``` { "success": true, "data": { "id": 81234, "type": "create", "status": "pending", "account_id": 53, "total": 1, "ad_ids": [] } } ``` ## 批量创建 将运动设置为`campaigns`个(最多为100个). `account_id`个组域保留在顶层,并适用于所有组域. 示例 ``` { "account_id": 53, "new_group_name": "October test", "campaigns": [ { "title": "A", "text": "Variant A", "promote_url": "https://t.me/yourchannel", "cpm": 1.5, "budget": 10, "target_type": "channels", "channels": ["@durov"] }, { "title": "B", "text": "Variant B", "promote_url": "https://t.me/yourchannel", "cpm": 1.5, "budget": 10, "target_type": "channels", "channels": ["@telegram"] } ] } ``` 运动是逐个创建的。 如果第一个失败, 任务停止了 —— 修正输入而不是重复同样的错误100次。 每个失败都列在任务`errors` 中, 它的`index` 在您的数组中 。 ## 字段 | 田野 | 需要 | 意义 | | --- | --- | --- | | `title` | 是的 | 内部名称,显示在面板上. | | `text` | 是的 | Ad text people see. Telegram自身长度和内容规则适用——任务`errors`回回回拒绝. | | `promote_url` | 是的 | 广告内容:`https://t.me/channel`、`t.me/bot?start=ref`、`@channel`或网站URL。 | | `cpm` | 是的 | 内阁货币的比价(bid / 1000)大于0. 。 目标 — — Telegram — 的最小值太低了。 | | `budget` | 是的 | 钱从内阁平衡转向广告活动:`0`,至少是内阁的`min_budget` ([广告账户](/zh/docs/api/accounts/) ) 。 有了`0`,广告已经创建,但直到你增加预算才能运行。 | | `target_type` | 是的 | `channels`、`bots`、`search`或`users`——见下文。 | | `active` | 无 | `false` 创建它关闭。默认 `true` 。 | | `daily_budget` | 无 | 每日支出上限。 | | `views_per_user` | 无 | 1–4号,有多少人能看到广告? | | `media` | 无 | [`POST /v1/media`](/zh/docs/api/create-campaigns/#doc-note-upload-media)的图像或视频标志。 | | `picture` | 无 | `true`在广告中展示了被推广的频道的相声. | | `button` | 无 | 广告下键:`subscribe`,`view`,`read`,`learn_more`,`download`,`open`,`sign_up`,`buy`,`order`,`play`,`try`,`leave_request`. 只有内阁的`features.ad_button`是`true`的. | | `website_name` | 无 | 在网站广告上显示的品牌名称. | | `schedule` | 无 | 仅在选定的工作日及时间播放广告, e.g . 工作日 9: 00–18: 00。 格式: [时间表](/zh/docs/api/manage-campaigns/#doc-note-schedule) 。 没有广告, 广告会全天候播放 。 | 顶级仅:`account_id`(当密钥到达多个柜子时需要),`group_id`(现存[团体](/zh/docs/api/targeting/#doc-note-groups))或`new_group_name`(创建组,或再用取名后需要). 以`400 VALIDATION_ERROR`拒绝未知字段,以`param`拒绝字段名——一个twico从不默不作声地放弃一个设置. ## 定向设置 ### `channels` — 在具体频道显示广告 示例 ``` { "target_type": "channels", "channels": ["@durov", "t.me/telegram"], "languages": ["en"], "topics": [7, 26], "exclude_topics": [2], "add_similar_channels": true } ``` | 田野 | 意义 | | --- | --- | | `channels` | 1–100 公共频道:`@name`个,`name`个或`t.me/name`个。 | | `languages`, `topics`, `exclude_topics` | 按频道语言和话题划分的收缩([代码](/zh/docs/api/targeting/). | | `add_similar_channels` | 同时加入类似这些频道. | ### `bots` — 以 bots 显示广告 示例 ``` { "target_type": "bots", "bots": ["@somebot"] } ``` `bots`: 1–100 个公共bots. required. ### `search` — 显示Telegram搜索查询的广告 示例 ``` { "target_type": "search", "search_keywords": ["crypto wallet", "bitcoin"] } ``` `search_keywords`: 1–100 个短语,每个短语最多64个字符。 需要 。 ### `users` — 向观众展示广告 示例 ``` { "target_type": "users", "countries": ["DE", "AT"], "languages": ["de"], "topics": [26], "exclude_topics": [2], "audience_channels": ["@somechannel"] } ``` | 田野 | 意义 | | --- | --- | | `countries` | ISO国道代码. | | `languages` | 语言代码. | | `topics`, `exclude_topics` | 兴趣,按专题编号。 | | `audience_channels` | 读这些频道的人。 | 至少需要其中之一。代码:[目标代码](/zh/docs/api/targeting/) 。 当任务进行时,频道、bots和关键词被解决到Telegram自己的ID上。 Telegram号无法找到;如果找不到的话,这场广告活动失败了 — — `No targets found: …`个频道和boots,`No valid search queries found`个关键词 — — 而任务`errors`号也这么说。 ## 创建广告活动后 1. [`GET /v1/tasks/{id}`](/zh/docs/api/tasks/)号投票直到`completed`. `ad_ids`举行新的广告活动. 2. Telegram评出每条新广告:开始`In Review`个,然后变成`Active`(或`Declined`个). A[网页](/zh/docs/api/webhooks/)告诉你什么时候. 3. 用[管理活动](/zh/docs/api/manage-campaigns/)来改变、资助或暂停 ## 上传媒体文件 `POST /v1/media`将一个图像或视频上传到一个柜子,并返回`POST /v1/campaigns`、`PATCH`和副本的`media`个代币。 该代币属于该柜子,上传到您将要创建的柜子中。 示例 ``` curl -s -X POST "https://orbitoads.pro/api/v1/media?account_id=53" \ -H "X-API-Key: $ORBITO_API_KEY" \ -F "file=@banner.jpg" ``` 示例 ``` { "success": true, "data": { "media": "BQACAgIAAx0…", "account_id": 53 } } ``` - JPG,PNG,GIF,WEBP或MP4,至10 MB,以`multipart/form-data`发于场上`file`. - 有些柜子只接受16:9的图像, 至少640px宽;如果一个文件不合适, Telegram的理由在`error`回. ## 错误 | 代码 | 当时 | | --- | --- | | `VALIDATION_ERROR` | 一个字段丢失, 未知, 类型错误, 或不属于这个`target_type` — `param`说。 | | `IDEMPOTENCY_KEY_REQUIRED` | 编号为`Idempotency-Key`. | | `ACCOUNT_ID_REQUIRED` / `ACCOUNT_NOT_FOUND` | 说哪个柜子是无法到达的。 | | `VIEW_ONLY_ACCESS` | 你可进入这个柜子 | | `QUEUE_FULL` | 5 创建此内阁中已经排队的 。 | | `CABINET_LOCKED`, `SUBSCRIPTION_REQUIRED` | 内阁现在无法接受手动修改。 | 个人广告活动故障(Telegram拒绝文本、提议、链接)不会失败请求 - 它们在任务中出现 `errors`. ## API 参考 完整广告接口需要为此工作区单独配置供应商凭据。客户端请求使用自己的 Orbito API 密钥。账户订购、开通和外部账单分别处理。 ## POST `/api/v1/campaigns` 在一个账户中排队创建单条或最多 100 条广告。 | 参数 | 位置 | 格式 | 必填 | | --- | --- | --- | --- | | `Idempotency-Key` | header | `string` | 是 | | `X-API-Key` | header | `string` | 是 | cURL ``` curl -X POST https://orbitoads.pro/api/v1/campaigns \ -H 'X-API-Key: YOUR_ORBITO_KEY' \ -H 'Idempotency-Key: 2033d50c-b32b-44aa-8e40-3e236c474805' \ -H 'Content-Type: application/json' \ --data '{ "title": "November club · draft", "text": "Explore this month’s language club schedule.", "promote_url": "https://school.example/club", "cpm": 1.25, "budget": 0, "active": false, "target_type": "users", "countries": [ "GB" ], "languages": [ "en" ], "account_id": 7401, "group_id": 516 }' ``` HTTP 202 ``` { "success": true, "data": { "id": 96203, "type": "create", "status": "pending", "account_id": 7401, "total": 1, "ad_ids": [] } } ``` ### 请求体结构 JSON Schema ``` { "oneOf": [ { "properties": { "account_id": { "type": "integer" }, "active": { "default": true, "type": "boolean" }, "add_similar_channels": { "type": "boolean" }, "audience_channels": { "items": { "type": "string" }, "type": "array" }, "bots": { "items": { "type": "string" }, "maxItems": 100, "minItems": 1, "type": "array" }, "budget": { "minimum": 0, "type": "number" }, "button": { "enum": [ "subscribe", "view", "read", "learn_more", "download", "open", "sign_up", "buy", "order", "play", "try", "leave_request" ], "type": "string" }, "channels": { "items": { "type": "string" }, "maxItems": 100, "minItems": 1, "type": "array" }, "countries": { "items": { "type": "string" }, "type": "array" }, "cpm": { "exclusiveMinimum": 0, "type": "number" }, "daily_budget": { "minimum": 0, "type": "number" }, "exclude_topics": { "items": { "type": "integer" }, "type": "array" }, "group_id": { "type": "integer" }, "languages": { "items": { "type": "string" }, "type": "array" }, "media": { "type": "string" }, "new_group_name": { "maxLength": 100, "type": "string" }, "picture": { "type": "boolean" }, "promote_url": { "maxLength": 2048, "type": "string" }, "schedule": { "additionalProperties": false, "properties": { "days": { "additionalProperties": false, "properties": { "fri": { "items": { "maximum": 23, "minimum": 0, "type": "integer" }, "maxItems": 24, "type": "array" }, "mon": { "items": { "maximum": 23, "minimum": 0, "type": "integer" }, "maxItems": 24, "type": "array" }, "sat": { "items": { "maximum": 23, "minimum": 0, "type": "integer" }, "maxItems": 24, "type": "array" }, "sun": { "items": { "maximum": 23, "minimum": 0, "type": "integer" }, "maxItems": 24, "type": "array" }, "thu": { "items": { "maximum": 23, "minimum": 0, "type": "integer" }, "maxItems": 24, "type": "array" }, "tue": { "items": { "maximum": 23, "minimum": 0, "type": "integer" }, "maxItems": 24, "type": "array" }, "wed": { "items": { "maximum": 23, "minimum": 0, "type": "integer" }, "maxItems": 24, "type": "array" } }, "type": "object" }, "timezone": { "type": "string" } }, "required": [ "days", "timezone" ], "type": [ "object", "null" ] }, "search_keywords": { "items": { "maxLength": 64, "type": "string" }, "maxItems": 100, "minItems": 1, "type": "array" }, "target_type": { "enum": [ "channels", "bots", "search", "users" ], "type": "string" }, "text": { "maxLength": 4096, "type": "string" }, "title": { "maxLength": 255, "type": "string" }, "topics": { "items": { "type": "integer" }, "type": "array" }, "views_per_user": { "maximum": 4, "minimum": 1, "type": "integer" }, "website_name": { "maxLength": 255, "type": "string" } }, "required": [ "title", "text", "promote_url", "cpm", "budget", "target_type" ], "type": "object" }, { "properties": { "account_id": { "type": "integer" }, "campaigns": { "items": { "properties": { "active": { "default": true, "type": "boolean" }, "add_similar_channels": { "type": "boolean" }, "audience_channels": { "items": { "type": "string" }, "type": "array" }, "bots": { "items": { "type": "string" }, "maxItems": 100, "minItems": 1, "type": "array" }, "budget": { "minimum": 0, "type": "number" }, "button": { "enum": [ "subscribe", "view", "read", "learn_more", "download", "open", "sign_up", "buy", "order", "play", "try", "leave_request" ], "type": "string" }, "channels": { "items": { "type": "string" }, "maxItems": 100, "minItems": 1, "type": "array" }, "countries": { "items": { "type": "string" }, "type": "array" }, "cpm": { "exclusiveMinimum": 0, "type": "number" }, "daily_budget": { "minimum": 0, "type": "number" }, "exclude_topics": { "items": { "type": "integer" }, "type": "array" }, "languages": { "items": { "type": "string" }, "type": "array" }, "media": { "type": "string" }, "picture": { "type": "boolean" }, "promote_url": { "maxLength": 2048, "type": "string" }, "schedule": { "additionalProperties": false, "properties": { "days": { "additionalProperties": false, "properties": { "fri": { "items": { "maximum": 23, "minimum": 0, "type": "integer" }, "maxItems": 24, "type": "array" }, "mon": { "items": { "maximum": 23, "minimum": 0, "type": "integer" }, "maxItems": 24, "type": "array" }, "sat": { "items": { "maximum": 23, "minimum": 0, "type": "integer" }, "maxItems": 24, "type": "array" }, "sun": { "items": { "maximum": 23, "minimum": 0, "type": "integer" }, "maxItems": 24, "type": "array" }, "thu": { "items": { "maximum": 23, "minimum": 0, "type": "integer" }, "maxItems": 24, "type": "array" }, "tue": { "items": { "maximum": 23, "minimum": 0, "type": "integer" }, "maxItems": 24, "type": "array" }, "wed": { "items": { "maximum": 23, "minimum": 0, "type": "integer" }, "maxItems": 24, "type": "array" } }, "type": "object" }, "timezone": { "type": "string" } }, "required": [ "days", "timezone" ], "type": [ "object", "null" ] }, "search_keywords": { "items": { "maxLength": 64, "type": "string" }, "maxItems": 100, "minItems": 1, "type": "array" }, "target_type": { "enum": [ "channels", "bots", "search", "users" ], "type": "string" }, "text": { "maxLength": 4096, "type": "string" }, "title": { "maxLength": 255, "type": "string" }, "topics": { "items": { "type": "integer" }, "type": "array" }, "views_per_user": { "maximum": 4, "minimum": 1, "type": "integer" }, "website_name": { "maxLength": 255, "type": "string" } }, "required": [ "title", "text", "promote_url", "cpm", "budget", "target_type" ], "type": "object" }, "maxItems": 100, "minItems": 1, "type": "array" }, "group_id": { "type": "integer" }, "new_group_name": { "maxLength": 100, "type": "string" } }, "required": [ "campaigns" ], "type": "object" } ] } ``` 请求结果与响应字段 | API | HTTP | 含义 | | --- | --- | --- | | VALIDATION_ERROR | 400 | 核对请求字段,修正非法输入后重试。 | | IDEMPOTENCY_KEY_REQUIRED | 400 | 写请求中需提供 Idempotency-Key 请求头。 | | VIEW_ONLY_ACCESS | 403 | Viewer 可查看该账户,修改则需要账户级写权限。 | | QUEUE_FULL | 429 | 该账户的创建队列已有五项任务,请等待空位。 | [解读 API 错误](/zh/docs/api/errors/) ## POST `/api/v1/media` 上传广告素材并取得该账户专用的文件令牌。 | 参数 | 位置 | 格式 | 必填 | | --- | --- | --- | --- | | `account_id` | query | `integer` | — | | `X-API-Key` | header | `string` | 是 | | `Idempotency-Key` | header | `string` | — | cURL ``` curl -X POST 'https://orbitoads.pro/api/v1/media?account_id=7401' \ -H 'X-API-Key: YOUR_ORBITO_KEY' \ -F file=@./club-cover.png ``` HTTP 200 ``` { "success": true, "data": { "media": "example-media-718", "account_id": 7401 } } ``` ### 请求体结构 JSON Schema ``` { "properties": { "account_id": { "type": "integer" }, "file": { "format": "binary", "type": "string" } }, "required": [ "file" ], "type": "object" } ``` 示例 · JSON ``` { "account_id": 7401, "new_group_name": "Language club variants", "campaigns": [ { "title": "November club · draft", "text": "Explore this month’s language club schedule.", "promote_url": "https://school.example/club", "cpm": 1.25, "budget": 0, "active": false, "target_type": "users", "countries": [ "GB" ], "languages": [ "en" ] }, { "title": "Conversation club · second draft", "text": "Explore this month’s language club schedule.", "promote_url": "https://school.example/club?from=variant2", "cpm": 1.25, "budget": 0, "active": false, "target_type": "users", "countries": [ "GB" ], "languages": [ "en" ] } ] } ``` ## 实施说明 ## 单条与批量创建 单条创建在根级传 title、text、promote_url、cpm、budget、target_type。批量创建在 campaigns 中放 1–100 个对象,根级共享账户和分组。预算可为零或至少达到 min_budget。 ## 定向与文件 定向可选 channels、bots、search 或 users。频道、机器人、关键词各 1–100 项,搜索词最多 64 字符。受众模式至少有一项筛选。JPG、PNG、GIF、WebP、MP4 最大 10 MB,素材令牌属于上传账户。 ## 受理与完成 创建、复制和批量操作返回 HTTP 202 及任务 ID。按 Retry-After 轮询 GET /api/v1/tasks/{id}。即使状态为 completed,也要检查 failed 和 errors。 ## 操作与字段 POST /api/v1/campaigns POST /api/v1/media channels bots search users - POST /api/v1/campaigns - POST /api/v1/media - channels - bots - search - users ## 请求示例 GET /api/v1/targeting HTTP/1.1 Host: orbitoads.pro X-API-Key: {key} ## 结构字段与限制 本表依据公开的 v1 契约。参数与字段名称区分大小写。各操作的 HTTP 状态码分别表示成功、输入校验和访问检查。链接规范给出了完整的请求与响应结构。 ## 受众测试设置 创建结构区分四种定向方式。频道使用 channels,机器人名使用 bots,搜索词使用 search_keywords。国家、语言与主题用于描述用户受众。构建测试前应先读取账户所支持的选项。 ## 协议参考 | 方法 | 路径 | 参数 | 请求内容 | 响应码 | | --- | --- | --- | --- | --- | | POST | /api/v1/campaigns | Idempotency-Key | application/json · CreateSingleRequest \| CreateBatchRequest | 202, 400, 401, 403, 404, 409, 422, 429, 503 | | POST | /api/v1/media | account_id | multipart/form-data · file, account_id | 200, 400, 401, 403, 413 | | GET | /api/v1/targeting | — | — | 200, 401 | | GET | /api/v1/tasks/{id} | id | — | 200, 400, 401, 404 | 来源 · [数据来源](https://adsly.pro/docs/api/openapi.yaml) ## 结构字段与限制 · 创建广告活动与上传媒体 | 字段 | 文档取值 | | --- | --- | | target_type | channels \| bots \| search \| users | | campaigns[] | 1 … 100 | | active = | true | | views_per_user | 1 … 4 | | budget | ≥ 0 | | Idempotency-Key | UUID | 来源 · [数据来源](https://adsly.pro/docs/api/create-campaigns/) ## CampaignInput | 字段 | 字段类型 | | --- | --- | | title | string | | text | string | | promote_url | string | | cpm | number | | daily_budget | number · 0 … ∞ | | views_per_user | integer · 1 … 4 | | media | string | | picture | boolean | | button | subscribe \| view \| read \| learn_more \| download \| open \| sign_up \| buy \| order \| play \| try \| leave_request | | website_name | string | | schedule | Schedule | | budget | number · 0 … ∞ | | active | boolean · = true | | target_type | channels \| bots \| search \| users | | channels | array · [string] · 1 … 100 | | bots | array · [string] · 1 … 100 | | search_keywords | array · [string] · 1 … 100 | | countries | array · [string] | | languages | array · [string] | | topics | array · [integer] | | exclude_topics | array · [integer] | | audience_channels | array · [string] | | add_similar_channels | boolean | 来源 · [数据来源](https://adsly.pro/docs/api/openapi.yaml) ## CreateBatchRequest | 字段 | 字段类型 | | --- | --- | | account_id | integer | | group_id | integer | | new_group_name | string | | campaigns | array · [CampaignInput] · 1 … 100 | 来源 · [数据来源](https://adsly.pro/docs/api/openapi.yaml) ## CreativeFields | 字段 | 字段类型 | | --- | --- | | title | string | | text | string | | promote_url | string | | cpm | number | | daily_budget | number · 0 … ∞ | | views_per_user | integer · 1 … 4 | | media | string | | picture | boolean | | button | subscribe \| view \| read \| learn_more \| download \| open \| sign_up \| buy \| order \| play \| try \| leave_request | | website_name | string | | schedule | Schedule | 来源 · [数据来源](https://adsly.pro/docs/api/openapi.yaml) ## 相关阅读 [可访问的广告账户](/zh/docs/api/accounts/)[查询广告活动](/zh/docs/api/campaigns/)[修改现有广告活动](/zh/docs/api/manage-campaigns/)[广告活动与账户统计](/zh/docs/api/stats/)[定向词典与群组](/zh/docs/api/targeting/) 参考资料更新日期 2026-10-08 [上一主题**查询广告活动**](/zh/docs/api/campaigns/)[下一主题**修改现有广告活动**](/zh/docs/api/manage-campaigns/) ## 来源与数据 - [openapi.yaml](https://orbitoads.pro/docs/api/openapi.yaml) - [openapi.json](https://orbitoads.pro/docs/api/openapi.json) --- # 解读 API 错误 [Orbito Ads · 简体中文 · HTML](https://orbitoads.pro/zh/docs/api/errors/) 来源核对日期 · 2026-11-27 ### 浏览文档 [全部文档](/zh/docs/) 快速入门 - [API 快速入门](/zh/docs/api/) - [密钥与账户权限](/zh/docs/api/authentication/) - [将 API 文档交给 AI 助手](/zh/docs/api/ai-assistants/) 基础概念 - [解读 API 错误](/zh/docs/api/errors/) - [请求和事件限额](/zh/docs/api/rate-limits/) - [安全重试同一操作](/zh/docs/api/idempotency/) - [跟踪排队中的操作](/zh/docs/api/tasks/) - [逐页读取广告活动](/zh/docs/api/pagination/) API 参考 - [可访问的广告账户](/zh/docs/api/accounts/) - [查询广告活动](/zh/docs/api/campaigns/) - [创建广告活动与上传媒体](/zh/docs/api/create-campaigns/) - [修改现有广告活动](/zh/docs/api/manage-campaigns/) - [广告活动与账户统计](/zh/docs/api/stats/) - [定向词典与群组](/zh/docs/api/targeting/) 集成 - [接收广告活动事件](/zh/docs/api/webhooks/) - [发送已确认的转化](/zh/docs/api/conversions/) - [API 版本与更新](/zh/docs/api/changelog/) 文件与架构 - [OpenAPI · YAML](/docs/api/openapi.yaml) - [OpenAPI · JSON](/docs/api/openapi.json) - [llms.txt](/zh/docs/llms.txt) - [llms-full.txt](/zh/docs/llms-full.txt) [全部文档](/zh/docs/) 快速入门 - [API 快速入门](/zh/docs/api/) - [密钥与账户权限](/zh/docs/api/authentication/) - [将 API 文档交给 AI 助手](/zh/docs/api/ai-assistants/) 基础概念 - [解读 API 错误](/zh/docs/api/errors/) - [请求和事件限额](/zh/docs/api/rate-limits/) - [安全重试同一操作](/zh/docs/api/idempotency/) - [跟踪排队中的操作](/zh/docs/api/tasks/) - [逐页读取广告活动](/zh/docs/api/pagination/) API 参考 - [可访问的广告账户](/zh/docs/api/accounts/) - [查询广告活动](/zh/docs/api/campaigns/) - [创建广告活动与上传媒体](/zh/docs/api/create-campaigns/) - [修改现有广告活动](/zh/docs/api/manage-campaigns/) - [广告活动与账户统计](/zh/docs/api/stats/) - [定向词典与群组](/zh/docs/api/targeting/) 集成 - [接收广告活动事件](/zh/docs/api/webhooks/) - [发送已确认的转化](/zh/docs/api/conversions/) - [API 版本与更新](/zh/docs/api/changelog/) 文件与架构 - [OpenAPI · YAML](/docs/api/openapi.yaml) - [OpenAPI · JSON](/docs/api/openapi.json) - [llms.txt](/zh/docs/llms.txt) - [llms-full.txt](/zh/docs/llms-full.txt) [Orbito Ads](/zh/) [文档](/zh/docs/) [API](/zh/docs/api/) 结合 HTTP 状态码与机器错误码解读。缺少密钥会返回 401。重试写入前先纠正输入;触发限流后按响应提示等待。 [Markdown](/zh/docs/api/errors.md) ## 响应格式 每个错误都有相同的形状 : 示例 ``` { "success": false, "error": "cpm must be greater than 0", "code": "VALIDATION_ERROR", "param": "campaigns[2].cpm", "request_id": "6f1c2a7e-3b0e-4f39-9a52-0c8d7f1e2b44" } ``` | 田野 | 总的来说 | 意义 | | --- | --- | --- | | `error` | 是的 | 一个人可以读出一句话。 显示它; 不要分析它。 措辞可以改进。 | | `code` | 在所有 v1 出错时是 | 稳定,机器可读 分局负责这个 | | `param` | 输入错误 | 错误的球场,作为一个路径:`cpm`,`campaigns[2].channels[0]`,`account_id`. | | `request_id` | 在大多数错误上 | 与`X-Request-Id`响应头相同,引用支持. | 一些错误增加了上下文:`min_cpm`和`currency`,当Telegram拒绝投标时为过低,`missing`与`UNKNOWN_AD_IDS`相通,`limit`与`QUEUE_FULL`相通. ## HTTP 状态码 | 状态 | 意义 | 退休? | | --- | --- | --- | | 200 | 达尼 | — | | 202 | 接受,在背景中运行——民意调查[任务](/zh/docs/api/tasks/) | — | | 400 | 请求错误( 字段, 值, 缺失 `account_id`) —— 或 Telegram 拒绝更改 。 | 否- 解决请求 | | 401 | 没有钥匙,坏钥匙,也没有钥匙,没有柜子 | 无 | | 403 | 关键或计划不允许这样做 | 无 | | 404 | 在柜子里找不到这个密钥 | 无 | | 409 | 与当前状态相冲突( cabinet 锁定, Telegram会话已过期, 请求相同 ) | 有时——见代码. | | 413 | 文件太大了 | 无 | | 422 | `Idempotency-Key` 重复使用不同的请求 | 否- 使用新密钥 | | 429 | 速率限制或队列已满 | 是, `Retry-After`秒后开始 | | 500 | 我们的bug——已经登录了 | 先读读状态, 然后再用备份重试 | | 503 | 暂时无法提供 | 是,在`Retry-After`号之后 | ## 错误代码 ### 认证和访问 | 代码 | HTTP | 什么要做 | | --- | --- | --- | | `API_KEY_MISSING` | 401 | 发送`X-API-Key`。 | | `API_KEY_INVALID` | 401 | 密钥错误、 被撤销或过期 。 创建新密钥 。 | | `NO_ACCOUNTS` | 401 | 密钥现在没有到达活动相册(内阁失效,访问权限被移除). | | `FORBIDDEN` | 403 | 这种密钥类型不允许所有者使用 。 | | `READ_ONLY_KEY` | 403 | 打开**管理活动** 键在面板中。 | | `WRITE_NOT_ALLOWED` | 403 | 这种密钥类型(由Orbito Ads为合伙人发行)从不写作. | | `VIEW_ONLY_ACCESS` | 403 | 您访问这个柜子是查看器,请询问代理店主是经理。 | | `FEATURE_NOT_AVAILABLE` | 403 | 计划并未包括此行动(回应名称为`feature`). | | `SUBSCRIPTION_REQUIRED` | 403 | 内阁所有者没有主动订阅。 | | `ACCOUNT_INACTIVE` | 403 | 柜子已经失效了 | ### 找到东西 | 代码 | HTTP | 什么要做 | | --- | --- | --- | | `ACCOUNT_ID_REQUIRED` | 400 | 键通到数个柜子(或这个`ad_id`存在于数个柜中)——通过`account_id`. | | `ACCOUNT_NOT_FOUND` | 404 | `account_id` 无法用这把钥匙到达。 请检查 `GET /v1/account/info` 。 | | `CAMPAIGN_NOT_FOUND` | 404 | 在密钥的内阁中没有这样的运动(或删除). | | `TASK_NOT_FOUND` | 404 | 此密钥的主人没有这样的任务 。 | | `NOT_FOUND` | 404 | 这场运动和期间没有统计数据。 | | `UNKNOWN_AD_IDS` | 400 | 某些 `ad_ids` 在大规模通话中,没有广告账户的活动; `missing` 列出他们。 | ### 入口 | 代码 | HTTP | 什么要做 | | --- | --- | --- | | `VALIDATION_ERROR` | 400 | `param`名字段命名;`error`说出出出错来. 未知字段也被拒绝——检查拼写. | | `UNSUPPORTED_MEDIA` | 400 | 上传JPG,PNG,GIF,WEBP或`file`场MP4. | | `FILE_TOO_LARGE` | 413 | 上传一个更小的文件(最多10个MB个). | ### Telegram和内阁州 | 代码 | HTTP | 什么要做 | | --- | --- | --- | | `PLATFORM_REJECTED` | 400 | Telegram拒绝了这一修改;`error`带着它的理由。 低价价格还给你`param: "cpm"`、`min_cpm`和`currency`。 | | `BUDGET_UNCHANGED` | 400 | Telegram接受了顶级广告活动,但广告活动预算没有动静。 请检查内阁平衡(`GET /v1/account/info` ) 。 | | `INSUFFICIENT_AD_BALANCE` | 400 | 你要求退出的比广告活动多 少退出,或者使用`withdraw_all`。 | | `CABINET_AUTH_EXPIRED` | 409 | 内阁的Telegram会话已过期。 所有者在面板上重新连接; 然后重试 。 | | `CABINET_LOCKED` | 409 | 柜子实行自动管理;手动更改被屏蔽. | ### 限制和复议 | 代码 | HTTP | 什么要做 | | --- | --- | --- | | `RATE_LIMITED` | 429 | 等`Retry-After`秒,见[速度限制](/zh/docs/api/rate-limits/) | | `QUEUE_FULL` | 429 | 柜子已经排入了5个操作队列。 等待任务完成, 然后重试( 同为 `Idempotency-Key` 是罚款 ) 。 | | `IDEMPOTENCY_KEY_REQUIRED` | 400 | 增加一个`Idempotency-Key`页头. | | `IDEMPOTENCY_KEY_INVALID` | 400 | 使用8–255个字符;一个UUID是理想的. | | `IDEMPOTENCY_KEY_REUSED` | 422 | 这个键被用于不同的请求——新的操作,新的键. | | `IDEMPOTENCY_IN_PROGRESS` | 409 | 此密钥的第一个请求仍在运行中。 几秒钟后重试 。 | | `IDEMPOTENCY_UNAVAILABLE` | 503 | 什么都没做,用同样的钥匙重试 | | `INGEST_DISABLED` | 403 | 开通**收到邮件** 为密钥([转换](/zh/docs/api/conversions/). | | `INTERNAL_ERROR` | 500 | 我们这边,在重新试写前用GET号机检查状态;如果持续使用`request_id`号机,请联系[@orbitoads](https://t.me/orbitoads). | ## 何时重试请求 - **4X** — 不要修改重试; 修正请求 。 (A 4xx 从未消耗您的`Idempotency-Key`, 这样您就可以用相同的密钥重试固定的请求 ) 。 - **429 / 503** — `Retry-After`后再试. - **5x 写作后** — 变化可能已经达到或没有达到Telegram. 与**同一** `Idempotency-Key`重试返回相同的5xx(通过设计——它防止了双重动作). `GET` 运动去查看发生了什么,然后决定;如果重试,使用一把新钥匙. - **网络时间在写作上** — — 重试**同一** `Idempotency-Key` — — 如果第一次尝试成功,你就能得到结果;如果失败,手术现在就进行。 ## API 参考 完整广告接口需要为此工作区单独配置供应商凭据。客户端请求使用自己的 Orbito API 密钥。账户订购、开通和外部账单分别处理。 示例 · JSON ``` { "httpStatus": 400, "body": { "success": false, "error": "Choose a positive CPM.", "code": "VALIDATION_ERROR", "param": "cpm", "request_id": "example-request-013" } } ``` ## HTTP | 代码 | HTTP | | --- | --- | | `API_KEY_MISSING` | 401 | | `API_KEY_INVALID` | 401 | | `NO_ACCOUNTS` | 401 | | `FORBIDDEN` | 403 | | `READ_ONLY_KEY` | 403 | | `WRITE_NOT_ALLOWED` | 403 | | `VIEW_ONLY_ACCESS` | 403 | | `FEATURE_NOT_AVAILABLE` | 403 | | `SUBSCRIPTION_REQUIRED` | 403 | | `ACCOUNT_INACTIVE` | 403 | | `ACCOUNT_ID_REQUIRED` | 400 | | `ACCOUNT_NOT_FOUND` | 404 | | `CAMPAIGN_NOT_FOUND` | 404 | | `TASK_NOT_FOUND` | 404 | | `NOT_FOUND` | 404 | | `UNKNOWN_AD_IDS` | 400 | | `VALIDATION_ERROR` | 400 | | `UNSUPPORTED_MEDIA` | 400 | | `FILE_TOO_LARGE` | 413 | | `PLATFORM_REJECTED` | 400 | | `BUDGET_UNCHANGED` | 400 | | `INSUFFICIENT_AD_BALANCE` | 400 | | `CABINET_AUTH_EXPIRED` | 409 | | `CABINET_LOCKED` | 409 | | `RATE_LIMITED` | 429 | | `QUEUE_FULL` | 429 | | `IDEMPOTENCY_KEY_REQUIRED` | 400 | | `IDEMPOTENCY_KEY_INVALID` | 400 | | `IDEMPOTENCY_KEY_REUSED` | 422 | | `IDEMPOTENCY_IN_PROGRESS` | 409 | | `IDEMPOTENCY_UNAVAILABLE` | 503 | | `INGEST_DISABLED` | 403 | | `INTERNAL_ERROR` | 500 | ## 实施说明 ## 读取错误响应 错误含 success=false 和 error。客户端用 code 进行处理,联系支持时提供 request_id。param 可指示无效字段,missing 可列出未知广告,出价被拒时可能返回 min_cpm 和 currency。 ## 按状态处理重试 400 检查输入,401 检查认证,403 检查权限,404 检查账户与广告 ID。409 按 code 处理。限额或暂时故障遵循 Retry-After。422 幂等冲突时,真正的新操作要使用新标识。 ## 操作与字段 error code param request_id 401 403 409 422 429 - error - code - param - request_id - 401 - 403 - 409 - 422 - 429 ## 请求示例 GET /api/v1/campaigns/{ad_id}?account_id={account_id} HTTP/1.1 Host: orbitoads.pro X-API-Key: {key} ## 结构字段与限制 本表依据公开的 v1 契约。参数与字段名称区分大小写。各操作的 HTTP 状态码分别表示成功、输入校验和访问检查。链接规范给出了完整的请求与响应结构。 ## 协议参考 | 方法 | 路径 | 参数 | 请求内容 | 响应码 | | --- | --- | --- | --- | --- | | GET | /api/v1/campaigns/{ad_id} | ad_id, account_id | — | 200, 400, 401, 404, 429 | | POST | /api/v1/media | account_id | multipart/form-data · file, account_id | 200, 400, 401, 403, 413 | | POST | /api/v1/campaigns | Idempotency-Key | application/json · CreateSingleRequest \| CreateBatchRequest | 202, 400, 401, 403, 404, 409, 422, 429, 503 | 来源 · [数据来源](https://adsly.pro/docs/api/openapi.yaml) ## 结构字段与限制 · 解读 API 错误 | 字段 | 文档取值 | | --- | --- | | error | string | | code | string | | param | string \| null | | request_id | X-Request-Id | | HTTP 429 | Retry-After | 来源 · [数据来源](https://adsly.pro/docs/api/errors/) ## Error | 字段 | 字段类型 | | --- | --- | | success | false | | error | string | | code | string | | param | string | | request_id | string | | min_cpm | number | | currency | string | | missing | array · [integer] | | limit | integer | 来源 · [数据来源](https://adsly.pro/docs/api/openapi.yaml) ## 相关阅读 [请求和事件限额](/zh/docs/api/rate-limits/)[安全重试同一操作](/zh/docs/api/idempotency/)[跟踪排队中的操作](/zh/docs/api/tasks/)[逐页读取广告活动](/zh/docs/api/pagination/) 参考资料更新日期 2026-10-08 [上一主题**将 API 文档交给 AI 助手**](/zh/docs/api/ai-assistants/)[下一主题**请求和事件限额**](/zh/docs/api/rate-limits/) ## 来源与数据 - [openapi.yaml](https://orbitoads.pro/docs/api/openapi.yaml) - [openapi.json](https://orbitoads.pro/docs/api/openapi.json) --- # 安全重试同一操作 [Orbito Ads · 简体中文 · HTML](https://orbitoads.pro/zh/docs/api/idempotency/) 来源核对日期 · 2026-11-27 ### 浏览文档 [全部文档](/zh/docs/) 快速入门 - [API 快速入门](/zh/docs/api/) - [密钥与账户权限](/zh/docs/api/authentication/) - [将 API 文档交给 AI 助手](/zh/docs/api/ai-assistants/) 基础概念 - [解读 API 错误](/zh/docs/api/errors/) - [请求和事件限额](/zh/docs/api/rate-limits/) - [安全重试同一操作](/zh/docs/api/idempotency/) - [跟踪排队中的操作](/zh/docs/api/tasks/) - [逐页读取广告活动](/zh/docs/api/pagination/) API 参考 - [可访问的广告账户](/zh/docs/api/accounts/) - [查询广告活动](/zh/docs/api/campaigns/) - [创建广告活动与上传媒体](/zh/docs/api/create-campaigns/) - [修改现有广告活动](/zh/docs/api/manage-campaigns/) - [广告活动与账户统计](/zh/docs/api/stats/) - [定向词典与群组](/zh/docs/api/targeting/) 集成 - [接收广告活动事件](/zh/docs/api/webhooks/) - [发送已确认的转化](/zh/docs/api/conversions/) - [API 版本与更新](/zh/docs/api/changelog/) 文件与架构 - [OpenAPI · YAML](/docs/api/openapi.yaml) - [OpenAPI · JSON](/docs/api/openapi.json) - [llms.txt](/zh/docs/llms.txt) - [llms-full.txt](/zh/docs/llms-full.txt) [全部文档](/zh/docs/) 快速入门 - [API 快速入门](/zh/docs/api/) - [密钥与账户权限](/zh/docs/api/authentication/) - [将 API 文档交给 AI 助手](/zh/docs/api/ai-assistants/) 基础概念 - [解读 API 错误](/zh/docs/api/errors/) - [请求和事件限额](/zh/docs/api/rate-limits/) - [安全重试同一操作](/zh/docs/api/idempotency/) - [跟踪排队中的操作](/zh/docs/api/tasks/) - [逐页读取广告活动](/zh/docs/api/pagination/) API 参考 - [可访问的广告账户](/zh/docs/api/accounts/) - [查询广告活动](/zh/docs/api/campaigns/) - [创建广告活动与上传媒体](/zh/docs/api/create-campaigns/) - [修改现有广告活动](/zh/docs/api/manage-campaigns/) - [广告活动与账户统计](/zh/docs/api/stats/) - [定向词典与群组](/zh/docs/api/targeting/) 集成 - [接收广告活动事件](/zh/docs/api/webhooks/) - [发送已确认的转化](/zh/docs/api/conversions/) - [API 版本与更新](/zh/docs/api/changelog/) 文件与架构 - [OpenAPI · YAML](/docs/api/openapi.yaml) - [OpenAPI · JSON](/docs/api/openapi.json) - [llms.txt](/zh/docs/llms.txt) - [llms-full.txt](/zh/docs/llms-full.txt) [Orbito Ads](/zh/) [文档](/zh/docs/) [API](/zh/docs/api/) 每次创建、复制、批量操作或预算更改时分配新的 Idempotency-Key。重试保持相同的键和请求体。复用同一标识提交不同操作会产生冲突。 [Markdown](/zh/docs/api/idempotency.md) 服务器可能已经收到请求,但响应尚未送达客户端,连接便中断了。直接重试可能导致重复充值或创建两份相同的广告活动。使用 `Idempotency-Key`,服务端就能识别对同一操作的重试。 ## 哪些操作需要幂等键 | 终点 | 首席 | | --- | --- | | `POST /v1/campaigns` | 需要的 | | `POST /v1/campaigns/{ad_id}/copy` | 需要的 | | `POST /v1/campaigns/bulk` | 需要的 | | `POST /v1/campaigns/{ad_id}/budget` | 需要的 | | 其他写作(`PATCH`,暂停/重播,`DELETE`,媒体) | 可选择性——他们可以安全地自己重复 | 没有标题,这些返回`400 IDEMPOTENCY_KEY_REQUIRED`。 ## 如何传递幂等键 生成一个新的随机值——一个UUID——**每一次操作** ,并且每次重试操作时都会发送**同一** 的值. 示例 ``` KEY=$(uuidgen) curl -X POST https://orbitoads.pro/api/v1/campaigns/90412/budget \ -H "X-API-Key: $ORBITO_API_KEY" -H "Content-Type: application/json" \ -H "Idempotency-Key: $KEY" \ -d '{"account_id":53,"action":"add","amount":5}' # timed out? run exactly the same command again, with the same $KEY ``` 示例 ``` import uuid, requests def add_budget(ad_id, account_id, amount): key = str(uuid.uuid4()) # one per operation for attempt in range(3): try: return requests.post( f"https://orbitoads.pro/api/v1/campaigns/{ad_id}/budget", headers={"X-API-Key": API_KEY, "Idempotency-Key": key}, json={"account_id": account_id, "action": "add", "amount": amount}, timeout=30, ) except requests.Timeout: continue # same key → never added twice ``` ## 重复请求会返回什么 | 情况 | 答案 | | --- | --- | | 使用此密钥的第一个请求 | 正常运行。 | | 同样的密钥,同样的请求,第一个完成 | **存储** 响应,没有改变,头号为`Idempotent-Replayed: true`. 无事再起. | | 同样的密钥,同样的请求,第一个还在运行 | `409 IDEMPOTENCY_IN_PROGRESS`+`Retry-After` 很快再试. | | 相同的密钥, 不同的正文或端点 | `422 IDEMPOTENCY_KEY_REUSED` 新行动需要新密钥. | | 第一个请求以 4xx 结尾( 错误输入, 计划, 队列满满... ) | 密钥发布:将请求修复并用**同一** 密钥发送. | | 第一次请求以5xx结束 | 5xx被存储并重放——变化可能已经达到Telegram,而密钥存在以阻止其运行两次. 以`GET`来检查广告活动,然后使用新密钥,如果您仍然想要行动的话. | “同一请求”是指同一方法、路径和JSON正文(钥匙顺序并不重要)。 ## 密钥处理规则 - 键被标注在您的API个键上——两个集成无法碰撞. - 密钥保存了24小时。 之后, 相同的值开始新的操作 。 - 任意字符串 8–255 字符有效; 一个 UUID 是正确的默认 。 - 如果我们无法记录密钥,操作不会运行,你会得到 `503 IDEMPOTENCY_UNAVAILABLE` 用同一钥匙退出。 完整广告接口需要为此工作区单独配置供应商凭据。客户端请求使用自己的 Orbito API 密钥。账户订购、开通和外部账单分别处理。 ## 实施说明 ## 每项操作一个标识 创建、复制、批量操作和预算划拨必须传 Idempotency-Key。每项操作生成 8–255 字符的随机值,重试时复用。保留 24 小时,关联 API 密钥、方法、路径及 JSON 内容。 ## 并发重试与请求变更 已完成请求回放时带 Idempotent-Replayed: true。仍在处理的重复请求返回 409 和 Retry-After,同键改内容返回 422。4xx 校验错误释放键,遇到已缓存 5xx 先读取实际对象再发起新操作。 ## 操作与字段 Idempotency-Key Idempotent-Replayed 409 IDEMPOTENCY_IN_PROGRESS 422 IDEMPOTENCY_KEY_REUSED - Idempotency-Key - Idempotent-Replayed - 409 IDEMPOTENCY_IN_PROGRESS - 422 IDEMPOTENCY_KEY_REUSED ## 请求示例 GET /api/v1/tasks/{id} HTTP/1.1 Host: orbitoads.pro X-API-Key: {key} ## 结构字段与限制 本表依据公开的 v1 契约。参数与字段名称区分大小写。各操作的 HTTP 状态码分别表示成功、输入校验和访问检查。链接规范给出了完整的请求与响应结构。 ## 协议参考 | 方法 | 路径 | 参数 | 请求内容 | 响应码 | | --- | --- | --- | --- | --- | | POST | /api/v1/campaigns | Idempotency-Key | application/json · CreateSingleRequest \| CreateBatchRequest | 202, 400, 401, 403, 404, 409, 422, 429, 503 | | POST | /api/v1/campaigns/{ad_id}/copy | ad_id, account_id, Idempotency-Key | application/json · CopyRequest | 202, 400, 401, 403, 404, 409, 422, 429 | | POST | /api/v1/campaigns/bulk | Idempotency-Key | application/json · BulkRequest | 202, 400, 401, 403, 404, 409, 422, 429 | | POST | /api/v1/campaigns/{ad_id}/budget | ad_id, account_id, Idempotency-Key | application/json · BudgetRequest | 200, 400, 401, 403, 404, 409, 422, 429 | 来源 · [数据来源](https://adsly.pro/docs/api/openapi.yaml) ## 结构字段与限制 · 安全重试同一操作 | 字段 | 文档取值 | | --- | --- | | Idempotency-Key | UUID | | 200 / 202 | Idempotent-Replayed: true | | 409 | IDEMPOTENCY_IN_PROGRESS, Retry-After | | 422 | IDEMPOTENCY_KEY_REUSED | 来源 · [数据来源](https://adsly.pro/docs/api/idempotency/) ## 相关阅读 [解读 API 错误](/zh/docs/api/errors/)[请求和事件限额](/zh/docs/api/rate-limits/)[跟踪排队中的操作](/zh/docs/api/tasks/)[逐页读取广告活动](/zh/docs/api/pagination/) 参考资料更新日期 2026-10-08 [上一主题**请求和事件限额**](/zh/docs/api/rate-limits/)[下一主题**跟踪排队中的操作**](/zh/docs/api/tasks/) ## 来源与数据 - [openapi.yaml](https://orbitoads.pro/docs/api/openapi.yaml) - [openapi.json](https://orbitoads.pro/docs/api/openapi.json) --- # 修改现有广告活动 [Orbito Ads · 简体中文 · HTML](https://orbitoads.pro/zh/docs/api/manage-campaigns/) 来源核对日期 · 2026-11-27 ### 浏览文档 [全部文档](/zh/docs/) 快速入门 - [API 快速入门](/zh/docs/api/) - [密钥与账户权限](/zh/docs/api/authentication/) - [将 API 文档交给 AI 助手](/zh/docs/api/ai-assistants/) 基础概念 - [解读 API 错误](/zh/docs/api/errors/) - [请求和事件限额](/zh/docs/api/rate-limits/) - [安全重试同一操作](/zh/docs/api/idempotency/) - [跟踪排队中的操作](/zh/docs/api/tasks/) - [逐页读取广告活动](/zh/docs/api/pagination/) API 参考 - [可访问的广告账户](/zh/docs/api/accounts/) - [查询广告活动](/zh/docs/api/campaigns/) - [创建广告活动与上传媒体](/zh/docs/api/create-campaigns/) - [修改现有广告活动](/zh/docs/api/manage-campaigns/) - [广告活动与账户统计](/zh/docs/api/stats/) - [定向词典与群组](/zh/docs/api/targeting/) 集成 - [接收广告活动事件](/zh/docs/api/webhooks/) - [发送已确认的转化](/zh/docs/api/conversions/) - [API 版本与更新](/zh/docs/api/changelog/) 文件与架构 - [OpenAPI · YAML](/docs/api/openapi.yaml) - [OpenAPI · JSON](/docs/api/openapi.json) - [llms.txt](/zh/docs/llms.txt) - [llms-full.txt](/zh/docs/llms-full.txt) [全部文档](/zh/docs/) 快速入门 - [API 快速入门](/zh/docs/api/) - [密钥与账户权限](/zh/docs/api/authentication/) - [将 API 文档交给 AI 助手](/zh/docs/api/ai-assistants/) 基础概念 - [解读 API 错误](/zh/docs/api/errors/) - [请求和事件限额](/zh/docs/api/rate-limits/) - [安全重试同一操作](/zh/docs/api/idempotency/) - [跟踪排队中的操作](/zh/docs/api/tasks/) - [逐页读取广告活动](/zh/docs/api/pagination/) API 参考 - [可访问的广告账户](/zh/docs/api/accounts/) - [查询广告活动](/zh/docs/api/campaigns/) - [创建广告活动与上传媒体](/zh/docs/api/create-campaigns/) - [修改现有广告活动](/zh/docs/api/manage-campaigns/) - [广告活动与账户统计](/zh/docs/api/stats/) - [定向词典与群组](/zh/docs/api/targeting/) 集成 - [接收广告活动事件](/zh/docs/api/webhooks/) - [发送已确认的转化](/zh/docs/api/conversions/) - [API 版本与更新](/zh/docs/api/changelog/) 文件与架构 - [OpenAPI · YAML](/docs/api/openapi.yaml) - [OpenAPI · JSON](/docs/api/openapi.json) - [llms.txt](/zh/docs/llms.txt) - [llms-full.txt](/zh/docs/llms-full.txt) [Orbito Ads](/zh/) [文档](/zh/docs/) [API](/zh/docs/api/) 可管理文案、链接、出价、每日限额、排期、预算和投放状态。单个批量请求支持最多 1,000 项活动,请查询任务中的局部失败记录。 [Markdown](/zh/docs/api/manage-campaigns.md) 所有电话都需要**管理活动** 和经理(或所有者)进入内阁的钥匙。 他们在一个广告活动中行动,`(account_id, ad_id)`:当钥匙到达多个内阁时,通过`account_id`。 每一次广告活动的历史变化都出现在标有**🔌 API** 的面板上。 | 呼叫 | 它会做什么 | 答案 | | --- | --- | --- | | `PATCH /v1/campaigns/{ad_id}` | 更改文本、链接、出价、上限、时间表、打开/关闭 | 即时 | | `POST /v1/campaigns/{ad_id}/pause` | 切换 | 即时 | | `POST /v1/campaigns/{ad_id}/resume` | 转换 | 即时 | | `POST /v1/campaigns/{ad_id}/budget` | 增加或撤回预算 | 即时 | | `DELETE /v1/campaigns/{ad_id}` | 删除 | 即时 | | `POST /v1/campaigns/{ad_id}/copy` | 1 - 100 份 | 202 + [任务](/zh/docs/api/tasks/) | | `POST /v1/campaigns/bulk` | 一项行动,最多1 000项运动 | 第202章 任务 | 直接回答返回更新的[广告活动项目](/zh/docs/api/campaigns/#doc-note-the-campaign-object) 在`data`。 ## 编辑 `PATCH /v1/campaigns/{ad_id}` — 只发送什么变化 。 示例 ``` curl -s -X PATCH https://orbitoads.pro/api/v1/campaigns/90412 \ -H "X-API-Key: $ORBITO_API_KEY" -H "Content-Type: application/json" \ -d '{ "account_id": 53, "cpm": 1.8, "text": "Daily market notes in 3 minutes." }' ``` | 田野 | 意义 | | --- | --- | | `title`, `text`, `promote_url` | 创意与链接. | | `cpm` | 新出价,超过0分. | | `daily_budget` | 每日的卡普 | | `views_per_user` | 1–4. | | `active` | `true` / `false` — 与恢复/暂停相同. | | `schedule` | 日以继夜地展示广告;`null`取出——参见[时间表](/zh/docs/api/manage-campaigns/#doc-note-schedule). | | `media`, `picture`, `button`, `website_name` | 和[创建](/zh/docs/api/create-campaigns/#doc-note-fields)年一样 | **关于Telegram的评论** Changing `cpm`,`active`或`schedule`并不使用-它们同时应用,广告活动持续进行. 任何其他领域(`title`,`text`,`promote_url`,`media`,`picture`,`button`,`website_name`,`views_per_user`,`daily_budget`)通过Telegram的完整广告形式保存下来,Telegram再次审查广告:它显示`In Review`直到获得批准. 发送出价,上/下和时间表变化,而不是与这些领域一起. 目标设定(`channels`,`countries`,. ) , 无法改变现有的广告 — — Telegram不允许。 创建新的目标设定运动,或[复制](/zh/docs/api/manage-campaigns/#doc-note-copy)并调整。 答复中`meta`: | 田野 | 意义 | | --- | --- | | `status_warning` | 但Telegram没有应用开关(例如没有预算), | | `status_intent_only` | 您的上/下选择被存储并适用于Telegram可以时(在审查中,没有预算). | | `status_already_set` | 广告活动已经在你要求的状态下进行. | 低于Telegram的标价将`400 PLATFORM_REJECTED`和`param: "cpm"`、`min_cpm`和`currency`回报。 ## 暂停与恢复 示例 ``` curl -s -X POST "https://orbitoads.pro/api/v1/campaigns/90412/pause?account_id=53" -H "X-API-Key: $ORBITO_API_KEY" curl -s -X POST "https://orbitoads.pro/api/v1/campaigns/90412/resume?account_id=53" -H "X-API-Key: $ORBITO_API_KEY" ``` `meta.intent_only: true`意味着Telegram还不能对此采取行动 — — 广告活动正在审查中、被否决或预算外 — — 而你的选择被存储起来:它会尽快运行。 当状态真的改变时,你的[网站状态](/zh/docs/api/webhooks/)起火灾就会发生。 ## 广告投放时段 只有在选定的工作日和时间(比如工作日9:00-18:00)或晚上才进行广告活动。 Telegram小时以外的时间并不展示广告。 设定、更改或删除时间表不会改变或关闭广告活动 — — `status`和`active`保持原样。 它在每个内阁类型上都有效。 示例 ``` curl -s -X PATCH https://orbitoads.pro/api/v1/campaigns/90412 \ -H "X-API-Key: $ORBITO_API_KEY" -H "Content-Type: application/json" \ -d '{ "account_id": 53, "schedule": { "days": { "mon": [9,10,11,12,13,14,15,16,17], "tue": [9,10,11,12,13,14,15,16,17], "wed": [9,10,11,12,13,14,15,16,17], "thu": [9,10,11,12,13,14,15,16,17], "fri": [9,10,11,12,13,14,15,16,17] }, "timezone": "+03:00" } }' ``` | 田野 | 意义 | | --- | --- | | `days` | `mon`, `tue`, `wed`, `thu`, `fri`, `sat`, `sun` 每人都有时间(0~23)的广告在那一天运行。 `9` 意味着 09:00–09:59是的, `[9, …, 17]` 是 9:00–18:00. 有一天你离开,或者发送 `[]`没有跑。 总共至少一个小时。 | | `timezone` | `"viewer"`——每个观众自己的当地时间;只针对观众(`target_type: "users"`),否则,UTC冲抵:`"+03:00"`、`"-05:00"`、`"+05:30"`。Telegram冲抵:从`-12:00`至`+14:00`的全程时间,加上`-09:30`、`-03:30`、`-02:30`、`+03:30`、`+04:30`、`+05:30`、`+05:45`、`+06:30`、`+08:45`、`+09:30`、`+10:30`、`+12:45`、`+13:45`、`"UTC+3"`和`"+3"`。 | `"schedule": null`移除了时间表——广告再次昼夜跑出. **没有预算的广告活动不能有时间表。** Telegram只接受一个可以展开的广告活动的时间表,所以在`Stopped`的广告活动上,你得到`400 PLATFORM_REJECTED`和`param: "schedule"`一无所有,而且没有任何改变——先增加预算,然后设定日程,暂停的(`On Hold`)广告活动可以顺利进行. 运动对象以相同的形状返回时间表,总是所有7天,并写为`"+03:00"`的抵消——这样你就可以读取,更改一天并发回. `GET /v1/campaigns/{ad_id}`给出了目前的时间表,即使它是在Telegram年直接被更改的——见[新鲜](/zh/docs/api/campaigns/#doc-heading-freshness). 0–23外的小时,未知的一天,空的日程,在频道/bot/搜索广告上的`"viewer"`或抵消Telegram并不能提供~`400 VALIDATION_ERROR`,准确的球场在`param`(例如`schedule.days.mon`). [复印件](/zh/docs/api/manage-campaigns/#doc-note-copy)和重现的广告活动保持了他们来自的广告活动时间表。 为了同时为许多广告活动设定一个时间表,请使用`set_schedule`号大片行动。 ## 广告活动预算 `POST /v1/campaigns/{ad_id}/budget`在内阁和广告活动之间移动金钱,需要`Idempotency-Key`美元。 示例 ``` curl -s -X POST https://orbitoads.pro/api/v1/campaigns/90412/budget \ -H "X-API-Key: $ORBITO_API_KEY" -H "Content-Type: application/json" \ -H "Idempotency-Key: $(uuidgen)" \ -d '{ "account_id": 53, "action": "add", "amount": 10 }' ``` | `action` | `amount` | 效应 | | --- | --- | --- | | `add` | 需要的 | 内阁平衡-广告活动. | | `withdraw` | 需要的 | 运动 —— 内阁平衡,比运动多 —— `400 INSUFFICIENT_AD_BALANCE`。 | | `withdraw_all` | — | 广告活动中留下的一切 内阁的平衡 | `meta.moved`是实际移动的;`meta.partial`是`true`,因为比要求的要少才能取出。 钱从不通过API离开内阁。 ## 复制广告活动 `POST /v1/campaigns/{ad_id}/copy` 创建具有相同目标的复制件; 任何您发送的复制件都会超过原件。 需要`Idempotency-Key` 。 返回复制件为`ad_ids` 的任务 。 示例 ``` { "account_id": 53, "copies": 3, "text": "Variant B — shorter", "cpm": 2, "budget": 5 } ``` | 田野 | 意义 | | --- | --- | | `copies` | 1–100,默认值 1. | | `title`, `text`, `promote_url`, `cpm`, `budget`, `media`, `picture`, `views_per_user` | `budget`:`0` 或至少内阁的`min_budget`。 | | `schedule` | 副本保存原件的[时间表](/zh/docs/api/manage-campaigns/#doc-note-schedule);发送一份来取而代之,或`null`份无。 | | `group_id` / `new_group_name` | 把拷贝放入一组. | ## 删除 示例 ``` curl -s -X DELETE "https://orbitoads.pro/api/v1/campaigns/90412?account_id=53" -H "X-API-Key: $ORBITO_API_KEY" ``` 示例 ``` { "success": true, "data": { "ad_id": 90412, "account_id": 53, "deleted": true } } ``` 已删除的、 有 `status: "Deleted"` 个数据保留了视图的广告活动被删除。 删除后返回 `404 CAMPAIGN_NOT_FOUND` 。 ## 批量操作 `POST /v1/campaigns/bulk`对一个内阁的多达1 000次广告活动采取了一项行动。需要`Idempotency-Key`次广告活动。 示例 ``` curl -s -X POST https://orbitoads.pro/api/v1/campaigns/bulk \ -H "X-API-Key: $ORBITO_API_KEY" -H "Content-Type: application/json" \ -H "Idempotency-Key: $(uuidgen)" \ -d '{ "account_id": 53, "action": "set_cpm", "cpm": 1.2, "ad_ids": [90412, 90413, 90414] }' ``` | `action` | 额外的田野 | 效应 | | --- | --- | --- | | `pause` | — | 切换 | | `resume` | — | 转换 | | `add_budget` | `amount` | 在每个运动中增加 | | `withdraw_budget` | `amount` | 退出每个运动 | | `withdraw_all_budget` | — | 从每次广告活动中撤走一切 | | `set_cpm` | `cpm` | 给每个都设置相同的出价 | | `set_schedule` | `schedule` | 每个都设置相同的[时间表](/zh/docs/api/manage-campaigns/#doc-note-schedule); `"schedule": null` 移除它 | | `delete` | — | 删除每一个 | 每`ad_id`次必须是该内阁的现场宣传;否则就不会排队,在`missing`年你和罪犯一起得到`400 UNKNOWN_AD_IDS`次。 重复被忽略了。 任务`errors`列出了Telegram次活动被拒绝 — — `set_schedule`次活动,也没有预算,`"timezone": "viewer"`因为没有针对观众而不能申请。 ## 如何暂停单次行动成本过高的广告活动 示例 ``` import os, uuid, requests API = "https://orbitoads.pro/api/v1" H = {"X-API-Key": os.environ["ORBITO_API_KEY"]} ACCOUNT, MAX_CPA = 53, 4.0 stats = requests.get(f"{API}/stats", params={"period": "1d"}, headers=H, timeout=60).json()["data"] # cost per action = spend / actions, computed here so the rule means exactly that expensive = [int(ad_id) for ad_id, s in stats.get(str(ACCOUNT), {}).items() if s["actions"] > 0 and s["spent"] / s["actions"] > MAX_CPA] if expensive: r = requests.post(f"{API}/campaigns/bulk", headers={**H, "Idempotency-Key": str(uuid.uuid4())}, json={"account_id": ACCOUNT, "action": "pause", "ad_ids": expensive}, timeout=60) print(r.status_code, r.json()["data"]["id"]) ``` ## API 参考 完整广告接口需要为此工作区单独配置供应商凭据。客户端请求使用自己的 Orbito API 密钥。账户订购、开通和外部账单分别处理。 ## PATCH `/api/v1/campaigns/{ad_id}` 仅更新请求中给出的广告设置。 | 参数 | 位置 | 格式 | 必填 | | --- | --- | --- | --- | | `ad_id` | path | `integer` | 是 | | `account_id` | query | `integer` | — | | `X-API-Key` | header | `string` | 是 | | `Idempotency-Key` | header | `string` | — | cURL ``` curl -X PATCH 'https://orbitoads.pro/api/v1/campaigns/38017?account_id=7401' \ -H 'X-API-Key: YOUR_ORBITO_KEY' \ -H 'Content-Type: application/json' \ --data '{ "cpm": 1.4 }' ``` HTTP 200 ``` { "success": true, "data": { "account_id": 7401, "ad_id": 38017, "title": "Conversation club · November", "text": "See this month’s language club schedule.", "status": "Active", "active": true, "promote_url": "https://school.example/club", "tme_path": null, "target_type": "users", "targets": [], "cpm": "1.40", "budget": "36.00", "spent": "4.00", "daily_budget": "8.00", "views": 3200, "opens": 0, "clicks": 32, "actions": 4, "ctr": "1.00", "cvr": "12.50", "cpc": "0.125", "cpa": "1.00", "views_per_user": 2, "schedule": null, "has_media": false, "media_type": null, "button": "learn_more", "website_name": "Example language school", "group_id": 516, "auto_cpm_enabled": false, "date": "1793620800", "synced_at": "2026-11-03T12:00:00Z", "status_changed_at": "2026-11-03T12:00:00Z" } } ``` ### 请求体结构 JSON Schema ``` { "minProperties": 1, "properties": { "account_id": { "type": "integer" }, "active": { "type": "boolean" }, "button": { "enum": [ "subscribe", "view", "read", "learn_more", "download", "open", "sign_up", "buy", "order", "play", "try", "leave_request" ], "type": "string" }, "cpm": { "exclusiveMinimum": 0, "type": "number" }, "daily_budget": { "minimum": 0, "type": "number" }, "media": { "type": "string" }, "picture": { "type": "boolean" }, "promote_url": { "maxLength": 2048, "type": "string" }, "schedule": { "additionalProperties": false, "properties": { "days": { "additionalProperties": false, "properties": { "fri": { "items": { "maximum": 23, "minimum": 0, "type": "integer" }, "maxItems": 24, "type": "array" }, "mon": { "items": { "maximum": 23, "minimum": 0, "type": "integer" }, "maxItems": 24, "type": "array" }, "sat": { "items": { "maximum": 23, "minimum": 0, "type": "integer" }, "maxItems": 24, "type": "array" }, "sun": { "items": { "maximum": 23, "minimum": 0, "type": "integer" }, "maxItems": 24, "type": "array" }, "thu": { "items": { "maximum": 23, "minimum": 0, "type": "integer" }, "maxItems": 24, "type": "array" }, "tue": { "items": { "maximum": 23, "minimum": 0, "type": "integer" }, "maxItems": 24, "type": "array" }, "wed": { "items": { "maximum": 23, "minimum": 0, "type": "integer" }, "maxItems": 24, "type": "array" } }, "type": "object" }, "timezone": { "type": "string" } }, "required": [ "days", "timezone" ], "type": [ "object", "null" ] }, "text": { "maxLength": 4096, "type": "string" }, "title": { "maxLength": 255, "type": "string" }, "views_per_user": { "maximum": 4, "minimum": 1, "type": "integer" }, "website_name": { "maxLength": 255, "type": "string" } }, "type": "object" } ``` 请求结果与响应字段 | API | 含义 | | --- | --- | | status_warning | 字段已保存,但投放开关未能生效,例如预算不足。 | | status_intent_only | 目标状态已记录,待审核或预算条件允许后可生效。 | | status_already_set | 广告活动已处于所请求的状态。 | [跟踪排队中的操作](/zh/docs/api/tasks/) ## POST `/api/v1/campaigns/{ad_id}/pause` 请求暂停广告投放。 | 参数 | 位置 | 格式 | 必填 | | --- | --- | --- | --- | | `ad_id` | path | `integer` | 是 | | `account_id` | query | `integer` | — | | `X-API-Key` | header | `string` | 是 | | `Idempotency-Key` | header | `string` | — | cURL ``` curl -X POST 'https://orbitoads.pro/api/v1/campaigns/38017/pause?account_id=7401' \ -H 'X-API-Key: YOUR_ORBITO_KEY' ``` HTTP 200 ``` { "success": true, "data": { "account_id": 7401, "ad_id": 38017, "title": "Conversation club · November", "text": "See this month’s language club schedule.", "status": "On Hold", "active": false, "promote_url": "https://school.example/club", "tme_path": null, "target_type": "users", "targets": [], "cpm": "1.25", "budget": "36.00", "spent": "4.00", "daily_budget": "8.00", "views": 3200, "opens": 0, "clicks": 32, "actions": 4, "ctr": "1.00", "cvr": "12.50", "cpc": "0.125", "cpa": "1.00", "views_per_user": 2, "schedule": null, "has_media": false, "media_type": null, "button": "learn_more", "website_name": "Example language school", "group_id": 516, "auto_cpm_enabled": false, "date": "1793620800", "synced_at": "2026-11-03T12:00:00Z", "status_changed_at": "2026-11-03T12:00:00Z" }, "meta": { "intent_only": false } } ``` ## POST `/api/v1/campaigns/{ad_id}/resume` 请求在满足投放条件时恢复广告。 | 参数 | 位置 | 格式 | 必填 | | --- | --- | --- | --- | | `ad_id` | path | `integer` | 是 | | `account_id` | query | `integer` | — | | `X-API-Key` | header | `string` | 是 | | `Idempotency-Key` | header | `string` | — | cURL ``` curl -X POST 'https://orbitoads.pro/api/v1/campaigns/38017/resume?account_id=7401' \ -H 'X-API-Key: YOUR_ORBITO_KEY' ``` HTTP 200 ``` { "success": true, "data": { "account_id": 7401, "ad_id": 38017, "title": "Conversation club · November", "text": "See this month’s language club schedule.", "status": "Active", "active": true, "promote_url": "https://school.example/club", "tme_path": null, "target_type": "users", "targets": [], "cpm": "1.25", "budget": "36.00", "spent": "4.00", "daily_budget": "8.00", "views": 3200, "opens": 0, "clicks": 32, "actions": 4, "ctr": "1.00", "cvr": "12.50", "cpc": "0.125", "cpa": "1.00", "views_per_user": 2, "schedule": null, "has_media": false, "media_type": null, "button": "learn_more", "website_name": "Example language school", "group_id": 516, "auto_cpm_enabled": false, "date": "1793620800", "synced_at": "2026-11-03T12:00:00Z", "status_changed_at": "2026-11-03T12:00:00Z" }, "meta": { "intent_only": false } } ``` ## POST `/api/v1/campaigns/{ad_id}/budget` 在账户余额和单条广告之间划拨预算。 | 参数 | 位置 | 格式 | 必填 | | --- | --- | --- | --- | | `ad_id` | path | `integer` | 是 | | `account_id` | query | `integer` | — | | `Idempotency-Key` | header | `string` | 是 | | `X-API-Key` | header | `string` | 是 | cURL ``` curl -X POST 'https://orbitoads.pro/api/v1/campaigns/38017/budget?account_id=7401' \ -H 'X-API-Key: YOUR_ORBITO_KEY' \ -H 'Idempotency-Key: 2033d50c-b32b-44aa-8e40-3e236c474810' \ -H 'Content-Type: application/json' \ --data '{ "action": "add", "amount": 5 }' ``` HTTP 200 ``` { "success": true, "data": { "account_id": 7401, "ad_id": 38017, "title": "Conversation club · November", "text": "See this month’s language club schedule.", "status": "Active", "active": true, "promote_url": "https://school.example/club", "tme_path": null, "target_type": "users", "targets": [], "cpm": "1.25", "budget": "41.00", "spent": "4.00", "daily_budget": "8.00", "views": 3200, "opens": 0, "clicks": 32, "actions": 4, "ctr": "1.00", "cvr": "12.50", "cpc": "0.125", "cpa": "1.00", "views_per_user": 2, "schedule": null, "has_media": false, "media_type": null, "button": "learn_more", "website_name": "Example language school", "group_id": 516, "auto_cpm_enabled": false, "date": "1793620800", "synced_at": "2026-11-03T12:00:00Z", "status_changed_at": "2026-11-03T12:00:00Z" }, "meta": { "action": "add", "moved": 5, "partial": false } } ``` ### 请求体结构 JSON Schema ``` { "properties": { "account_id": { "type": "integer" }, "action": { "enum": [ "add", "withdraw", "withdraw_all" ], "type": "string" }, "amount": { "exclusiveMinimum": 0, "type": "number" } }, "required": [ "action" ], "type": "object" } ``` ## POST `/api/v1/campaigns/{ad_id}/copy` 排队创建最多 100 份副本,继承定向,可覆盖部分设置。 | 参数 | 位置 | 格式 | 必填 | | --- | --- | --- | --- | | `ad_id` | path | `integer` | 是 | | `account_id` | query | `integer` | — | | `Idempotency-Key` | header | `string` | 是 | | `X-API-Key` | header | `string` | 是 | cURL ``` curl -X POST 'https://orbitoads.pro/api/v1/campaigns/38017/copy?account_id=7401' \ -H 'X-API-Key: YOUR_ORBITO_KEY' \ -H 'Idempotency-Key: 2033d50c-b32b-44aa-8e40-3e236c474811' \ -H 'Content-Type: application/json' \ --data '{ "copies": 2, "budget": 0, "title": "Club · second draft", "group_id": 516 }' ``` HTTP 202 ``` { "success": true, "data": { "id": 96203, "type": "copy", "status": "pending", "account_id": 7401, "total": 2, "ad_ids": [] } } ``` ### 请求体结构 JSON Schema ``` { "properties": { "account_id": { "type": "integer" }, "budget": { "minimum": 0, "type": "number" }, "copies": { "default": 1, "maximum": 100, "minimum": 1, "type": "integer" }, "cpm": { "exclusiveMinimum": 0, "type": "number" }, "group_id": { "type": "integer" }, "media": { "type": "string" }, "new_group_name": { "type": "string" }, "picture": { "type": "boolean" }, "promote_url": { "type": "string" }, "schedule": { "additionalProperties": false, "properties": { "days": { "additionalProperties": false, "properties": { "fri": { "items": { "maximum": 23, "minimum": 0, "type": "integer" }, "maxItems": 24, "type": "array" }, "mon": { "items": { "maximum": 23, "minimum": 0, "type": "integer" }, "maxItems": 24, "type": "array" }, "sat": { "items": { "maximum": 23, "minimum": 0, "type": "integer" }, "maxItems": 24, "type": "array" }, "sun": { "items": { "maximum": 23, "minimum": 0, "type": "integer" }, "maxItems": 24, "type": "array" }, "thu": { "items": { "maximum": 23, "minimum": 0, "type": "integer" }, "maxItems": 24, "type": "array" }, "tue": { "items": { "maximum": 23, "minimum": 0, "type": "integer" }, "maxItems": 24, "type": "array" }, "wed": { "items": { "maximum": 23, "minimum": 0, "type": "integer" }, "maxItems": 24, "type": "array" } }, "type": "object" }, "timezone": { "type": "string" } }, "required": [ "days", "timezone" ], "type": [ "object", "null" ] }, "text": { "type": "string" }, "title": { "type": "string" }, "views_per_user": { "maximum": 4, "minimum": 1, "type": "integer" } }, "type": "object" } ``` ## POST `/api/v1/campaigns/bulk` 对同一账户最多 1,000 条广告排队执行同一操作。 | 参数 | 位置 | 格式 | 必填 | | --- | --- | --- | --- | | `Idempotency-Key` | header | `string` | 是 | | `X-API-Key` | header | `string` | 是 | cURL ``` curl -X POST https://orbitoads.pro/api/v1/campaigns/bulk \ -H 'X-API-Key: YOUR_ORBITO_KEY' \ -H 'Idempotency-Key: 2033d50c-b32b-44aa-8e40-3e236c474812' \ -H 'Content-Type: application/json' \ --data '{ "account_id": 7401, "action": "set_cpm", "cpm": 1.4, "ad_ids": [ 38017, 38018 ] }' ``` HTTP 202 ``` { "success": true, "data": { "id": 96203, "type": "cpm", "status": "pending", "account_id": 7401, "total": 2, "ad_ids": [] } } ``` ### 请求体结构 JSON Schema ``` { "properties": { "account_id": { "type": "integer" }, "action": { "enum": [ "pause", "resume", "add_budget", "withdraw_budget", "withdraw_all_budget", "set_cpm", "set_schedule", "delete" ], "type": "string" }, "ad_ids": { "items": { "type": "integer" }, "maxItems": 1000, "minItems": 1, "type": "array" }, "amount": { "exclusiveMinimum": 0, "type": "number" }, "cpm": { "exclusiveMinimum": 0, "type": "number" }, "schedule": { "additionalProperties": false, "properties": { "days": { "additionalProperties": false, "properties": { "fri": { "items": { "maximum": 23, "minimum": 0, "type": "integer" }, "maxItems": 24, "type": "array" }, "mon": { "items": { "maximum": 23, "minimum": 0, "type": "integer" }, "maxItems": 24, "type": "array" }, "sat": { "items": { "maximum": 23, "minimum": 0, "type": "integer" }, "maxItems": 24, "type": "array" }, "sun": { "items": { "maximum": 23, "minimum": 0, "type": "integer" }, "maxItems": 24, "type": "array" }, "thu": { "items": { "maximum": 23, "minimum": 0, "type": "integer" }, "maxItems": 24, "type": "array" }, "tue": { "items": { "maximum": 23, "minimum": 0, "type": "integer" }, "maxItems": 24, "type": "array" }, "wed": { "items": { "maximum": 23, "minimum": 0, "type": "integer" }, "maxItems": 24, "type": "array" } }, "type": "object" }, "timezone": { "type": "string" } }, "required": [ "days", "timezone" ], "type": [ "object", "null" ] } }, "required": [ "action", "ad_ids" ], "type": "object" } ``` ## DELETE `/api/v1/campaigns/{ad_id}` 移除广告,保留已有的历史投放统计。 | 参数 | 位置 | 格式 | 必填 | | --- | --- | --- | --- | | `ad_id` | path | `integer` | 是 | | `account_id` | query | `integer` | — | | `X-API-Key` | header | `string` | 是 | | `Idempotency-Key` | header | `string` | — | cURL ``` curl -X DELETE 'https://orbitoads.pro/api/v1/campaigns/38017?account_id=7401' \ -H 'X-API-Key: YOUR_ORBITO_KEY' ``` HTTP 200 ``` { "success": true, "data": { "ad_id": 38017, "account_id": 7401, "deleted": true } } ``` ## 实施说明 ## 可编辑字段与时段 修改 cpm、active、schedule 无需重新审核素材,修改素材字段可能触发审核。原有定向保持固定。按星期和 0–23 小时并指定 UTC 偏移,users 定向支持 viewer,设为 null 移除时段。 ## 账户内部预算划拨 add 将额度转入广告。withdraw 转回指定金额,withdraw_all 将剩余预算转回账户。查看 meta.moved 和 meta.partial。外部充值、开票及退款使用账务流程。 ## 受理与完成 创建、复制和批量操作返回 HTTP 202 及任务 ID。按 Retry-After 轮询 GET /api/v1/tasks/{id}。即使状态为 completed,也要检查 failed 和 errors。 ## 操作与字段 PATCH /api/v1/campaigns/{ad_id} POST /api/v1/campaigns/{ad_id}/pause POST /api/v1/campaigns/{ad_id}/resume POST /api/v1/campaigns/{ad_id}/budget POST /api/v1/campaigns/{ad_id}/copy POST /api/v1/campaigns/bulk - PATCH /api/v1/campaigns/{ad_id} - POST /api/v1/campaigns/{ad_id}/pause - POST /api/v1/campaigns/{ad_id}/resume - POST /api/v1/campaigns/{ad_id}/budget - POST /api/v1/campaigns/{ad_id}/copy - POST /api/v1/campaigns/bulk ## 请求示例 GET /api/v1/campaigns/{ad_id}?account_id={account_id} HTTP/1.1 Host: orbitoads.pro X-API-Key: {key} ## 结构字段与限制 本表依据公开的 v1 契约。参数与字段名称区分大小写。各操作的 HTTP 状态码分别表示成功、输入校验和访问检查。链接规范给出了完整的请求与响应结构。 ## 协议参考 | 方法 | 路径 | 参数 | 请求内容 | 响应码 | | --- | --- | --- | --- | --- | | PATCH | /api/v1/campaigns/{ad_id} | ad_id, account_id | application/json · UpdateRequest | 200, 400, 401, 403, 404, 409, 429 | | POST | /api/v1/campaigns/{ad_id}/pause | ad_id, account_id | — | 200, 400, 401, 403, 404, 409, 429 | | POST | /api/v1/campaigns/{ad_id}/resume | ad_id, account_id | — | 200, 400, 401, 403, 404, 409, 429 | | POST | /api/v1/campaigns/{ad_id}/budget | ad_id, account_id, Idempotency-Key | application/json · BudgetRequest | 200, 400, 401, 403, 404, 409, 422, 429 | | POST | /api/v1/campaigns/{ad_id}/copy | ad_id, account_id, Idempotency-Key | application/json · CopyRequest | 202, 400, 401, 403, 404, 409, 422, 429 | | POST | /api/v1/campaigns/bulk | Idempotency-Key | application/json · BulkRequest | 202, 400, 401, 403, 404, 409, 422, 429 | | DELETE | /api/v1/campaigns/{ad_id} | ad_id, account_id | — | 200, 400, 401, 403, 404, 409, 429 | 来源 · [数据来源](https://adsly.pro/docs/api/openapi.yaml) ## 结构字段与限制 · 修改现有广告活动 | 字段 | 文档取值 | | --- | --- | | BulkRequest.ad_ids[] | 1 … 1,000 | | CopyRequest.copies | 1 … 100 | | BudgetRequest.action | add \| withdraw \| withdraw_all | | BulkRequest.action | pause \| resume \| add_budget \| withdraw_budget \| withdraw_all_budget \| set_cpm \| set_schedule \| delete | | Schedule | days, timezone | 来源 · [数据来源](https://adsly.pro/docs/api/manage-campaigns/) ## UpdateRequest | 字段 | 字段类型 | | --- | --- | | title | string | | text | string | | promote_url | string | | cpm | number | | daily_budget | number · 0 … ∞ | | views_per_user | integer · 1 … 4 | | media | string | | picture | boolean | | button | subscribe \| view \| read \| learn_more \| download \| open \| sign_up \| buy \| order \| play \| try \| leave_request | | website_name | string | | schedule | Schedule | | account_id | integer | | active | boolean | 来源 · [数据来源](https://adsly.pro/docs/api/openapi.yaml) ## BudgetRequest | 字段 | 字段类型 | | --- | --- | | account_id | integer | | action | add \| withdraw \| withdraw_all | | amount | number | 来源 · [数据来源](https://adsly.pro/docs/api/openapi.yaml) ## CopyRequest | 字段 | 字段类型 | | --- | --- | | account_id | integer | | copies | integer · 1 … 100 · = 1 | | title | string | | text | string | | promote_url | string | | cpm | number | | budget | number · 0 … ∞ | | media | string | | picture | boolean | | views_per_user | integer · 1 … 4 | | schedule | Schedule | | group_id | integer | | new_group_name | string | 来源 · [数据来源](https://adsly.pro/docs/api/openapi.yaml) ## BulkRequest | 字段 | 字段类型 | | --- | --- | | account_id | integer | | action | pause \| resume \| add_budget \| withdraw_budget \| withdraw_all_budget \| set_cpm \| set_schedule \| delete | | ad_ids | array · [integer] · 1 … 1000 | | amount | number | | cpm | number | | schedule | Schedule | 来源 · [数据来源](https://adsly.pro/docs/api/openapi.yaml) ## Schedule | 字段 | 字段类型 | | --- | --- | | days | object | | timezone | string | 来源 · [数据来源](https://adsly.pro/docs/api/openapi.yaml) ## 相关阅读 [可访问的广告账户](/zh/docs/api/accounts/)[查询广告活动](/zh/docs/api/campaigns/)[创建广告活动与上传媒体](/zh/docs/api/create-campaigns/)[广告活动与账户统计](/zh/docs/api/stats/)[定向词典与群组](/zh/docs/api/targeting/) 参考资料更新日期 2026-10-08 [上一主题**创建广告活动与上传媒体**](/zh/docs/api/create-campaigns/)[下一主题**广告活动与账户统计**](/zh/docs/api/stats/) ## 来源与数据 - [openapi.yaml](https://orbitoads.pro/docs/api/openapi.yaml) - [openapi.json](https://orbitoads.pro/docs/api/openapi.json) --- # 逐页读取广告活动 [Orbito Ads · 简体中文 · HTML](https://orbitoads.pro/zh/docs/api/pagination/) 来源核对日期 · 2026-11-27 ### 浏览文档 [全部文档](/zh/docs/) 快速入门 - [API 快速入门](/zh/docs/api/) - [密钥与账户权限](/zh/docs/api/authentication/) - [将 API 文档交给 AI 助手](/zh/docs/api/ai-assistants/) 基础概念 - [解读 API 错误](/zh/docs/api/errors/) - [请求和事件限额](/zh/docs/api/rate-limits/) - [安全重试同一操作](/zh/docs/api/idempotency/) - [跟踪排队中的操作](/zh/docs/api/tasks/) - [逐页读取广告活动](/zh/docs/api/pagination/) API 参考 - [可访问的广告账户](/zh/docs/api/accounts/) - [查询广告活动](/zh/docs/api/campaigns/) - [创建广告活动与上传媒体](/zh/docs/api/create-campaigns/) - [修改现有广告活动](/zh/docs/api/manage-campaigns/) - [广告活动与账户统计](/zh/docs/api/stats/) - [定向词典与群组](/zh/docs/api/targeting/) 集成 - [接收广告活动事件](/zh/docs/api/webhooks/) - [发送已确认的转化](/zh/docs/api/conversions/) - [API 版本与更新](/zh/docs/api/changelog/) 文件与架构 - [OpenAPI · YAML](/docs/api/openapi.yaml) - [OpenAPI · JSON](/docs/api/openapi.json) - [llms.txt](/zh/docs/llms.txt) - [llms-full.txt](/zh/docs/llms-full.txt) [全部文档](/zh/docs/) 快速入门 - [API 快速入门](/zh/docs/api/) - [密钥与账户权限](/zh/docs/api/authentication/) - [将 API 文档交给 AI 助手](/zh/docs/api/ai-assistants/) 基础概念 - [解读 API 错误](/zh/docs/api/errors/) - [请求和事件限额](/zh/docs/api/rate-limits/) - [安全重试同一操作](/zh/docs/api/idempotency/) - [跟踪排队中的操作](/zh/docs/api/tasks/) - [逐页读取广告活动](/zh/docs/api/pagination/) API 参考 - [可访问的广告账户](/zh/docs/api/accounts/) - [查询广告活动](/zh/docs/api/campaigns/) - [创建广告活动与上传媒体](/zh/docs/api/create-campaigns/) - [修改现有广告活动](/zh/docs/api/manage-campaigns/) - [广告活动与账户统计](/zh/docs/api/stats/) - [定向词典与群组](/zh/docs/api/targeting/) 集成 - [接收广告活动事件](/zh/docs/api/webhooks/) - [发送已确认的转化](/zh/docs/api/conversions/) - [API 版本与更新](/zh/docs/api/changelog/) 文件与架构 - [OpenAPI · YAML](/docs/api/openapi.yaml) - [OpenAPI · JSON](/docs/api/openapi.json) - [llms.txt](/zh/docs/llms.txt) - [llms-full.txt](/zh/docs/llms-full.txt) [Orbito Ads](/zh/) [文档](/zh/docs/) [API](/zh/docs/api/) 从空 cursor 开始,保持过滤条件不变,使用 meta.next_cursor 翻页直到其为 null。每页最多返回 500 条活动记录。 [Markdown](/zh/docs/api/pagination.md) 仅 `GET /v1/campaigns` 列表使用分页,支持两种模式。 ## 游标分页 首次请求发送空的 `cursor=`,随后使用返回的 `meta.next_cursor`,直到其值为 `null`。 示例 ``` curl -s "https://orbitoads.pro/api/v1/campaigns?limit=500&cursor=" -H "X-API-Key: $ORBITO_API_KEY" ``` 示例 ``` { "success": true, "data": [ { "ad_id": 90412, "account_id": 53, "…": "…" } ], "meta": { "limit": 500, "cursor": null, "next_cursor": "eyJhIjo1MywiaSI6OTAzMTB9", "hasMore": true } } ``` 示例 ``` def all_campaigns(): cursor = "" while True: r = requests.get("https://orbitoads.pro/api/v1/campaigns", params={"limit": 500, "cursor": cursor}, headers={"X-API-Key": API_KEY}, timeout=60).json() yield from r["data"] cursor = r["meta"]["next_cursor"] if not cursor: break ``` - 将光标视为不透明。 它仅对相同的过滤器有效 。 - 秩序是固定的(cabinet,后为最新`ad_id`先行),因此页面在加入广告活动的同时保持稳定. - 没有上限——这就是你如何读取一个10万个广告活动的内阁. - 滤镜`bot_username`,`promote_domain`和`type`总是使用光标模式. - cursor 模式省略出几个重字段(目标摘要,媒体,最后动作). 使用[`GET /v1/campaigns/{ad_id}`](/zh/docs/api/campaigns/#doc-note-get-one-campaign)来完整记录一次战役. ## 小型账户的偏移量分页 没有`cursor`,端点页有`limit`和`offset`并可以排序(`sortBy`,`sortOrder`). 它最多读取了**广告账户500个活动** :过去`meta.truncated`是`true`,`meta.next_step`指示您切换到光标模式. 示例 ``` "meta": { "total": 1240, "limit": 100, "offset": 0, "hasMore": true, "truncated": true, "next_step": "Use ?cursor= for full traversal beyond 500 campaigns per cabinet" } ``` ## 每页数量 每页 `limit` 可设为 1–500,默认 100。 ## API 参考 完整广告接口需要为此工作区单独配置供应商凭据。客户端请求使用自己的 Orbito API 密钥。账户订购、开通和外部账单分别处理。 示例 · cURL ``` curl -X GET 'https://orbitoads.pro/api/v1/campaigns?account_id=7401&status=Active%2COn+Hold&limit=25&cursor=' \ -H 'X-API-Key: YOUR_ORBITO_KEY' ``` 示例 · cURL ``` curl -X GET 'https://orbitoads.pro/api/v1/campaigns?account_id=7401&status=Active%2COn+Hold&limit=25&cursor=OPAQUE_NEXT_CURSOR' \ -H 'X-API-Key: YOUR_ORBITO_KEY' ``` ## 实施说明 ## 读取完整列表 GET /api/v1/campaigns 首次传 cursor= 和筛选条件。下一页保持筛选不变,原样传入 meta.next_cursor,直至 null。limit 为 1–500,默认 100。 ## 排序与偏移限制 游标按账户、再按 ad_id 降序。bot_username、promote_domain、type 会启用该模式。偏移模式支持 sortBy、sortOrder,每账户最多 500 条;meta.truncated 表示需改用游标。 ## 操作与字段 GET /api/v1/campaigns cursor meta.next_cursor limit offset - GET /api/v1/campaigns - cursor - meta.next_cursor - limit - offset ## 请求示例 GET /api/v1/campaigns?limit=500&cursor= HTTP/1.1 Host: orbitoads.pro X-API-Key: {key} ## 结构字段与限制 本表依据公开的 v1 契约。参数与字段名称区分大小写。各操作的 HTTP 状态码分别表示成功、输入校验和访问检查。链接规范给出了完整的请求与响应结构。 ## 协议参考 | 方法 | 路径 | 参数 | 请求内容 | 响应码 | | --- | --- | --- | --- | --- | | GET | /api/v1/campaigns | account_id, status, title, bot_username, promote_domain, promote_domain_mode, type, limit, cursor, offset, sortBy, sortOrder | — | 200, 400, 401, 404, 429 | 来源 · [数据来源](https://adsly.pro/docs/api/openapi.yaml) ## 结构字段与限制 · 逐页读取广告活动 | 字段 | 文档取值 | | --- | --- | | limit | 1 … 500 | | limit = | 100 | | cursor | string | | meta.next_cursor | string \| null | | sortBy = | date | | sortOrder = | DESC | 来源 · [数据来源](https://adsly.pro/docs/api/pagination/) ## CampaignListItem | 字段 | 字段类型 | | --- | --- | | ad_id | integer | | account_id | integer | | title | string | | text | string \| null | | status | CampaignStatus | | tme_path | string \| null | | promote_url | string \| null | | views | integer | | opens | integer | | clicks | integer | | actions | integer | | spent | Money | | budget | Money | | cpm | Money | | cpc | Money | | cpa | Money | | ctr | string \| null | | cvr | string \| null | | date | string \| null | | group_id | integer \| null | | status_changed_at | string \| null · date-time | 来源 · [数据来源](https://adsly.pro/docs/api/openapi.yaml) ## 相关阅读 [解读 API 错误](/zh/docs/api/errors/)[请求和事件限额](/zh/docs/api/rate-limits/)[安全重试同一操作](/zh/docs/api/idempotency/)[跟踪排队中的操作](/zh/docs/api/tasks/) 参考资料更新日期 2026-10-08 [上一主题**跟踪排队中的操作**](/zh/docs/api/tasks/)[下一主题**可访问的广告账户**](/zh/docs/api/accounts/) ## 来源与数据 - [openapi.yaml](https://orbitoads.pro/docs/api/openapi.yaml) - [openapi.json](https://orbitoads.pro/docs/api/openapi.json) --- # 请求和事件限额 [Orbito Ads · 简体中文 · HTML](https://orbitoads.pro/zh/docs/api/rate-limits/) 来源核对日期 · 2026-11-27 ### 浏览文档 [全部文档](/zh/docs/) 快速入门 - [API 快速入门](/zh/docs/api/) - [密钥与账户权限](/zh/docs/api/authentication/) - [将 API 文档交给 AI 助手](/zh/docs/api/ai-assistants/) 基础概念 - [解读 API 错误](/zh/docs/api/errors/) - [请求和事件限额](/zh/docs/api/rate-limits/) - [安全重试同一操作](/zh/docs/api/idempotency/) - [跟踪排队中的操作](/zh/docs/api/tasks/) - [逐页读取广告活动](/zh/docs/api/pagination/) API 参考 - [可访问的广告账户](/zh/docs/api/accounts/) - [查询广告活动](/zh/docs/api/campaigns/) - [创建广告活动与上传媒体](/zh/docs/api/create-campaigns/) - [修改现有广告活动](/zh/docs/api/manage-campaigns/) - [广告活动与账户统计](/zh/docs/api/stats/) - [定向词典与群组](/zh/docs/api/targeting/) 集成 - [接收广告活动事件](/zh/docs/api/webhooks/) - [发送已确认的转化](/zh/docs/api/conversions/) - [API 版本与更新](/zh/docs/api/changelog/) 文件与架构 - [OpenAPI · YAML](/docs/api/openapi.yaml) - [OpenAPI · JSON](/docs/api/openapi.json) - [llms.txt](/zh/docs/llms.txt) - [llms-full.txt](/zh/docs/llms-full.txt) [全部文档](/zh/docs/) 快速入门 - [API 快速入门](/zh/docs/api/) - [密钥与账户权限](/zh/docs/api/authentication/) - [将 API 文档交给 AI 助手](/zh/docs/api/ai-assistants/) 基础概念 - [解读 API 错误](/zh/docs/api/errors/) - [请求和事件限额](/zh/docs/api/rate-limits/) - [安全重试同一操作](/zh/docs/api/idempotency/) - [跟踪排队中的操作](/zh/docs/api/tasks/) - [逐页读取广告活动](/zh/docs/api/pagination/) API 参考 - [可访问的广告账户](/zh/docs/api/accounts/) - [查询广告活动](/zh/docs/api/campaigns/) - [创建广告活动与上传媒体](/zh/docs/api/create-campaigns/) - [修改现有广告活动](/zh/docs/api/manage-campaigns/) - [广告活动与账户统计](/zh/docs/api/stats/) - [定向词典与群组](/zh/docs/api/targeting/) 集成 - [接收广告活动事件](/zh/docs/api/webhooks/) - [发送已确认的转化](/zh/docs/api/conversions/) - [API 版本与更新](/zh/docs/api/changelog/) 文件与架构 - [OpenAPI · YAML](/docs/api/openapi.yaml) - [OpenAPI · JSON](/docs/api/openapi.json) - [llms.txt](/zh/docs/llms.txt) - [llms-full.txt](/zh/docs/llms-full.txt) [Orbito Ads](/zh/) [文档](/zh/docs/) [API](/zh/docs/api/) 读取、写入及入站事件分别限额。公布的限制为每分钟 60 次读取、30 次写入,每秒 20 个转化事件。每个账户的队列另有限制。 [Markdown](/zh/docs/api/rate-limits.md) 每个密钥分别计算读取、写入和转化事件三类配额。看板频繁查询统计不影响暂停广告活动。跟踪系统瞬间上报大量转化也不会占用另外两类配额。 | 预算 | 适用于 | 限制 | | --- | --- | --- | | **阅读** | 每个 `GET` | 每分钟60个请求 | | **写作** | 每`POST`、`PATCH`、`DELETE`,但转换除外 | 每分钟30个请求 | | **转换在** | `POST /v1/postback`, `GET /v1/ingest/{token}` | 每秒20起事件,暴发至1 000起 | 配额持续补充,可在短时间内用完一分钟的可用额度。同步广告活动、统计和汇总数据通常需要 3–4 个读取请求。 需要更多的具体整合吗? 问[@orbitoads](https://t.me/orbitoads)——每个密钥都可以提高限额. ## HTTP 请求头与响应头 每个响应都通过请求配额响应头说明当前限额和剩余额度。 示例 ``` X-RateLimit-Limit: 60 the budget for this kind of request, per minute X-RateLimit-Remaining: 47 requests you can make right now X-RateLimit-Reset: 1791364800 unix time when the budget is full again Retry-After: 23 only on 429 — seconds to wait ``` ## 如何减少请求次数 - **是大小而不是子。** 暂停300次运动是一次`POST /v1/campaigns/bulk`次,而不是300次暂停电话。见[管理活动](/zh/docs/api/manage-campaigns/#doc-note-bulk)。 - **用棒子创造。** `POST /v1/campaigns`项运动最多可有100项。 - **网页而不是查询** 状态变化发生时即将到来;时间统计本身即将到来的。 看 [网页](/zh/docs/api/webhooks/). - **巴特克转换** `POST /v1/postback` 每起请求最多接受1 000起事件(每个事件仍以事件预算为计数——批量节省了来回旅行,而不是定额). ## 其他限制 | 什么 | 限制 | | --- | --- | | 每个内阁排队或运行操作 | 5 创建 + 5 其它操作( 副本, 批量) 。 第6 返回 `429 QUEUE_FULL` 。 | | 每个创建请求的广告活动 | 100 | | 每一份副本请求 | 100 | | 按批量请求开展的运动 | 1,000 | | 上传的文件 | 10 MB | | `GET /v1/campaigns`的页码 | 500 | ## 重试前的退避 收到 429 后,等待 `Retry-After` 指定的秒数再重试。自动任务可加入随机延迟,避免多个进程同时重试。 示例 ``` async function call(url, init, attempt = 0) { const res = await fetch(url, init); if (res.status !== 429 || attempt >= 5) return res; const wait = Number(res.headers.get('Retry-After') || 1) * 1000; await new Promise(r => setTimeout(r, wait + Math.random() * 500)); return call(url, init, attempt + 1); } ``` 完整广告接口需要为此工作区单独配置供应商凭据。客户端请求使用自己的 Orbito API 密钥。账户订购、开通和外部账单分别处理。 ## 实施说明 ## 每个密钥的独立限额 每个密钥每分钟可读 60 次、写 30 次。转化接收为每秒 20 个事件,突发最多 1,000 个;批量提交逐个计数。查阅 X-RateLimit-Limit、X-RateLimit-Remaining、X-RateLimit-Reset。 ## 队列与退避 每账户创建与其他任务分别最多排队或运行五个,两类各自同时执行一个。遇到 429,按 Retry-After 的秒数等待。 ## 操作与字段 60 GET / min 30 writes / min 20 conversions / s Retry-After 429 - 60 GET / min - 30 writes / min - 20 conversions / s - Retry-After - 429 ## 请求示例 GET /api/v1/account/info HTTP/1.1 Host: orbitoads.pro X-API-Key: {key} ## 结构字段与限制 本表依据公开的 v1 契约。参数与字段名称区分大小写。各操作的 HTTP 状态码分别表示成功、输入校验和访问检查。链接规范给出了完整的请求与响应结构。 ## 报告维度 API 的单次创建请求最多 100 项活动,单次复制最多 100 份,单次批量操作最多处理 1,000 项已有活动。202 响应指向排队任务。修改下一组之前,先检查完成任务的 failed 与 errors。 ## 协议参考 | 方法 | 路径 | 参数 | 请求内容 | 响应码 | | --- | --- | --- | --- | --- | | GET | /api/v1/campaigns | account_id, status, title, bot_username, promote_domain, promote_domain_mode, type, limit, cursor, offset, sortBy, sortOrder | — | 200, 400, 401, 404, 429 | | POST | /api/v1/campaigns | Idempotency-Key | application/json · CreateSingleRequest \| CreateBatchRequest | 202, 400, 401, 403, 404, 409, 422, 429, 503 | | POST | /api/v1/campaigns/{ad_id}/copy | ad_id, account_id, Idempotency-Key | application/json · CopyRequest | 202, 400, 401, 403, 404, 409, 422, 429 | | POST | /api/v1/campaigns/bulk | Idempotency-Key | application/json · BulkRequest | 202, 400, 401, 403, 404, 409, 422, 429 | | POST | /api/v1/postback | — | application/json · ConversionEvent \| object \| array · [ConversionEvent] · 0 … 1000 | 202, 400, 401, 403, 404, 409, 429 | | GET | /api/v1/ingest/{token} | token, ref, event, txid, amount, currency | — | 200, 400, 401, 403, 404, 429 | 来源 · [数据来源](https://adsly.pro/docs/api/openapi.yaml) ## 结构字段与限制 · 请求和事件限额 | 字段 | 文档取值 | | --- | --- | | GET | 60 / min | | POST, PATCH, DELETE | 30 / min | | postback, ingest | 20 events/s | | campaigns | 100 | | copy | 100 | | bulk | 1,000 | | GET campaigns | 500 / page | | POST media | 10 MB | | QUEUE_FULL | 5 create + 5 copy/bulk | 来源 · [数据来源](https://adsly.pro/docs/api/rate-limits/) ## 相关阅读 [解读 API 错误](/zh/docs/api/errors/)[安全重试同一操作](/zh/docs/api/idempotency/)[跟踪排队中的操作](/zh/docs/api/tasks/)[逐页读取广告活动](/zh/docs/api/pagination/) 参考资料更新日期 2026-10-08 [上一主题**解读 API 错误**](/zh/docs/api/errors/)[下一主题**安全重试同一操作**](/zh/docs/api/idempotency/) ## 来源与数据 - [openapi.yaml](https://orbitoads.pro/docs/api/openapi.yaml) - [openapi.json](https://orbitoads.pro/docs/api/openapi.json) --- # 广告活动与账户统计 [Orbito Ads · 简体中文 · HTML](https://orbitoads.pro/zh/docs/api/stats/) 来源核对日期 · 2026-11-27 ### 浏览文档 [全部文档](/zh/docs/) 快速入门 - [API 快速入门](/zh/docs/api/) - [密钥与账户权限](/zh/docs/api/authentication/) - [将 API 文档交给 AI 助手](/zh/docs/api/ai-assistants/) 基础概念 - [解读 API 错误](/zh/docs/api/errors/) - [请求和事件限额](/zh/docs/api/rate-limits/) - [安全重试同一操作](/zh/docs/api/idempotency/) - [跟踪排队中的操作](/zh/docs/api/tasks/) - [逐页读取广告活动](/zh/docs/api/pagination/) API 参考 - [可访问的广告账户](/zh/docs/api/accounts/) - [查询广告活动](/zh/docs/api/campaigns/) - [创建广告活动与上传媒体](/zh/docs/api/create-campaigns/) - [修改现有广告活动](/zh/docs/api/manage-campaigns/) - [广告活动与账户统计](/zh/docs/api/stats/) - [定向词典与群组](/zh/docs/api/targeting/) 集成 - [接收广告活动事件](/zh/docs/api/webhooks/) - [发送已确认的转化](/zh/docs/api/conversions/) - [API 版本与更新](/zh/docs/api/changelog/) 文件与架构 - [OpenAPI · YAML](/docs/api/openapi.yaml) - [OpenAPI · JSON](/docs/api/openapi.json) - [llms.txt](/zh/docs/llms.txt) - [llms-full.txt](/zh/docs/llms-full.txt) [全部文档](/zh/docs/) 快速入门 - [API 快速入门](/zh/docs/api/) - [密钥与账户权限](/zh/docs/api/authentication/) - [将 API 文档交给 AI 助手](/zh/docs/api/ai-assistants/) 基础概念 - [解读 API 错误](/zh/docs/api/errors/) - [请求和事件限额](/zh/docs/api/rate-limits/) - [安全重试同一操作](/zh/docs/api/idempotency/) - [跟踪排队中的操作](/zh/docs/api/tasks/) - [逐页读取广告活动](/zh/docs/api/pagination/) API 参考 - [可访问的广告账户](/zh/docs/api/accounts/) - [查询广告活动](/zh/docs/api/campaigns/) - [创建广告活动与上传媒体](/zh/docs/api/create-campaigns/) - [修改现有广告活动](/zh/docs/api/manage-campaigns/) - [广告活动与账户统计](/zh/docs/api/stats/) - [定向词典与群组](/zh/docs/api/targeting/) 集成 - [接收广告活动事件](/zh/docs/api/webhooks/) - [发送已确认的转化](/zh/docs/api/conversions/) - [API 版本与更新](/zh/docs/api/changelog/) 文件与架构 - [OpenAPI · YAML](/docs/api/openapi.yaml) - [OpenAPI · JSON](/docs/api/openapi.json) - [llms.txt](/zh/docs/llms.txt) - [llms-full.txt](/zh/docs/llms-full.txt) [Orbito Ads](/zh/) [文档](/zh/docs/) [API](/zh/docs/api/) 可获取单项活动数据、账户汇总或按货币展示的排名。支持滚动窗口和自定义日期小时范围,导出数据时一并记录时间范围。 [Markdown](/zh/docs/api/stats.md) 统计接口有三种汇总粒度。每个接口都会按账户返回密钥可访问的各个账户的数据。 | 终点 | 回归 | | --- | --- | | `GET /v1/stats` | 期间的每个运动人数 | | `GET /v1/stats/total` | 每个内阁的总和加图表点 | | `GET /v1/stats/analytics` | 按货币、图表、顶级活动划分的总数 | 查询单项广告活动一段时间内的历史数据,请使用 `GET /v1/campaigns/{ad_id}/history`。 [`GET /v1/campaigns/{ad_id}/history`](/zh/docs/api/campaigns/#doc-note-get-v1campaignsad_idhistory) ## 报告周期 | `period` | 窗口 | | --- | --- | | `1d` | 最后24小时(`/stats`和`/stats/total`的默认) | | `7d` | 过去 7 天 | | `30d` | 最后30天( `/stats/analytics` 的默认) | | `all` | 所有时间 | | `custom` | `startDate`和`endDate`(`YYYY-MM-DD`),可选`startHour`和`endHour`(0-23) | 任何`h`或`d`也是可行的(`6h`,`14d`,可长达365天 ) 。 一个未识别的值被读作最后24小时 — — 它不会返回错误,所以请检查您的拼写。 所有时间都是UTC 。 示例 ``` # 14:00–15:59 UTC on 8 October curl -s "https://orbitoads.pro/api/v1/stats?period=custom&startDate=2026-10-08&endDate=2026-10-08&startHour=14&endHour=15" \ -H "X-API-Key: $ORBITO_API_KEY" ``` ## GET /v1/stats 每一次广告活动,由内阁驻巢:`data[account_id][ad_id]`. 示例 ``` { "success": true, "data": { "53": { "90412": { "views": 640, "clicks": 7, "actions": 3, "spent": 0.96, "ctr": 1.09, "cpm": 1.5, "cpa": 0.32, "group_id": 7 } } }, "meta": { "period": "7d" } } ``` 键是字符串;这里的值是**数字** (与广告活动对象不同). `cpa`是每个动作的支出;`ctr`是一个百分比. ## GET /v1/stats/total 仪表板端点:总数和每个柜子的图表. 示例 ``` { "success": true, "data": { "accounts": { "53": { "chart": [ { "label": "2026-10-08 12:00", "views": 52, "clicks": 1, "spent": 0.83, "budget": 4.95, "ctr": 1.92, "cpc": 0.83, "cpm": 16 } ], "totals": { "views": 121, "clicks": 3, "spent": 1.81, "ctr": 2.48, "cpc": 0.6, "cpm": 14.95, "campaigns": 4, "active": 2, "stopped": 2, "declined": 0, "totalBudget": 5.21, "totalSpentAllTime": 2.79 }, "cabinetType": "euro" } }, "period": "1d", "lastUpdated": "2026-10-08T10:02:54.016Z" }, "meta": { "period": "1d" } } ``` `chart`分是按时或按时计算. `cabinetType`给出了货币(`euro`~EUR,`ton`~TON,`stars`~恒星). ## GET /v1/stats/analytics 例如`/stats/total`,加上按货币和最高广告活动额划分的支出。 示例 ``` { "success": true, "data": { "accounts": { "53": { "chart": [ { "label": "2026-10-08 12:00", "views": 52, "clicks": 1, "spent": 0.83, "spent_ton": 0, "spent_euro": 0.83, "spent_stars": 0, "ctr": 1.92, "cpc": 0.83, "cpm": 16 } ], "totals": { "views": 121, "clicks": 3, "spent": 1.81, "spentByCurrency": { "ton": 0, "euro": 1.81, "stars": 0 }, "ctr": 2.48, "cpc": 0.6, "cpm": 14.95 }, "topCampaigns": [ { "ad_id": 90412, "account_id": 53, "title": "API test", "status": "Active", "views": 58, "clicks": 1, "actions": 1, "spent": 0.85, "ctr": 1.72, "cpc": 0.85, "cpm": 14.66, "cpa": 0.85 } ] } } }, "meta": { "period": "30d" } } ``` ## 说明 - Stats跟随Telegram自己的计数器,定期同步到Orbito Ads;最新时数随着同步到来而填补. - 永远不要加起来`spent` 横跨不同货币的柜子. - 关于转换,你跟踪自己(铅,存款,销售) [转换](/zh/docs/api/conversions/) - Telegram的`actions`是加入和bot开始,而不是你的转换。 - 最好每几分钟就把[时刻消化 Webhook](/zh/docs/api/webhooks/#doc-heading-hourly_digest)的票数 放在投票统计表上 ## API 参考 完整广告接口需要为此工作区单独配置供应商凭据。客户端请求使用自己的 Orbito API 密钥。账户订购、开通和外部账单分别处理。 ## GET `/api/v1/stats` 按账户与广告 ID 读取时段指标。 | 参数 | 位置 | 格式 | 必填 | | --- | --- | --- | --- | | `period` | query | `string` | — | | `startDate` | query | `string` | — | | `endDate` | query | `string` | — | | `startHour` | query | `integer` | — | | `endHour` | query | `integer` | — | | `X-API-Key` | header | `string` | 是 | cURL ``` curl -X GET 'https://orbitoads.pro/api/v1/stats?period=7d' \ -H 'X-API-Key: YOUR_ORBITO_KEY' ``` HTTP 200 ``` { "success": true, "data": { "7401": { "38017": { "views": 3200, "clicks": 32, "actions": 4, "spent": 4, "ctr": 1, "cpm": 1.25, "cpa": 1, "group_id": 516 } } }, "meta": { "period": "7d" } } ``` ## GET `/api/v1/stats/total` 读取所选时段的账户总计及图表数据点。 | 参数 | 位置 | 格式 | 必填 | | --- | --- | --- | --- | | `period` | query | `string` | — | | `startDate` | query | `string` | — | | `endDate` | query | `string` | — | | `startHour` | query | `integer` | — | | `endHour` | query | `integer` | — | | `X-API-Key` | header | `string` | 是 | cURL ``` curl -X GET 'https://orbitoads.pro/api/v1/stats/total?period=7d' \ -H 'X-API-Key: YOUR_ORBITO_KEY' ``` HTTP 200 ``` { "success": true, "data": { "accounts": { "7401": { "chart": [ { "label": "2026-11-03", "views": 3200, "clicks": 32, "spent": 4, "budget": 36, "ctr": 1, "cpc": 0.125, "cpm": 1.25 } ], "totals": { "views": 3200, "clicks": 32, "spent": 4, "ctr": 1, "cpc": 0.125, "cpm": 1.25, "campaigns": 1, "active": 1, "stopped": 0, "declined": 0, "totalBudget": 36, "totalSpentAllTime": 4 }, "cabinetType": "euro" } }, "period": "7d", "lastUpdated": "2026-11-03T12:00:00Z" }, "meta": { "period": "7d" } } ``` ## GET `/api/v1/stats/analytics` 读取币种拆分、图表和广告排名。 | 参数 | 位置 | 格式 | 必填 | | --- | --- | --- | --- | | `period` | query | `string` | — | | `startDate` | query | `string` | — | | `endDate` | query | `string` | — | | `startHour` | query | `integer` | — | | `endHour` | query | `integer` | — | | `X-API-Key` | header | `string` | 是 | cURL ``` curl -X GET 'https://orbitoads.pro/api/v1/stats/analytics?period=custom&startDate=2026-11-03&endDate=2026-11-03&startHour=8&endHour=17' \ -H 'X-API-Key: YOUR_ORBITO_KEY' ``` HTTP 200 ``` { "success": true, "data": { "accounts": { "7401": { "chart": [ { "label": "2026-11-03", "views": 3200, "clicks": 32, "spent": 4, "ctr": 1, "cpc": 0.125, "cpm": 1.25, "spent_ton": 0, "spent_euro": 4, "spent_stars": 0 } ], "totals": { "views": 3200, "clicks": 32, "spent": 4, "spentByCurrency": { "euro": 4, "ton": 0, "stars": 0 }, "ctr": 1, "cpc": 0.125, "cpm": 1.25 }, "topCampaigns": [ { "views": 3200, "clicks": 32, "actions": 4, "spent": 4, "ctr": 1, "cpm": 1.25, "cpa": 1, "account_id": 7401, "ad_id": 38017, "title": "Conversation club · November", "status": "Active", "cpc": 0.125 } ] } } }, "meta": { "period": "custom" } } ``` ## 实施说明 ## 余额与币种 逐账户核对 currency、balance_updated_at 和 min_budget。广告对象中的金额及费率可能是十进制字符串或 null,统计聚合使用数值。EUR、TON 和 Stars 分开汇总。 ## 周期与 UTC 小时 period 支持 1d、7d、30d、all、custom 及最长 365 天的 Nh/Nd 窗口。custom 必须指定 startDate、endDate,可选 0–23 UTC 的 startHour/endHour。stats、total 默认 1d,analytics 默认 30d。 ## 理解平台行动数 actions 统计加入频道或启动机器人等平台行为。追踪器的线索、购买和收入见 conversions。/stats/analytics 按账户提供图表、总计及 topCampaigns。 ## 操作与字段 GET /api/v1/stats GET /api/v1/stats/total GET /api/v1/stats/analytics 1d 7d 30d all custom - GET /api/v1/stats - GET /api/v1/stats/total - GET /api/v1/stats/analytics - 1d - 7d - 30d - all - custom ## 请求示例 GET /api/v1/stats/total?period=7d HTTP/1.1 Host: orbitoads.pro X-API-Key: {key} ## 结构字段与限制 本表依据公开的 v1 契约。参数与字段名称区分大小写。各操作的 HTTP 状态码分别表示成功、输入校验和访问检查。链接规范给出了完整的请求与响应结构。 ## 协议参考 | 方法 | 路径 | 参数 | 请求内容 | 响应码 | | --- | --- | --- | --- | --- | | GET | /api/v1/stats | period, startDate, endDate, startHour, endHour | — | 200, 401, 429 | | GET | /api/v1/stats/total | period, startDate, endDate, startHour, endHour | — | 200, 401, 429 | | GET | /api/v1/stats/analytics | period, startDate, endDate, startHour, endHour | — | 200, 401, 429 | | GET | /api/v1/campaigns/{ad_id}/history | ad_id, account_id, period, startDate, endDate, startHour, endHour | — | 200, 400, 401, 404 | 来源 · [数据来源](https://adsly.pro/docs/api/openapi.yaml) ## 结构字段与限制 · 广告活动与账户统计 | 字段 | 文档取值 | | --- | --- | | period | 1d, 7d, 30d, all, custom | | startDate, endDate | YYYY-MM-DD | | startHour, endHour | 0 … 23 | | /stats | 1d | | /stats/analytics | 30d | 来源 · [数据来源](https://adsly.pro/docs/api/stats/) ## StatsNumbers | 字段 | 字段类型 | | --- | --- | | views | number | | clicks | number | | actions | number | | spent | number | | ctr | number | | cpm | number | | cpa | number | | group_id | integer \| null | 来源 · [数据来源](https://adsly.pro/docs/api/openapi.yaml) ## 相关阅读 [可访问的广告账户](/zh/docs/api/accounts/)[查询广告活动](/zh/docs/api/campaigns/)[创建广告活动与上传媒体](/zh/docs/api/create-campaigns/)[修改现有广告活动](/zh/docs/api/manage-campaigns/)[定向词典与群组](/zh/docs/api/targeting/) 参考资料更新日期 2026-10-26 [上一主题**修改现有广告活动**](/zh/docs/api/manage-campaigns/)[下一主题**定向词典与群组**](/zh/docs/api/targeting/) ## 来源与数据 - [openapi.yaml](https://orbitoads.pro/docs/api/openapi.yaml) - [openapi.json](https://orbitoads.pro/docs/api/openapi.json) --- # 定向词典与群组 [Orbito Ads · 简体中文 · HTML](https://orbitoads.pro/zh/docs/api/targeting/) 来源核对日期 · 2026-11-27 ### 浏览文档 [全部文档](/zh/docs/) 快速入门 - [API 快速入门](/zh/docs/api/) - [密钥与账户权限](/zh/docs/api/authentication/) - [将 API 文档交给 AI 助手](/zh/docs/api/ai-assistants/) 基础概念 - [解读 API 错误](/zh/docs/api/errors/) - [请求和事件限额](/zh/docs/api/rate-limits/) - [安全重试同一操作](/zh/docs/api/idempotency/) - [跟踪排队中的操作](/zh/docs/api/tasks/) - [逐页读取广告活动](/zh/docs/api/pagination/) API 参考 - [可访问的广告账户](/zh/docs/api/accounts/) - [查询广告活动](/zh/docs/api/campaigns/) - [创建广告活动与上传媒体](/zh/docs/api/create-campaigns/) - [修改现有广告活动](/zh/docs/api/manage-campaigns/) - [广告活动与账户统计](/zh/docs/api/stats/) - [定向词典与群组](/zh/docs/api/targeting/) 集成 - [接收广告活动事件](/zh/docs/api/webhooks/) - [发送已确认的转化](/zh/docs/api/conversions/) - [API 版本与更新](/zh/docs/api/changelog/) 文件与架构 - [OpenAPI · YAML](/docs/api/openapi.yaml) - [OpenAPI · JSON](/docs/api/openapi.json) - [llms.txt](/zh/docs/llms.txt) - [llms-full.txt](/zh/docs/llms-full.txt) [全部文档](/zh/docs/) 快速入门 - [API 快速入门](/zh/docs/api/) - [密钥与账户权限](/zh/docs/api/authentication/) - [将 API 文档交给 AI 助手](/zh/docs/api/ai-assistants/) 基础概念 - [解读 API 错误](/zh/docs/api/errors/) - [请求和事件限额](/zh/docs/api/rate-limits/) - [安全重试同一操作](/zh/docs/api/idempotency/) - [跟踪排队中的操作](/zh/docs/api/tasks/) - [逐页读取广告活动](/zh/docs/api/pagination/) API 参考 - [可访问的广告账户](/zh/docs/api/accounts/) - [查询广告活动](/zh/docs/api/campaigns/) - [创建广告活动与上传媒体](/zh/docs/api/create-campaigns/) - [修改现有广告活动](/zh/docs/api/manage-campaigns/) - [广告活动与账户统计](/zh/docs/api/stats/) - [定向词典与群组](/zh/docs/api/targeting/) 集成 - [接收广告活动事件](/zh/docs/api/webhooks/) - [发送已确认的转化](/zh/docs/api/conversions/) - [API 版本与更新](/zh/docs/api/changelog/) 文件与架构 - [OpenAPI · YAML](/docs/api/openapi.yaml) - [OpenAPI · JSON](/docs/api/openapi.json) - [llms.txt](/zh/docs/llms.txt) - [llms-full.txt](/zh/docs/llms-full.txt) [Orbito Ads](/zh/) [文档](/zh/docs/) [API](/zh/docs/api/) 组装请求前先获取国家、语言和主题代码。群组列表可识别已保存的活动文件夹。可缓存词典,并在可用选项变更时刷新。 [Markdown](/zh/docs/api/targeting.md) ## GET /v1/targeting 代码 [`POST /v1/campaigns`](/zh/docs/api/create-campaigns/) 被接受。 这些列表是 Orbito Ads 创建格式 的 。 因此, 这里的代码从未被拒绝 。 示例 ``` curl -s https://orbitoads.pro/api/v1/targeting -H "X-API-Key: $ORBITO_API_KEY" ``` 示例 ``` { "success": true, "data": { "countries": [ { "code": "DE", "name": "Germany" }, { "code": "US", "name": "United States" } ], "languages": [ { "code": "en", "name": "English" }, { "code": "zh-hans", "name": "Chinese (Simplified)" } ], "topics": [ { "id": 7, "name": "Cryptocurrencies" }, { "id": 26, "name": "Investments" } ], "buttons": [ "subscribe", "view", "read", "learn_more", "download", "open", "sign_up", "buy", "order", "play", "try", "leave_request" ] } } ``` | 列表 | 使用在 | 笔记 | | --- | --- | --- | | `countries[].code` | `countries` | ISO 3166个双字母代码,外加Telegram个自有的`FT`(匿名号码). | | `languages[].code` | `languages` | Telegram's language keys - e.g. `pt-br`和`pt-pt`,不是`pt`. | | `topics[].id` | `topics`, `exclude_topics` | 数字; ids 不连续 。 | | `buttons` | `button` | 只有在`features.ad_button`是`true`的内阁里 | 这些列表很少变更,获取一次后可缓存一天。 ## 定向组 组合是板块中运动的文件夹。 将新的运动或复制件放入一个有`group_id`( 现有) 或 `new_group_name`( 如果有名称, 则创建或重新使用) 的文件夹 。 ### GET/v1/组 示例 ``` curl -s "https://orbitoads.pro/api/v1/groups?account_id=53" -H "X-API-Key: $ORBITO_API_KEY" ``` 示例 ``` { "success": true, "data": [ { "id": 7, "account_id": 53, "name": "October test", "color": "#6366f1" } ] } ``` 没有`account_id`你就能拿到每个内阁的团体钥匙。 一个团体属于一个内阁 — — 另一内阁的`group_id`人被拒绝。 ## API 参考 完整广告接口需要为此工作区单独配置供应商凭据。客户端请求使用自己的 Orbito API 密钥。账户订购、开通和外部账单分别处理。 ## GET `/api/v1/targeting` 读取支持的国家、语言、主题和按钮取值。 | 参数 | 位置 | 格式 | 必填 | | --- | --- | --- | --- | | `X-API-Key` | header | `string` | 是 | cURL ``` curl -X GET https://orbitoads.pro/api/v1/targeting \ -H 'X-API-Key: YOUR_ORBITO_KEY' ``` HTTP 200 ``` { "success": true, "data": { "countries": [ { "code": "GB", "name": "United Kingdom" } ], "languages": [ { "code": "en", "name": "English" } ], "topics": [ { "id": 8, "name": "Example topic" } ], "buttons": [ "learn_more", "open" ] } } ``` ## GET `/api/v1/groups` 列出广告分组,可限定为单个账户。 | 参数 | 位置 | 格式 | 必填 | | --- | --- | --- | --- | | `account_id` | query | `integer` | — | | `X-API-Key` | header | `string` | 是 | cURL ``` curl -X GET 'https://orbitoads.pro/api/v1/groups?account_id=7401' \ -H 'X-API-Key: YOUR_ORBITO_KEY' ``` HTTP 200 ``` { "success": true, "data": [ { "id": 516, "account_id": 7401, "name": "Language club", "color": "#6651EF" } ] } ``` ## 实施说明 ## 表单可接受的值 原样使用返回的国家和语言代码、数字主题 ID 及按钮值。区域语言如 pt-br 和 pt-pt 分开,使用 button 需账户支持。 ## 分组归属 每组归属一个账户。创建或复制时传该账户的 group_id 或 new_group_name,已有同名组可复用。 ## 操作与字段 GET /api/v1/targeting GET /api/v1/groups - GET /api/v1/targeting - GET /api/v1/groups ## 请求示例 GET /api/v1/groups?account_id={account_id} HTTP/1.1 Host: orbitoads.pro X-API-Key: {key} ## 结构字段与限制 本表依据公开的 v1 契约。参数与字段名称区分大小写。各操作的 HTTP 状态码分别表示成功、输入校验和访问检查。链接规范给出了完整的请求与响应结构。 ## 受众测试设置 创建结构区分四种定向方式。频道使用 channels,机器人名使用 bots,搜索词使用 search_keywords。国家、语言与主题用于描述用户受众。构建测试前应先读取账户所支持的选项。 ## 协议参考 | 方法 | 路径 | 参数 | 请求内容 | 响应码 | | --- | --- | --- | --- | --- | | GET | /api/v1/targeting | — | — | 200, 401 | | GET | /api/v1/groups | account_id | — | 200, 401, 404 | 来源 · [数据来源](https://adsly.pro/docs/api/openapi.yaml) ## 结构字段与限制 · 定向词典与群组 | 字段 | 文档取值 | | --- | --- | | countries[] | code, name | | languages[] | code, name | | topics[] | id, name | | buttons[] | string | | Group | id, account_id, name, color | 来源 · [数据来源](https://adsly.pro/docs/api/targeting/) ## Targeting | 字段 | 字段类型 | | --- | --- | | countries | array · [object] | | languages | array · [object] | | topics | array · [object] | | buttons | array · [string] | 来源 · [数据来源](https://adsly.pro/docs/api/openapi.yaml) ## Group | 字段 | 字段类型 | | --- | --- | | id | integer | | account_id | integer | | name | string | | color | string | 来源 · [数据来源](https://adsly.pro/docs/api/openapi.yaml) ## 相关阅读 [可访问的广告账户](/zh/docs/api/accounts/)[查询广告活动](/zh/docs/api/campaigns/)[创建广告活动与上传媒体](/zh/docs/api/create-campaigns/)[修改现有广告活动](/zh/docs/api/manage-campaigns/)[广告活动与账户统计](/zh/docs/api/stats/) 参考资料更新日期 2026-10-08 [上一主题**广告活动与账户统计**](/zh/docs/api/stats/)[下一主题**接收广告活动事件**](/zh/docs/api/webhooks/) ## 来源与数据 - [openapi.yaml](https://orbitoads.pro/docs/api/openapi.yaml) - [openapi.json](https://orbitoads.pro/docs/api/openapi.json) --- # 跟踪排队中的操作 [Orbito Ads · 简体中文 · HTML](https://orbitoads.pro/zh/docs/api/tasks/) 来源核对日期 · 2026-11-27 ### 浏览文档 [全部文档](/zh/docs/) 快速入门 - [API 快速入门](/zh/docs/api/) - [密钥与账户权限](/zh/docs/api/authentication/) - [将 API 文档交给 AI 助手](/zh/docs/api/ai-assistants/) 基础概念 - [解读 API 错误](/zh/docs/api/errors/) - [请求和事件限额](/zh/docs/api/rate-limits/) - [安全重试同一操作](/zh/docs/api/idempotency/) - [跟踪排队中的操作](/zh/docs/api/tasks/) - [逐页读取广告活动](/zh/docs/api/pagination/) API 参考 - [可访问的广告账户](/zh/docs/api/accounts/) - [查询广告活动](/zh/docs/api/campaigns/) - [创建广告活动与上传媒体](/zh/docs/api/create-campaigns/) - [修改现有广告活动](/zh/docs/api/manage-campaigns/) - [广告活动与账户统计](/zh/docs/api/stats/) - [定向词典与群组](/zh/docs/api/targeting/) 集成 - [接收广告活动事件](/zh/docs/api/webhooks/) - [发送已确认的转化](/zh/docs/api/conversions/) - [API 版本与更新](/zh/docs/api/changelog/) 文件与架构 - [OpenAPI · YAML](/docs/api/openapi.yaml) - [OpenAPI · JSON](/docs/api/openapi.json) - [llms.txt](/zh/docs/llms.txt) - [llms-full.txt](/zh/docs/llms-full.txt) [全部文档](/zh/docs/) 快速入门 - [API 快速入门](/zh/docs/api/) - [密钥与账户权限](/zh/docs/api/authentication/) - [将 API 文档交给 AI 助手](/zh/docs/api/ai-assistants/) 基础概念 - [解读 API 错误](/zh/docs/api/errors/) - [请求和事件限额](/zh/docs/api/rate-limits/) - [安全重试同一操作](/zh/docs/api/idempotency/) - [跟踪排队中的操作](/zh/docs/api/tasks/) - [逐页读取广告活动](/zh/docs/api/pagination/) API 参考 - [可访问的广告账户](/zh/docs/api/accounts/) - [查询广告活动](/zh/docs/api/campaigns/) - [创建广告活动与上传媒体](/zh/docs/api/create-campaigns/) - [修改现有广告活动](/zh/docs/api/manage-campaigns/) - [广告活动与账户统计](/zh/docs/api/stats/) - [定向词典与群组](/zh/docs/api/targeting/) 集成 - [接收广告活动事件](/zh/docs/api/webhooks/) - [发送已确认的转化](/zh/docs/api/conversions/) - [API 版本与更新](/zh/docs/api/changelog/) 文件与架构 - [OpenAPI · YAML](/docs/api/openapi.yaml) - [OpenAPI · JSON](/docs/api/openapi.json) - [llms.txt](/zh/docs/llms.txt) - [llms-full.txt](/zh/docs/llms-full.txt) [Orbito Ads](/zh/) [文档](/zh/docs/) [API](/zh/docs/api/) 创建、复制和批量修改可能返回 HTTP 202 与任务 ID。轮询任务查看进度、汇总和单项失败,保存最终受影响的活动编号以便核对。 [Markdown](/zh/docs/api/tasks.md) 有些行动每次行动一次会与Telegram谈话,所以它们需要比HTTP请求更长的时间等待。这些返回的`202 Accepted`是**任务** ,而不是最后的结果: - `POST /v1/campaigns` — 创建 - `POST /v1/campaigns/{ad_id}/copy` — 副本 - `POST /v1/campaigns/bulk` — 暂停、 恢复、 预算、 CPM 或删除许多 单场阵容变化(`PATCH`,暂停,恢复,预算,删除)直接回答——没有任务. ## HTTP 202 响应 示例 ``` HTTP/1.1 202 Accepted Location: /api/v1/tasks/81234 Retry-After: 2 ``` 示例 ``` { "success": true, "data": { "id": 81234, "type": "create", "status": "pending", "account_id": 53, "progress": 0, "total": 3, "succeeded": null, "failed": null, "ad_ids": [], "errors": [], "paused_reason": null, "error": null, "created_at": "2026-10-08T10:15:02.411Z", "started_at": null, "completed_at": null } } ``` ## GET /v1/tasks/{id} 示例 ``` curl -s https://orbitoads.pro/api/v1/tasks/81234 -H "X-API-Key: $ORBITO_API_KEY" ``` 和上面的形状一样,在`status`成为最终任务之前,输入它;虽然一个任务是`pending`或`running`,但答复中包含`Retry-After: 2`——在民调之间等待了那么长的时间,任何同一个主人的钥匙都可以读取这个任务. | 田野 | 意义 | | --- | --- | | `type` | `create`、`copy`、`status`(暂停/复发)、`budget`、`cpm`、`delete` | | `status` | 下面看 | | `progress` / `total` | 迄今处理的宣传活动/总数 | | `succeeded` / `failed` | 数,一旦知道 | | `ad_ids` | 运动任务创建( 创建、 复制) 或更改( 块) | | `errors[]` | 最多50个失败: `{ ad_id, index, error }` - `index` 是您`campaigns`阵列中用于创建的位置 。 | | `paused_reason` | e.g. 内阁没有平衡 | | `error` | 整个任务为何失败 | ### 状态 | 状态 | 意义 | 最终? | | --- | --- | --- | | `pending` | 已排队 —— 内阁每次运行一个创建和另一个操作 | 无 | | `running` | 进展中 | 无 | | `paused` | 停止等待 — 通常内阁的平衡在中途就耗尽。 将内阁顶上; 从面板上恢复 | 无 | | `completed` | 完成。 请检查 `failed` 和 `errors` – 完成的任务可以包含单个失败 。 | 是的 | | `failed` | 整个任务失败——见`error` | 是的 | | `cancelled` | 从面板上取消 | 是的 | ## 广告活动创建如何完成 - 新广告活动代号出现在`ad_ids`年任务完成后(在上届广告活动成立后通过内阁同步找到). - 如果一个批次的**第一** 运动失败,任务就停止在那里,而不是重复同样的错误100次. 修正输入并再次发送. - 如果Telegram无法解决任何一个活动的频道或机器人,则该活动将失败。 `No targets found: …` 列出他们。 - Telegram评论了每一个新广告。一个创建的广告活动通常开始`In Review`;一个[网页](/zh/docs/api/webhooks/)告诉你,当它改变的时候。 ## 轮询状态示例 示例 ``` async function waitForTask(id) { for (;;) { const res = await fetch(`https://orbitoads.pro/api/v1/tasks/${id}`, { headers: { 'X-API-Key': process.env.ORBITO_API_KEY }, }); const { data } = await res.json(); if (['completed', 'failed', 'cancelled'].includes(data.status)) return data; if (data.status === 'paused') throw new Error(`Task paused: ${data.paused_reason}`); await new Promise(r => setTimeout(r, Number(res.headers.get('Retry-After') || 2) * 1000)); } } ``` 示例 ``` import time, requests def wait_for_task(task_id): while True: r = requests.get(f"https://orbitoads.pro/api/v1/tasks/{task_id}", headers={"X-API-Key": API_KEY}, timeout=30) task = r.json()["data"] if task["status"] in ("completed", "failed", "cancelled"): return task if task["status"] == "paused": raise RuntimeError(f"Task paused: {task['paused_reason']}") time.sleep(int(r.headers.get("Retry-After", 2))) ``` ## API 参考 完整广告接口需要为此工作区单独配置供应商凭据。客户端请求使用自己的 Orbito API 密钥。账户订购、开通和外部账单分别处理。 ## GET `/api/v1/tasks/{id}` 读取任务进度、返回的广告 ID 及各项失败信息。 | 参数 | 位置 | 格式 | 必填 | | --- | --- | --- | --- | | `id` | path | `integer` | 是 | | `X-API-Key` | header | `string` | 是 | cURL ``` curl -X GET https://orbitoads.pro/api/v1/tasks/96203 \ -H 'X-API-Key: YOUR_ORBITO_KEY' ``` HTTP 200 ``` { "success": true, "data": { "id": 96203, "type": "create", "status": "completed", "account_id": 7401, "total": 1, "ad_ids": [ 38019 ], "progress": 1, "succeeded": 1, "failed": 0, "errors": [], "paused_reason": null, "error": null, "created_at": "2026-11-03T12:01:00Z", "started_at": "2026-11-03T12:01:02Z", "completed_at": "2026-11-03T12:01:04Z" } } ``` ## 实施说明 ## 受理与完成 创建、复制和批量操作返回 HTTP 202 及任务 ID。按 Retry-After 轮询 GET /api/v1/tasks/{id}。即使状态为 completed,也要检查 failed 和 errors。 ## 任务状态与结果 pending、running、paused 是非终态;completed、failed、cancelled 表示结束。查看 progress、total、ad_ids 及最多 50 条单项错误。paused_reason 可说明需在面板处理的预算不足。 ## 操作与字段 GET /api/v1/tasks/{id} pending running paused completed failed cancelled succeeded failed errors - GET /api/v1/tasks/{id} - pending - running - paused - completed - failed - cancelled - succeeded - failed - errors ## 请求示例 GET /api/v1/tasks/{id} HTTP/1.1 Host: orbitoads.pro X-API-Key: {key} ## 结构字段与限制 本表依据公开的 v1 契约。参数与字段名称区分大小写。各操作的 HTTP 状态码分别表示成功、输入校验和访问检查。链接规范给出了完整的请求与响应结构。 ## 报告维度 API 的单次创建请求最多 100 项活动,单次复制最多 100 份,单次批量操作最多处理 1,000 项已有活动。202 响应指向排队任务。修改下一组之前,先检查完成任务的 failed 与 errors。 ## 协议参考 | 方法 | 路径 | 参数 | 请求内容 | 响应码 | | --- | --- | --- | --- | --- | | GET | /api/v1/tasks/{id} | id | — | 200, 400, 401, 404 | | POST | /api/v1/campaigns | Idempotency-Key | application/json · CreateSingleRequest \| CreateBatchRequest | 202, 400, 401, 403, 404, 409, 422, 429, 503 | | POST | /api/v1/campaigns/bulk | Idempotency-Key | application/json · BulkRequest | 202, 400, 401, 403, 404, 409, 422, 429 | | POST | /api/v1/campaigns/{ad_id}/copy | ad_id, account_id, Idempotency-Key | application/json · CopyRequest | 202, 400, 401, 403, 404, 409, 422, 429 | 来源 · [数据来源](https://adsly.pro/docs/api/openapi.yaml) ## 结构字段与限制 · 跟踪排队中的操作 | 字段 | 文档取值 | | --- | --- | | HTTP 202 | Location, Retry-After | | status | pending, running, paused, completed, failed, cancelled | | progress / total | integer / integer | | succeeded / failed | integer \| null | | errors[] | ≤ 50 | | ad_ids[] | integer | 来源 · [数据来源](https://adsly.pro/docs/api/tasks/) ## Task | 字段 | 字段类型 | | --- | --- | | id | integer | | type | create \| copy \| status \| budget \| cpm \| delete \| edit \| recreate | | status | pending \| running \| paused \| completed \| failed \| cancelled | | account_id | integer | | progress | integer | | total | integer | | succeeded | integer \| null | | failed | integer \| null | | ad_ids | array · [integer] | | errors | array · [object] · 0 … 50 | | paused_reason | string \| null | | error | string \| null | | created_at | string · date-time | | started_at | string \| null · date-time | | completed_at | string \| null · date-time | 来源 · [数据来源](https://adsly.pro/docs/api/openapi.yaml) ## 相关阅读 [解读 API 错误](/zh/docs/api/errors/)[请求和事件限额](/zh/docs/api/rate-limits/)[安全重试同一操作](/zh/docs/api/idempotency/)[逐页读取广告活动](/zh/docs/api/pagination/) 参考资料更新日期 2026-10-08 [上一主题**安全重试同一操作**](/zh/docs/api/idempotency/)[下一主题**逐页读取广告活动**](/zh/docs/api/pagination/) ## 来源与数据 - [openapi.yaml](https://orbitoads.pro/docs/api/openapi.yaml) - [openapi.json](https://orbitoads.pro/docs/api/openapi.json) --- # 接收广告活动事件 [Orbito Ads · 简体中文 · HTML](https://orbitoads.pro/zh/docs/api/webhooks/) 来源核对日期 · 2026-11-27 ### 浏览文档 [全部文档](/zh/docs/) 快速入门 - [API 快速入门](/zh/docs/api/) - [密钥与账户权限](/zh/docs/api/authentication/) - [将 API 文档交给 AI 助手](/zh/docs/api/ai-assistants/) 基础概念 - [解读 API 错误](/zh/docs/api/errors/) - [请求和事件限额](/zh/docs/api/rate-limits/) - [安全重试同一操作](/zh/docs/api/idempotency/) - [跟踪排队中的操作](/zh/docs/api/tasks/) - [逐页读取广告活动](/zh/docs/api/pagination/) API 参考 - [可访问的广告账户](/zh/docs/api/accounts/) - [查询广告活动](/zh/docs/api/campaigns/) - [创建广告活动与上传媒体](/zh/docs/api/create-campaigns/) - [修改现有广告活动](/zh/docs/api/manage-campaigns/) - [广告活动与账户统计](/zh/docs/api/stats/) - [定向词典与群组](/zh/docs/api/targeting/) 集成 - [接收广告活动事件](/zh/docs/api/webhooks/) - [发送已确认的转化](/zh/docs/api/conversions/) - [API 版本与更新](/zh/docs/api/changelog/) 文件与架构 - [OpenAPI · YAML](/docs/api/openapi.yaml) - [OpenAPI · JSON](/docs/api/openapi.json) - [llms.txt](/zh/docs/llms.txt) - [llms-full.txt](/zh/docs/llms-full.txt) [全部文档](/zh/docs/) 快速入门 - [API 快速入门](/zh/docs/api/) - [密钥与账户权限](/zh/docs/api/authentication/) - [将 API 文档交给 AI 助手](/zh/docs/api/ai-assistants/) 基础概念 - [解读 API 错误](/zh/docs/api/errors/) - [请求和事件限额](/zh/docs/api/rate-limits/) - [安全重试同一操作](/zh/docs/api/idempotency/) - [跟踪排队中的操作](/zh/docs/api/tasks/) - [逐页读取广告活动](/zh/docs/api/pagination/) API 参考 - [可访问的广告账户](/zh/docs/api/accounts/) - [查询广告活动](/zh/docs/api/campaigns/) - [创建广告活动与上传媒体](/zh/docs/api/create-campaigns/) - [修改现有广告活动](/zh/docs/api/manage-campaigns/) - [广告活动与账户统计](/zh/docs/api/stats/) - [定向词典与群组](/zh/docs/api/targeting/) 集成 - [接收广告活动事件](/zh/docs/api/webhooks/) - [发送已确认的转化](/zh/docs/api/conversions/) - [API 版本与更新](/zh/docs/api/changelog/) 文件与架构 - [OpenAPI · YAML](/docs/api/openapi.yaml) - [OpenAPI · JSON](/docs/api/openapi.json) - [llms.txt](/zh/docs/llms.txt) - [llms-full.txt](/zh/docs/llms-full.txt) [Orbito Ads](/zh/) [文档](/zh/docs/) [API](/zh/docs/api/) 文档区分 status_change、hourly_digest 和测试 ping。通过 HTTPS 接收回调,用原始请求体校验签名,并在处理前对重复投递去重。 [Markdown](/zh/docs/api/webhooks.md) 如需接收事件而不轮询 API,请在“API 与 Webhook”的密钥卡片中设置 Postback URL。Orbito Ads 会通过 POST 向该地址发送此密钥可访问账户的事件,并用该密钥的 Webhook 签名密钥为每次投递签名。 ## 事件 | 事件 | 当时 | | --- | --- | | `status_change` | 一场运动的状况发生了变化(在评论中 ) , 活跃的,活跃的,停止的。 每次内阁同步后,当运动在小组中或通过API运动时,即刻发出。 | | `hourly_digest` | 每小时5分钟,小时数刚刚关闭,每个柜子一个POST小时。 没有看到、点击或花费的小时被跳过。 | | `ping` | 当你按**测试** 键。 | ### status_change 示例 ``` { "event": "status_change", "delivered_at": "2026-10-08T12:00:05.123Z", "account_id": 53, "changes": [ { "ad_id": 90412, "tme_path": "yourchannel", "old_status": "In Review", "new_status": "Active" }, { "ad_id": 90388, "tme_path": "yourbot?start=promo", "old_status": "Active", "new_status": "Stopped" } ] } ``` ### hourly_digest 示例 ``` { "event": "hourly_digest", "delivered_at": "2026-10-08T14:05:00.000Z", "period": { "start": "2026-10-08T13:00:00.000Z", "end": "2026-10-08T14:00:00.000Z" }, "account_id": 53, "totals": { "views": 18420, "clicks": 137, "spent": 12.456, "actions": 9 }, "campaigns": [ { "ad_id": 90412, "tme_path": "yourchannel", "title": "Crypto channels — notes", "status": "Active", "views": 9100, "clicks": 73, "spent": 6.221, "actions": 4, "cpm": "0.68", "budget": "100.00" } ] } ``` `campaigns` 最多列出花费最高的 200 个广告活动。若有更多活动发生变化,`truncated` 会列出被省略的数量。`totals` 始终统计全部活动,金额使用账户币种。 ## HTTP 请求头与响应头 示例 ``` Content-Type: application/json User-Agent: Orbito-Webhook/1.0 (+https://Orbito.pro) X-Orbito-Event: status_change | hourly_digest | ping X-Orbito-Delivery: X-Orbito-Timestamp: X-Orbito-Signature: sha256= ``` ## 验证签名 把 `X-Orbito-Timestamp`、一个英文句点和原始请求体的字节拼接起来。用创建密钥或轮换 Webhook 密钥时显示的签名密钥计算 HMAC-SHA256。在解析 JSON 之前验证签名,因为重新序列化会改变字节。拒绝超过五分钟的请求。 ### Node.js (快递) 示例 ``` const express = require('express'); const crypto = require('crypto'); const app = express(); const SECRET = process.env.ORBITO_WEBHOOK_SECRET; app.post('/Orbito-webhook', express.raw({ type: 'application/json', limit: '2mb' }), (req, res) => { const ts = req.get('X-Orbito-Timestamp'); const sig = req.get('X-Orbito-Signature') || ''; if (!ts || Math.abs(Date.now() / 1000 - Number(ts)) > 300) return res.sendStatus(400); const expected = 'sha256=' + crypto.createHmac('sha256', SECRET) .update(`${ts}.${req.body.toString('utf8')}`) .digest('hex'); const ok = sig.length === expected.length && crypto.timingSafeEqual(Buffer.from(sig), Buffer.from(expected)); if (!ok) return res.sendStatus(401); const event = JSON.parse(req.body.toString('utf8')); res.sendStatus(200); // answer fast, then do the work queue.push(event); // e.g. hand off to a job queue }); ``` ### Python (弗拉克语) 示例 ``` import hmac, hashlib, time, os from flask import Flask, request, abort app = Flask(__name__) SECRET = os.environ["ORBITO_WEBHOOK_SECRET"].encode() @app.post("/Orbito-webhook") def orbito_webhook(): ts = request.headers.get("X-Orbito-Timestamp", "") sig = request.headers.get("X-Orbito-Signature", "") if not ts or abs(time.time() - int(ts)) > 300: abort(400) body = request.get_data() # raw bytes expected = "sha256=" + hmac.new(SECRET, ts.encode() + b"." + body, hashlib.sha256).hexdigest() if not hmac.compare_digest(sig, expected): abort(401) event = request.get_json() # … queue the work … return "", 200 ``` ## 事件投递 - 您的端点必须是公开的**HTTPS** `http://`, 本地主机和私人地址被拒绝。 - 回答**10秒** 之内的`2xx`。回答后要慢一点。 - 在网络错误或`5xx`上,我们重试**一次** 分,750毫秒后,同样的`X-Orbito-Delivery`分,A`4xx`分机没有重试. - 改行不随入. - 面板上的密钥卡显示最后交付的时间、状态和出错。 ## Webhook 可接收哪些账户的事件 密钥只会收到其权限范围内的账户事件。代理机构成员可收到与其共享的账户事件。一旦撤销访问权限,相关事件立即停止投递。 [关键与访问](/zh/docs/api/authentication/#doc-note-which-cabinets-a-key-reaches) ## 发送测试事件 在密钥卡片中点击“测试”,即可收到与实际事件采用相同签名方式的 `ping` 事件。 示例 ``` { "event": "ping", "delivered_at": "2026-10-08T12:00:00.000Z", "message": "This is a test ping from Orbito…", "key_id": 41 } ``` ## API 参考 完整广告接口需要为此工作区单独配置供应商凭据。客户端请求使用自己的 Orbito API 密钥。账户订购、开通和外部账单分别处理。 示例 · JSON ``` { "event": "status_change", "delivered_at": "2026-11-03T12:00:00Z", "account_id": 7401, "changes": [ { "ad_id": 38017, "tme_path": "example_club", "old_status": "In Review", "new_status": "Active" } ] } ``` ## 实施说明 ## 事件与回调设置 在供应商密钥设置登记公开 HTTPS 回调。status_change 推送状态变更,hourly_digest 在每小时第 05 分钟汇总活跃账户,ping 测试投递。配置流程独立于这里的 22 项 HTTP 操作。 ## 签名与再次投递 用 webhook 密钥对时间戳、一个点及原始请求字节计算 HMAC-SHA256。拒绝五分钟前的时间戳,十秒内响应 2xx。网络错误或 5xx 会在 750 毫秒后以同一投递 ID 重试一次。 ## 操作与字段 status_change hourly_digest ping - status_change - hourly_digest - ping ## HTTP X-Orbito-Event: hourly_digest X-Orbito-Delivery: {uuid} X-Orbito-Timestamp: {unix_seconds} X-Orbito-Signature: sha256={hex} ## 结构字段与限制 本表依据公开的 v1 契约。参数与字段名称区分大小写。各操作的 HTTP 状态码分别表示成功、输入校验和访问检查。链接规范给出了完整的请求与响应结构。 ## 时间范围 · hourly_digest hourly_digest 回调汇总刚结束的一小时,并在整点后五分钟为有流量的账户发送。请保存统计时段、账户 ID 和投递 ID。事件发生时间与接收服务器的到达时间应分列。 ## 结构字段与限制 · 接收广告活动事件 | 字段 | 文档取值 | | --- | --- | | Content-Type | application/json | | X-Orbito-Event | status_change \| hourly_digest \| ping | | X-Orbito-Delivery | UUID | | X-Orbito-Timestamp | Unix time | | X-Orbito-Signature | sha256= | | hourly_digest | :05 UTC | 来源 · [数据来源](https://adsly.pro/docs/api/webhooks/) ## 相关阅读 [发送已确认的转化](/zh/docs/api/conversions/)[API 版本与更新](/zh/docs/api/changelog/) 参考资料更新日期 2026-10-08 [上一主题**定向词典与群组**](/zh/docs/api/targeting/)[下一主题**发送已确认的转化**](/zh/docs/api/conversions/) ## 来源与数据 - [openapi.yaml](https://orbitoads.pro/docs/api/openapi.yaml) - [openapi.json](https://orbitoads.pro/docs/api/openapi.json)