Code Redemption Campaign


Request Details

Item Value
Description Returns details on a specific code redemption campaign
Method GET
Endpoint https://api.crowdtwist.com/v2/code_redemption_campaign?api_key=[api_key]&id=[id]&id_type=[id_type]


Request

Field Name Sample Value Required Format Notes
URL PARAMETERS – none      
QUERY STRING PARAMETERS      
api_key QWERTYUIOP Yes String  
id 34 Yes String The id to be used to identify the code redemption campaign.
id_type 1 Yes String The type of ID sent. Options:
  1 = activity_id: ID of the activity related to the code redemption campaign.
  2 = campaign_id: ID of the code redemption campaign.


Successful Response

Field Name Sample Value Required Format Description
id 64 Yes String Internal CrowdTwist activity id
title Flyer Code Redemption Campaign Yes String The title of the activity
description Get 100 points every time you submit a code from one of our flyers. Yes String The description of the activity
code_field_name Enter Code Yes String Text for code input field
date_start 1425404945 Yes String Date campaign starts
date_end 1425404945 Yes String Date campaign ends
enable_email 1 No Integer Boolean value indiviating if enabled
enable_verify_checkbox 1 No Integer Boolean value indicating if verification checkbox required.
image http://www.imagestorage.com/image Yes URL Image of code redemption campaign.
enable_tos 1 No Integer Boolean value indicating if Terms Of Service to be shown.
tos_text I agree to the terms of service No String If TOS enabled – text to be shown next to checkbox indicating agreement.
tos_link_url http://www.tosurl.com No URL If TOS enabled – url to be shown with TOS text.
questions Question Object No Array Optional array of questions to be asked during redemption.

Successful Response: Question Object

Field Name Sample Value Required Format Description
id 18 No String ID of question
is_required 1 No Boolean Boolean value of whether question is required
title What is your favorite color? No String Title of question
type 1 No Integer Type of question. Options:
  1 = text field
  2 = drop-down
  3 = text area
  4 = date
  5 = checkbox
options Array of option objects No Array Array of drop-down options.

Successful Response: Question Option Object

Field Name Sample Value Required Format Description
id 48 No String ID of question
value Blue No String Value of option


Error Response

Field Name Sample Value Required Format Description
error param_error Yes String A machine readable code that describes the error.
message Missing the user_id parameter Yes String A short, descriptive sentence detailing the error.


Error Response Codes

Error Message
input_error The input provided in invalid or formatted incorrectly.
internal_error Something went wrong on our end.
page_not_found The requested page does not exist or has been removed.
param_error A missing or invalid parameter is included in the request.


Sample Request

curl -X GET
https://api.crowdtwist.com/v2/code_redemption_campaign?api_key=[api_key]&id=[id]&id_type=[id_type]
curl -X GET
https://api.crowdtwist.com/v2/code_redemption_campaign?api_key=[api_key]&id=[id]&id_type=[id_type]


Sample Successful Response: Status Code 200

{
  "id": "64",
  "title": "Flyer Code Redemption Campaign",
  "description": "Get 100 points every time you submit a code from one of our flyers.",
  "code_field_name": "Enter Code:",
  "date_start": 1425404945,
  "image": "http://www.imagestorage.com/image",
  "questions": [
    {
      "id": "18",
      "is_required": 1,
      "title": "What is your favorite color?",
      "type": 2,
      "options": [
        {
          "id": "48",
          "value": "blue"
        },
        {
          "id": "49",
          "value": "red"
        }
      ]
    }
  ]
}
{
  "id": "64",
  "title": "Flyer Code Redemption Campaign",
  "description": "Get 100 points every time you submit a code from one of our flyers.",
  "code_field_name": "Enter Code:",
  "date_start": 1425404945,
  "image": "http://www.imagestorage.com/image",
  "questions": [
    {
      "id": "18",
      "is_required": 1,
      "title": "What is your favorite color?",
      "type": 2,
      "options": [
        {
          "id": "48",
          "value": "blue"
        },
        {
          "id": "49",
          "value": "red"
        }
      ]
    }
  ]
}

Sample Error Response: Status Code 400

{
  "error": "param_error", 
  "message": "Campaign does not exist."
}
{
	"error": "param_error", 
	"message": "Campaign does not exist."
}