Kampanya oluşturma ve medya
Bir istekte bir hesap için 100 kampanya oluşturulur. Kanal, bot, arama veya kitleyi seçin, benzersiz işlem anahtarı gönderip görevi izleyin. Gerekli medyayı önceden yükleyin.
POST /v1/campaigns tek hesapta kampanya oluşturur. Kampanya yönetim izinli anahtar ve Idempotency-Key başlığı gerekir. 202 yanıtı bir görev içerir. Kampanyalar görev tamamlanınca görünür.
Kampanya oluşturma örneği
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": [] } }Toplu oluşturma
Kampanyaları campaigns'e koyun (yaklaşık 100'e kadar). account_id ve grup alanları üst düzeyde kalır ve bunların hepsine uygulanır.
{
"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"] }
]
}Kampanyalar birer birer oluşturulur. eğer ilk başarısız olursa, görev durur - aynı hatayı 100 kez tekrarlamak yerine giriş düzeltmek. her başarısızlık görev errors ile index aralığınızda listelenir.
Alanlar
| alanı | İhtiyaç | anlamı |
|---|---|---|
title | Evet | Panelde gösterilen iç adı. |
text | Evet | Telegram’in kendi uzunluğu ve içeriği kuralları uygulanır – bir reddetme görevi errors’de geri gelir. |
promote_url | Evet | Reklam ne açıyor: https://t.me/channel, t.me/bot?start=ref, @channel veya bir web sitesi URL. |
cpm | Evet | Kabinetin para biriminde 1000 izlenme başına ödeme, 0'dan daha büyük. hedeflemek için çok düşük → Telegram 's minimum hataya geri dönüyor. |
budget | Evet | Para kampanyadan kampanyaya taşınır: 0 , ya da en azından min_budget ( Reklam Hesabı ) . 0 ile reklam oluşturulur ama bütçe eklediğiniz sürece çalışamaz. |
target_type | Evet | channels, bots, search veya users — aşağıda bakınız. |
active | Hiçbir | false değiştirilmiştir oluşturur. varsayılan true . |
daily_budget | Hiçbir | Günlük harcama kapısı. |
views_per_user | Hiçbir | Bir kişi reklamı kaç kez görebilir, 1-4 |
media | Hiçbir | Görüntü veya video token POST /v1/media . |
picture | Hiçbir | true reklamda promosyon kanalının avatarını gösterir. |
button | Hiçbir | Ad’ın altındaki düğme: subscribe, view, read, learn_more, download, open, sign_up, buy, order, play, try, leave_request. Reklam hesabının yalnızca features.ad_button O kadar true. |
website_name | Hiçbir | Bir web sitesi reklamının üstünde gösterilen marka adı. |
schedule | Hiçbir | Reklamı yalnızca seçilen haftalar ve saatlerde gösterin, e.g . haftalar 9:00-18:00. biçim: Programı . olmadan reklam saatin etrafında çalışır. |
Sadece üst düzey: account_id ( anahtarın birkaç kabinete ulaştığı zaman gereklidir), group_id (var olan Grup) veya new_group_name (grup oluşturur veya bu isimle birini yeniden kullanır).
Bilinmeyen alanlar 400 VALIDATION_ERROR ile reddedilir ve alan adı param'de - bir tip asla sessizce bir ayar atmaz.
Hedefleme
channels — belirli kanallarda reklam göstermek
{ "target_type": "channels", "channels": ["@durov", "t.me/telegram"],
"languages": ["en"], "topics": [7, 26], "exclude_topics": [2], "add_similar_channels": true }| alanı | anlamı |
|---|---|
channels | 1-100 kamu kanalları: @name, name veya t.me/name. |
languages, topics, exclude_topics | Kanal diline ve konuya göre ince ( kodları ). |
add_similar_channels | Bu kanallara benzer kanallar da ekleyin. |
bots — botlarda reklam göster
{ "target_type": "bots", "bots": ["@somebot"] }bots : 1-100 kamu botları.
search — Telegram arama soruları için reklamı göster
{ "target_type": "search", "search_keywords": ["crypto wallet", "bitcoin"] }search_keywords : 1-100 cümle, her biri 64 karakter kadar.
users — bir seyirciye reklam göstermek
{ "target_type": "users", "countries": ["DE", "AT"], "languages": ["de"],
"topics": [26], "exclude_topics": [2], "audience_channels": ["@somechannel"] }| alanı | anlamı |
|---|---|
countries | ISO ülke kodları. |
languages | Dil kodları için. |
topics, exclude_topics | Konu ile ilgili bilgiler id. |
audience_channels | Bu kanalları okuyanlar. |
Bunlardan en az birinin gerekli olması gerekir. kodlar: hedef kodları .
Kanallar, botlar ve anahtar kelimeler Telegram’in kendi kimliklerine çözülür. Telegram bulamayanlar kaybolur; bulamıyorsa, kampanya başarısız olur – No targets found: … kanallar ve botlar için, No valid search queries found anahtar Kelimeler için – ve errors’in dediği gibi.
Kampanya oluşturulduktan sonra
- Poll
GET /v1/tasks/{id}ilecompletedarasındadır.ad_idsyeni kampanyaları tutar. - Telegram her yeni reklamı inceliyor: başlıyor
In ReviewSonra da olurActive( ya daDeclined). A Webhok Ne zaman anlatır. - Değiştirin, fon veya Kampanyaları Yönetmek ile bunları durdurun.
Medya yükleme
POST /v1/media bir kabineye bir görüntü veya video yükler ve POST /v1/campaigns , PATCH ve kopya için media tokenini geri getirir.
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 veya MP4, 10 MB'e kadar, alanı
file'demultipart/form-dataolarak gönderilir. - Bazı kabineler sadece 16:9 görüntüleri en az 640 px genişlikte kabul eder; bir dosya uygun değilse, Telegram 's nedeni
error'de geri gelir.
Hatalar
| Kodu | Ne zaman |
|---|---|
VALIDATION_ERROR | Yanlış türün eksik, bilinmeyen bir alanı veya bu target_type - param'ye ait değildir. |
IDEMPOTENCY_KEY_REQUIRED | Idempotency-Key sayısı |
ACCOUNT_ID_REQUIRED / ACCOUNT_NOT_FOUND | Hangi kabine / bu kabine ulaşılamaz. |
VIEW_ONLY_ACCESS | Bu kabineye Viewer erişimi var. |
QUEUE_FULL | Bu kabineye 5 kişi katıldı. |
CABINET_LOCKED, SUBSCRIPTION_REQUIRED | Hükümet şu anda manuel değişiklikler yapamaz. |
Bireysel kampanya başarısızlıkları (Telegram bir metin, bir teklif, bir bağlantı reddetti) başvuru başarısız olmaz - bunlar görev errors'de görünür.
API başvurusu
Tam reklam sözleşmesi bu çalışma alanına ayrılmış bir sağlayıcı anahtarı gerektirir. İstemci çağrılarında Orbito API anahtarınızı kullanın. Hesap siparişi, tahsis ve dış faturalama ayrı süreçlerdir.
POST /api/v1/campaigns
Bir hesapta bir veya en çok 100 kampanyanın oluşturulmasını sıraya alır.
| Parametre | Konum | Biçim | Zorunlu |
|---|---|---|---|
Idempotency-Key | header | string | Evet |
X-API-Key | header | string | Evet |
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
}'{
"success": true,
"data": {
"id": 96203,
"type": "create",
"status": "pending",
"account_id": 7401,
"total": 1,
"ad_ids": []
}
}İstek gövdesi şeması
{
"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 | Anlamı |
|---|---|---|
| VALIDATION_ERROR | 400 | Tekrar denemeden önce alanları ve geçersiz değerleri düzeltin. |
| IDEMPOTENCY_KEY_REQUIRED | 400 | Yazma isteğine zorunlu Idempotency-Key başlığını ekleyin. |
| VIEW_ONLY_ACCESS | 403 | Viewer hesabı görüntüleyebilir. Değişiklik için hesap yazma izni gerekir. |
| QUEUE_FULL | 429 | Hesabın kuyruğunda beş oluşturma işi var. Yer açılmasını bekleyin. |
POST /api/v1/media
Kreatif medyayı yükleyip hesaba özel dosya belirteci alır.
| Parametre | Konum | Biçim | Zorunlu |
|---|---|---|---|
account_id | query | integer | — |
X-API-Key | header | string | Evet |
Idempotency-Key | header | string | — |
curl -X POST 'https://orbitoads.pro/api/v1/media?account_id=7401' \
-H 'X-API-Key: YOUR_ORBITO_KEY' \
-F file=@./club-cover.png{
"success": true,
"data": {
"media": "example-media-718",
"account_id": 7401
}
}İstek gövdesi şeması
{
"properties": {
"account_id": {
"type": "integer"
},
"file": {
"format": "binary",
"type": "string"
}
},
"required": [
"file"
],
"type": "object"
}{
"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"
]
}
]
}Uygulama notları
Tek kampanya veya toplu istek
Tek kampanyada title, text, promote_url, cpm, budget ve target_type köktedir. Toplu istekte campaigns 1–100 girdi içerir, hesap ve grup kökte ortaktır. Bütçe sıfır veya en az min_budget olmalıdır.
Hedefleme ve dosyalar
channels, bots, search veya users seçin. Kanal, bot ve arama listesi 1–100 girdi, arama ifadesi en çok 64 karakter alır. Kitlede bir filtre gerekir. En çok 10 MB JPG, PNG, GIF, WebP ve MP4 yükleyen hesaba bağlıdır.
Kabul ve tamamlanma
Oluşturma, kopyalama ve toplu istekler HTTP 202 ve iş kimliği döndürür. Retry-After'a uyarak GET /api/v1/tasks/{id} sorgulayın. completed durumunda da failed ve errors alanlarını kontrol edin.
İşlemler ve alanlar
POST /api/v1/campaigns POST /api/v1/media channels bots search users
- POST /api/v1/campaigns
- POST /api/v1/media
- channels
- bots
- search
- users
İstek örneği
GET /api/v1/targeting HTTP/1.1 Host: orbitoads.pro X-API-Key: {key}
Şema alanları ve sınırları
Tablo açık v1 sözleşmesine dayanır. Parametre ve alan adları büyük-küçük harfe duyarlıdır. HTTP kodları başarıyı, girdi doğrulamasını ve erişim kontrollerini ayırır. Bağlı belirtim tam istek ve yanıt yapılarını verir.
Kitle testi ayarları
Oluşturma şeması dört hedefleme modu tanımlar. Kanallar channels, bot adları bots, arama ifadeleri search_keywords alanına girer. Ülke, dil ve konu filtreleri kullanıcı kitlesini tarif eder. Testten önce hesabın özelliklerini okuyun.
Protokol başvurusu
| Yöntem | Yol | Parametreler | İstek içeriği | Yanıt kodları |
|---|---|---|---|---|
| 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 |
Kaynak · Veri kaynağı
Şema alanları ve sınırları · Kampanya oluşturma ve medya
| Alan | Belgelenen değer |
|---|---|
| target_type | channels | bots | search | users |
| campaigns[] | 1 … 100 |
| active = | true |
| views_per_user | 1 … 4 |
| budget | ≥ 0 |
| Idempotency-Key | UUID |
Kaynak · Veri kaynağı
CampaignInput
| Alan | Alan türü |
|---|---|
| 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 |
Kaynak · Veri kaynağı
CreateBatchRequest
| Alan | Alan türü |
|---|---|
| account_id | integer |
| group_id | integer |
| new_group_name | string |
| campaigns | array · [CampaignInput] · 1 … 100 |
Kaynak · Veri kaynağı
CreativeFields
| Alan | Alan türü |
|---|---|
| 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 |
Kaynak · Veri kaynağı
Kaynağın güncellenme tarihi