Orbitoads
Belgelere göz at

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.

Markdown

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

Örnek
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"]
  }'
Örnek
{ "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.

Örnek
{
  "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ı
titleEvetPanelde gösterilen iç adı.
textEvetTelegram’in kendi uzunluğu ve içeriği kuralları uygulanır – bir reddetme görevi errors’de geri gelir.
promote_urlEvetReklam ne açıyor: https://t.me/channel, t.me/bot?start=ref, @channel veya bir web sitesi URL.
cpmEvetKabinetin 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.
budgetEvetPara 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_typeEvetchannels, bots, search veya users — aşağıda bakınız.
activeHiçbirfalse değiştirilmiştir oluşturur. varsayılan true .
daily_budgetHiçbirGünlük harcama kapısı.
views_per_userHiçbirBir kişi reklamı kaç kez görebilir, 1-4
mediaHiçbirGörüntü veya video token POST /v1/media .
pictureHiçbirtrue reklamda promosyon kanalının avatarını gösterir.
buttonHiçbirAd’ı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_nameHiçbirBir web sitesi reklamının üstünde gösterilen marka adı.
scheduleHiçbirReklamı 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

Örnek
{ "target_type": "channels", "channels": ["@durov", "t.me/telegram"],
  "languages": ["en"], "topics": [7, 26], "exclude_topics": [2], "add_similar_channels": true }
alanıanlamı
channels1-100 kamu kanalları: @name, name veya t.me/name.
languages, topics, exclude_topicsKanal diline ve konuya göre ince ( kodları ).
add_similar_channelsBu kanallara benzer kanallar da ekleyin.

bots — botlarda reklam göster

Örnek
{ "target_type": "bots", "bots": ["@somebot"] }

bots : 1-100 kamu botları.

search — Telegram arama soruları için reklamı göster

Örnek
{ "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

Örnek
{ "target_type": "users", "countries": ["DE", "AT"], "languages": ["de"],
  "topics": [26], "exclude_topics": [2], "audience_channels": ["@somechannel"] }
alanıanlamı
countriesISO ülke kodları.
languagesDil kodları için.
topics, exclude_topicsKonu ile ilgili bilgiler id.
audience_channelsBu 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

  1. Poll GET /v1/tasks/{id} ile completed arasındadır. ad_ids yeni kampanyaları tutar.
  2. Telegram her yeni reklamı inceliyor: başlıyor In ReviewSonra da olur Active ( ya da Declined). A Webhok Ne zaman anlatır.
  3. 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.

Örnek
curl -s -X POST "https://orbitoads.pro/api/v1/media?account_id=53" \
  -H "X-API-Key: $ORBITO_API_KEY" \
  -F "file=@banner.jpg"
Örnek
{ "success": true, "data": { "media": "BQACAgIAAx0…", "account_id": 53 } }
  • JPG, PNG, GIF, WEBP veya MP4, 10 MB'e kadar, alanı file'de multipart/form-data olarak 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

KoduNe zaman
VALIDATION_ERRORYanlış türün eksik, bilinmeyen bir alanı veya bu target_type - param'ye ait değildir.
IDEMPOTENCY_KEY_REQUIREDIdempotency-Key sayısı
ACCOUNT_ID_REQUIRED / ACCOUNT_NOT_FOUNDHangi kabine / bu kabine ulaşılamaz.
VIEW_ONLY_ACCESSBu kabineye Viewer erişimi var.
QUEUE_FULLBu kabineye 5 kişi katıldı.
CABINET_LOCKED, SUBSCRIPTION_REQUIREDHü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.

ParametreKonumBiçimZorunlu
Idempotency-KeyheaderstringEvet
X-API-KeyheaderstringEvet
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": []
  }
}
İstek gövdesi şeması
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"
    }
  ]
}
İstek sonuçları ve yanıt alanları
APIHTTPAnlamı
VALIDATION_ERROR400Tekrar denemeden önce alanları ve geçersiz değerleri düzeltin.
IDEMPOTENCY_KEY_REQUIRED400Yazma isteğine zorunlu Idempotency-Key başlığını ekleyin.
VIEW_ONLY_ACCESS403Viewer hesabı görüntüleyebilir. Değişiklik için hesap yazma izni gerekir.
QUEUE_FULL429Hesabı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.

ParametreKonumBiçimZorunlu
account_idqueryinteger—
X-API-KeyheaderstringEvet
Idempotency-Keyheaderstring—
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
  }
}
İstek gövdesi şeması
JSON Schema
{
  "properties": {
    "account_id": {
      "type": "integer"
    },
    "file": {
      "format": "binary",
      "type": "string"
    }
  },
  "required": [
    "file"
  ],
  "type": "object"
}
Örnek · 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"
      ]
    }
  ]
}

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öntemYolParametrelerİstek içeriğiYanıt kodları
POST/api/v1/campaignsIdempotency-Keyapplication/json · CreateSingleRequest | CreateBatchRequest202, 400, 401, 403, 404, 409, 422, 429, 503
POST/api/v1/mediaaccount_idmultipart/form-data · file, account_id200, 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

AlanBelgelenen değer
target_typechannels | bots | search | users
campaigns[]1 … 100
active =true
views_per_user1 … 4
budget≥ 0
Idempotency-KeyUUID

Kaynak · Veri kaynağı

CampaignInput

AlanAlan türü
titlestring
textstring
promote_urlstring
cpmnumber
daily_budgetnumber · 0 … ∞
views_per_userinteger · 1 … 4
mediastring
pictureboolean
buttonsubscribe | view | read | learn_more | download | open | sign_up | buy | order | play | try | leave_request
website_namestring
scheduleSchedule
budgetnumber · 0 … ∞
activeboolean · = true
target_typechannels | bots | search | users
channelsarray · [string] · 1 … 100
botsarray · [string] · 1 … 100
search_keywordsarray · [string] · 1 … 100
countriesarray · [string]
languagesarray · [string]
topicsarray · [integer]
exclude_topicsarray · [integer]
audience_channelsarray · [string]
add_similar_channelsboolean

Kaynak · Veri kaynağı

CreateBatchRequest

AlanAlan türü
account_idinteger
group_idinteger
new_group_namestring
campaignsarray · [CampaignInput] · 1 … 100

Kaynak · Veri kaynağı

CreativeFields

AlanAlan türü
titlestring
textstring
promote_urlstring
cpmnumber
daily_budgetnumber · 0 … ∞
views_per_userinteger · 1 … 4
mediastring
pictureboolean
buttonsubscribe | view | read | learn_more | download | open | sign_up | buy | order | play | try | leave_request
website_namestring
scheduleSchedule

Kaynak · Veri kaynağı

Kaynağın güncellenme tarihi

Pro Panel
Pro Panel