Campaigns .: List by Location

API Reference / v15

List a Location’s Campaigns

These endpoints will return the campaigns available at the Location or Merchant that are relevant for the user. You must use a user access token with the manage_user_campaigns permission in order to access this endpoint.

Request Endpoint

GET /v15/locations/:location_id/campaigns

Authorization Required – User Token in Header

Authorization: token user="1123-15d2aeedc9f4e0e7094a9d283868f8fbe873cb85ceaa0c511727245aec8c9e"

cURL Example

curl 'https://sandbox.thelevelup.com/v15/locations/117/campaigns' \
  -H "Accept: application/json" \
  -H "Content-Type: application/json" \
  -H "Authorization user=1123-15d2aeedc9f4e0e7094a9d283868f8fbe873cb85ceaa0c511727245aec8c9e"

Example #1 Response

HTTP/1.1 200 OK

[{
    "campaign": {
        "id": 20,
        "representation_types": ["basic_v1", "visit_based_loyalty_v1"]
    }
}]

Response Parameters

Param Type Description
id Integer The ID of the campaign.
representation_types Array of Strings The available representation_types for the campaign.

Campaign Inclusion

The list endpoints above will include campaigns that merchants have chosen to have as listed. Locations/merchants can run both listed and unlisted campaigns, but only listed campaigns are displayed in-app. For example, a merchant might run a birthday campaign that it lists while keeping its reengagement campaign unlisted.

Representation Type Inclusion

A campaign will always have a basic representation, and may have more detailed representations as well. For a given app and campaign, all of the implemented public representation types will be included, but only the private representation types for which the app has permission will be included. For example, there might be a very custom representation that LevelUp supports for an example app that is not relevant to global apps.