api
Native Ad Server API
Build native ads into your web page or app
dvr
Sponsored Listings API
Let sellers promote their product at the top of the list
grid_view
Promoted Content API
Add promoted content based on search queries or keywords
desktop_windows
Digital-Out-Of-Home (DOOH) API
Reach out of home audiences on screens or billboards
campaign
Internal Promotions API
Offer users vouchers or promo codes at the right time
api
Decision API
Returns a JSON response with ads
api
Management API
Manage campaigns and inventory
api
Reports API
Custom reports and data shipping
monitor_heart
API Status
Live network infrastructure status
AdFlight.io Logo
AdFlight.io
Ad Server APIs for Developers
topic Getting Started
Authentication
Error Handling
api Decision API
Ad Request
Ad Response
Logging Events
api Management API
Channels
Zones
Advertisers
Campaigns
Creatives
api Reporting API
Reports

Logging Events

Endpoint

get
/v2/event/{event_key}/{event_token}

URI Parameters

You can log an event by calling the event endpoint appended with an event key and token.

event_key
string, required
Find a list of event keys in your AdFlight portal. Common event keys are impressions, clicks and conversions. You can create up to 100 custom events.
event_token
object, required
The event_token that you got from the ad response. It's located inside the ads object.

Token Invalidation

The tokens you're using to log events are user specific and can be invalidated for several reasons:
  • The same token was fired more than once in the last 24 hours.
  • The token was fired >24 hours after the original ad request was made.
Example Request
{
     "ads": {
         "div1": [{
             "advertiser_id": 645091658,
             "campaign_id": 811263544,
             "channel_id": 488223173,
             "creative_id": 770775699,
             "data": [0],
             "event_token": "eyJybmQiOiIxNjYxMDIzMTczLjkzNzM1NDQ5NDIiLCJjaGFubmVsX2lkIjo0ODgyMjMxNzMsInpvbmVfaWQiOjUzNzQ3Nzk4NCwiYWR2ZXJ0aXNlcl9pZCI6NjQ1MDkxNjU4LCJjYW1wYWlnbl9pZCI6ODExMjYzNTQ0LCJjcmVhdGl2ZV9pZCI6NzcwNzc1Njk5fQ",
             "zone_id": 537477984
        }],
         "div2": [{
             "advertiser_id": 166409558,
             "campaign_id": 263811544,
             "channel_id": 882243173,
             "creative_id": 077775699,
             "data": [0],
             "event_token": "bmQiOiIxNjYeyJyxMDIzMTczLjkzNzM1NDQ5NDIiLCJjaGFubmVsX2lkIjo0ODgyMjMxNzMsInpvbmVfaWQiOjUzNzQ3Nzk4NCwiYWR2ZXJ0aXNlcl9pZCI6NjQ1MDkxNjU4LCJjYW1wYWlnbl9pZCI6ODExMjYzNTQ0LCJjcmVhdGl2ZV9pZCI6NzcwNzc1Njk5fQ",
             "zone_id": 798453747
        }]
    }
format_quoteThese plug & play ad serving APIs have cut down developement cost tremendously. Absolutely a huge time saver for anyone who wants to build a custom ad server in a short time.
Hayden Elson
starstarstarstarstar
Developer at Galactic Media