Campaign API Calls

If you are a premium WingCash member, you can create campaigns that track offer performance. The campaign API calls let you (or a trusted third party) download a detailed stream of events so you can build your own dashboards and performance reports.

Campaign Information

GET /campaign/list

List the campaigns visible to the authenticated profile. Includes related information about all offers tracked by the listed campaigns and the cash designs provided by the listed offers.

Permission Required:
 

track_campaign. See Permissions.

Request Headers:
 
Query Parameters:
 
  • version – Optional. If provided, must be 1.
  • access_token – Optional alternative to the Authorization Header.
Status Codes:
  • 200 OK

    Successful. The response body is a JSON object with these attributes:

    campaigns
    A list campaign objects. Each object has id, title, description, manage_url, filter_by_loop, loop_ids, tracked_offer_ids, and trackable attributes. When filter_by_loop is true, the loop_ids attribute limits the events captured by the campaign. The trackable_offer_ids is a list of offer IDs being tracked by the campaign. The trackable attribute is a boolean value indicating whether the authenticated profile is allowed to track the campaign.
    offer_links
    A mapping of offer_id to an object with title, loop_ids, and manage_url attributes. Contains information about all offers listed in campaigns. Each loop_ids attribute lists the loops provided by the offer.
    loop_links
    A mapping of loop_id to an object with title, thumbnail and manage_url attributes. Contains information about all cash loops listed in offer_links.
  • 401 Unauthorized – The access token is missing, not valid, or the hard expiration has passed. See Unauthorized Response.
  • 403 Forbidden – The access token is valid but the app is not authorized to access this function.

Download Events

GET /campaign/events

Download campaign events. By default, include events from all campaigns the authenticated profile is allowed to track.

Permission Required:
 

track_campaign. See Permissions.

Request Headers:
 
Query Parameters:
 
  • version – Optional. If provided, must be 1.
  • access_token – Optional alternative to the Authorization Header.
  • start – Optional string containing a UTC date and time in ISO 8601 format. Specifies the earliest event timestamp to include in the results.
  • end – Optional string containing a UTC date and time in ISO 8601 format. Specifies the latest event timestamp to include in the results.
  • limit – Optional integer specifying the maximum number of events to return. Defaults to 10000. The maximum is currently 1000000 (one million).
  • offset – Optional integer specifying how many events to skip. Defaults to 0.
  • campaign_ids – An optional whitespace-delimited list of campaign_ids. If this is specified, only events from the given campaigns will be included.
Status Codes:
  • 200 OK

    Successful. The response body is a JSON object with these attributes:

    events
    A list of CampaignEvent objects.
    more
    Boolean; true if the limit parameter truncated the result. When this is true, your app can download more events by increasing the limit parameter or by setting the offset parameter.
  • 400 Bad Request – The parameters are not valid. The response body contains an InvalidRequest object.
  • 401 Unauthorized – The access token is missing, not valid, or the hard expiration has passed. See Unauthorized Response.
  • 403 Forbidden – The access token is valid, but the app is not authorized to access either this function or one of the campaigns specified.
  • 404 Not Found – At least one of the campaigns specified could not be found.