API 快速入门
在服务端使用密钥获取账户列表,选择账户并查询广告活动。首次写入时使用新的幂等键创建暂停的草稿,再查询返回的任务编号。
通过 Orbito Ads API,可在自己的应用中执行面板支持的 Telegram Ads 账户管理操作。Euro、TON 和 Stars 账户共用一套方法、一个基础地址和同一密钥。
基础 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显示其位置(参见地位 ) 。 A 网页告诉您它改变的时刻。
集成的五条规则
ad_id它仅在广告账户内独特。 Telegram 复用广告标识横跨柜子,存储并查看对子(account_id, ad_id)的广告活动,每当有钥匙看到一个以上的柜子时通过account_id.- 发送一
Idempotency-Key创建、复制、大批和预算呼叫 — 每起手术都新鲜出UUID起, 重试时也一样。 重试之后再也没有创造第二次广告活动或两次移动钱财。 见无能 。 - 创建、复制和大批返回任务。 Poll
GET /v1/tasks/{id}直到完成,见任务 . - 金钱是线条 (
"spent": "3.541000") 来保持精确的十进制。在进行算术前将其分析为十进制 。 - 分支在
code展览error. 每个出错都有稳定的机读code和error中的人文句子. See 错误 .
响应结构
{ "success": true, "data": { … }, "meta": { … } }
{ "success": false, "error": "Human-readable message", "code": "MACHINE_CODE", "request_id": "…" }后续步骤
- 关键与访问 — 只读 vs 广告活动管理密钥, 代理团队.
- 与克劳德和其他AI助理一起建造 — 让一个编码代理编写集成.
- OpenAPI SPEC — 从Postman, Insomnia 或客户端生成器中导入.
API 参考
完整广告接口需要为此工作区单独配置供应商凭据。客户端请求使用自己的 Orbito API 密钥。账户订购、开通和外部账单分别处理。
curl -X GET https://orbitoads.pro/api/v1/account/info \
-H 'X-API-Key: YOUR_ORBITO_KEY'{
"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 |
来源 · 数据来源
结构字段与限制 · API 快速入门
| 字段 | 文档取值 |
|---|---|
| X-API-Key | HTTP header |
| Content-Type | application/json |
| 202 | Location, Retry-After |
来源 · 数据来源
CampaignStatus
| 字段 | 字段类型 |
|---|---|
| CampaignStatus | Active | In Review | Declined | On Hold | Stopped | Paused | Deleted |
来源 · 数据来源
参考资料更新日期