Campaigns .: Unlock

API Reference / v15

Unlock a campaign for a user

This endpoint unlocks a campaign for a user on the given locked campaign.

Request Endpoint

POST /v15/campaign_unlockings

Authorization Required – Merchant User Token in Header

To create a campaign unlocking, you must have a merchant access token with the give_merchant_funded_credit permission.

Authorization: token merchant="123548-WQJasbuWaaNrRUABjMCF1FZnaR381C2cQMM7JHEGebMDZLDKWFMqbRMkuVmQr7"

Request Body

{
  "campaign_unlocking": {
    "target_campaign_id": 444,
    "user_id": 34593,
    "expires_at": "12/31/2017"
  }
}

Request Parameters

Parameter Type Required Description
target_campaign_id Integer Yes ID of locked campaign to create campaign unlocking for.
email String Yes/No Email of existing user to create campaign unlocking for (must supply one of email or ID).
user_id Integer Yes/No ID of existing user to create campaign unlocking for (must supply one of email or ID).
expires_at DateTime No Date/Time when the campaign unlocking will expire for the user.

Example Call

curl https://sandbox.thelevelup.com/v15/campaign_unlockings \
  -iH 'Accept: application/json' \
  -H 'Content-Type: application/json' \
  -H 'Authorization: token merchant="123548-WQJasbuWaaNrRUABjMCF1FZnaR381C2cQMM7JHEGebMDZLDKWFMqbRMkuVmQr7"' \
  -d '{
    "campaign_unlocking": {
      "target_campaign_id": 444,
      "user_id": 34593,
      "expires_at": "12/31/2017"
    }
  }'

Example Response

HTTP/1.1 204 No Content

Errors

Email does not match existing User

HTTP/1.1 422 Unprocessable Entity

[
  {
    "error": {
      "message": "Email does not match any User",
      "object": "campaign_unlocking",
      "property": "email"
    }
  }
]

Merchant token not associated with given campaign

HTTP/1.1 401 Unauthorized