Skip to content

SSP/Publisher Integration Telegram Bot Message ​

Request ​

Telegram integration is implemented with a POST request containing a JSON object in its body.

http
POST http://15068.xml.adx1.com/telegram-mb

The Simplest Request Body Sample ​

json
{
 "language_code": "en",
 "publisher_id": "792361"
}

Full Request Body Sample ​

json
{
 "language_code": "en",
 "publisher_id": "792361",
 "widget_id": "351352",
 "bid_floor": 0.0001,
 "telegram_id": "515279737",
 "production": true
}

API Parameters Reference ​

ParameterTypeRequiredDescription
language_codeStringYesUser language in alpha-2 format
publisher_idStringYesPublisher ID
widget_idStringNoMini App ID
telegram_idStringNoTelegram ID number
bid_floorDoubleNoMinimum bid expressed in CPC or CPM depending on SSP configuration
productionBooleanNoIndicates whether the request is made in production mode. false is used for initial tests to ensure that SSP is integrated correctly (test responses will be returned). Defaults to true if not specified.

Response Sample ​

json
[
    {
        "title": "test",
        "message": "tests",
        "image": "https://eu.boxthis.xyz/nty/metrics/save.img?event=impressions&bid-id=v2-1746187564185-14-14868-1428851-229a33a2-bbff-75bb-6895-31a1cd9e56b9&img=https%3A%2F%2Fcdn.amnew.net%2Ffiles%2F67196851bf7f0_2024_10_23_09_19_13_image.jpeg",
        "image_preload":"https://cdn.amnew.net/files/66d6d40333b3b_2024_09_03_09_16_51_image.webp",
        "notification_url": "https://eu.boxthis.xyz/nty/metrics/notification?key=v2-1746187564185-14-14868-1428851-229a33a2-bbff-75bb-6895-31a1cd9e56b9",
        "link": "https://eu.boxthis.xyz/nty/postback/click?key=v2-1746187564185-14-14868-1428851-229a33a2-bbff-75bb-6895-31a1cd9e56b9",
        "brand": "brand",
        "button": "test",
        "bid_price": 0.31
    }
]

Response JSON Attributes ​

ParameterTypeDescription
titleStringCreative Title
messageStringCreative Message
imageStringLink to creative banner
image_preloadStringDirect image
notification_urlStringTrigger this notification to notify us that impression happened
linkStringClick URL
brandStringBrand Name
buttonStringButton Text
bid_priceDoubleBid price expressed in CPC or CPM depending on SSP configuration

1. Request ad from RichAds ​

http
curl -X POST "http://15068.xml.adx1.com/telegram-mb" \
-H "Content-Type: application/json" \
-d '{
  "language_code": "en",
  "publisher_id": "792361",
  "widget_id": "351352",
  "bid_floor": 0.0001,
  "telegram_id": "515279737",
  "production": true
}'

2. Send received ad from RichAds to your bot ​

http
curl --location 'https://api.telegram.org/bot<YOUR_BOT_TOKEN>/sendPhoto' \
     --form 'chat_id="123456789"' \
     --form 'photo="https://eu.skated.co/nty/metrics/save.img?event=impressions&bid-id=v3-14-14768-1447584"' \
     --form 'caption="Great White Buffalo Offer! Get Your 40 Free Spins Now With Promo Code 40GWB!🎁"' \
     --form 'reply_markup="{\"inline_keyboard\":[[{\"text\":\"GO\!\",\"url\":\"https://eu.skated.co/nty/postback/click?key=v3-14-14768\"}]]}"'