Campaigns .: Claim

API Reference / v15

Claim a Campaign

This endpoint claims a campaign via a cohort code.

Request Endpoint

POST /v15/codes/:cohort_code/claims

Authorization Required – User Token in Header

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

Authorization: token 981-64eef337afa90f88bb897160f686dc9c64a4ff5848eeb8410942e0eecd35f1

Request Body

None

cURL Example

curl -X POST https://sandbox.thelevelup.com/v15/codes/N72HFXIYDA/claims \
  -H Accept:application/json \
  -H Content-Type:application/json \
  -H 'Authorization:token 981-64eef337afa90f88bb897160f686dc9c64a4ff5848eeb8410942e0eecd35f1'

Example Response

HTTP/1.1 200 OK

{
  "claim": {
    "id": 25,
    "campaign_id": 2,
    "code": "N72HFXIYDA",
    "value_amount": 100,
    "value_remaining_amount": 100
  }
}

Errors

The campaign does not exist

HTTP/1.1 404 Not Found

[
  {
    "error": {
      "object": "claim",
      "property": "base",
      "message": "This doesn't appear to be a LevelUp Code."
    }
  }
]

If the campaign is not claimable for any reason

HTTP/1.1 422 Unprocessable Entity

[
  {
    "error": {
      "object": "claim",
      "property": "base",
      "message": "Sorry, you cannot claim this promotion at this time."
    }
  }
]