Campaign .: Get Details

API Reference / v15

Get details of a Campaign

This endpoint returns details of a campaign as it applies to the user. To view a campaign’s details, you must have a user access token with the manage_user_campaigns permission.

Request Endpoint

GET /v15/campaigns/:id/:representation_type

Authorization Required – User Token in Header

Submit a user token with the manage_user_campaigns permission in the Authorization header.

Authorization: token 981-64eef337afa90f88bb897160f686dc9c64a4ff5848eeb8410942e0eecd35f1

Representation Types

Parameters Description
basic_v1 Basic title and description of campaign.
item_based_loyalty_v1 Progress, required items and reward for item based loyalty campaign.
spend_based_loyalty_v1 Progress and requirements for spend based loyalty campaign.
visit_based_loyalty_v1 Progress and requirements for visit based loyalty campaign.

Basic Representation cURL Example

curl https://sandbox.thelevelup.com/v15/campaigns/20/basic_v1 \
  -H Accept:application/json \
  -H Content-Type:application/json \
  -H 'Authorization:token 981-64eef337afa90f88bb897160f686dc9c64a4ff5848eeb8410942e0eecd35f1'

Basic Representation Example Response

HTTP/1.1 200 OK

{
  "campaign": {
    "description": "Visit 10 times, get $10!",
    "title": "Loyalty"
  }
}

Basic Response Parameters

Parameters Description
description Campaign description.
`title Campaign title.

Item Based Loyalty cURL Example

curl https://sandbox.thelevelup.com/v15/campaigns/285/item_based_loyalty_v1 \
  -H Accept:application/json \
  -H Content-Type:application/json \
  -H 'Authorization:token 981-64eef337afa90f88bb897160f686dc9c64a4ff5848eeb8410942e0eecd35f1'

Item Based Loyalty Example Response

{
  "campaign": {
    "progress_item_count": 0,
    "required_item_count": 10,
    "required_item_plural": "Coffees",
    "required_item_singular": "Coffee",
    "reward_article": 'a',
    "reward_title": "$1 Loyalty Reward"
  }
}

Item Based Loyalty Response Parameters

Parameters Description
progress_item_count Number of qualifying items that have been purchased.
required_item_count Required number of qualifying items that must be purchased.
required_item_plural Plural name of required item.
required_item_singular Singular name of required item.
reward_article Article for displaying reward in a description (‘a’ coffee, 'an’ omelet).
reward_title Reward title.

Spend Based Loyalty cURL Example

curl https://sandbox.thelevelup.com/v15/campaigns/286/spend_based_loyalty_v1 \
  -H Accept:application/json \
  -H Content-Type:application/json \
  -H 'Authorization:token 981-64eef337afa90f88bb897160f686dc9c64a4ff5848eeb8410942e0eecd35f1'

Spend Based Loyalty Example Response

{
  "campaign": {
    "earn_amount": 1000,
    "progress_amount": 0,
    "required_spend_amount": 10000
  }
}

Spend Based Loyalty Response Parameters

Parameters Description
earn_amount Amount rewarded when required amount is spent.
progress_amount Amount spent.
required_spend_amount Required amount that must be spent to earn reward.

Visit Based Loyalty cURL Example

curl https://sandbox.thelevelup.com/v15/campaigns/287/visit_based_loyalty_v1 \
  -H Accept:application/json \
  -H Content-Type:application/json \
  -H 'Authorization:token 981-64eef337afa90f88bb897160f686dc9c64a4ff5848eeb8410942e0eecd35f1'

Visit Based Loyalty Example Response

{
  "campaign": {
    "progress_visit_count": 0,
    "required_visit_count": 10,
    "earn_amount": 1000,
    "qualifying_order_spend_amount": 0
  }
}

Visit Based Loyalty Response Parameters

Parameters Description
progress_visit_count Number of eligible visits.
required_visit_count Required number of eligible visits to earn reward.
earn_amount Reward value.
qualifying_order_spend_amount Minimum spend amount for order to be eligibile to count as a visit.

Errors

The campaign does not exist or cannot be displayed

HTTP/1.1 404 Not Found