Get Code Campaign Details

Request Details

Item Value
Description This endpoint returns details on a specific code redemption campaign.
Method GET
Endpoint https://[environment]api[client_id].crowdtwist.com/v2/code_redemption_campaign?api_key=[api_key]&id=[id]&id_type=[id_type]
HTTP Header X-CT-Authorization = CTApiKey [API Key]
Note: There is a space between CTApiKey and the API Key value.
Content Type application/json

Request

Field Name Sample Value Required Format Description
URL PARAMETERS– none      
QUERY PARAMETERS      
api_key QWERTYP 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.

Response

Response Body

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 No String Date campaign ends.
enable_email 1 Yes Boolean Boolean value indicating  1 if enabled and 0 if disabled.
is_enabled 1 Yes Boolean Boolean value indicating 1 if Code redemption is enabled and 0 if disabled.
image http://www.imagestorage.com/image Yes String Image of code redemption campaign.
enable_tos 1 Yes 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 String If TOS enabled – url to be shown with TOS text.
questions See the QUESTIONS ARRAY section. No Array Optional array of questions to be asked during redemption.
QUESTIONS ARRAY
id 18 Yes String ID of question.
is_required 1 Yes Integer Boolean value of whether question is required.
title What is your favorite color? Yes String Title of question.
type 1 Yes Integer Type of question:  
1 = text field  
2 = drop-down  
3 = text area  
4 = date  
5 = checkbox
options [a,b] No Array Array of drop-down options.



Error Responses

Field Name

Sample Value

Required

Format

Description

error

Field value is empty.

Yes

String

This is a short form of the error.

message

Value of field [fieldname] must not be empty

Yes

String

This is a detailed message around the error specifying, as specifically as possible, what the fields are that are missing or where exactly the error is.



Error Response Codes

Error Error Code Description Reason
Input Error 4xx Returned whenever the request is missing required fields, including situations in which the body is malformed (e.g. HTTP method not supported, receipt not found, etc.). – missing_data

– not_unique

– receipt_not_found

– invalid_amount

– invalid_currency

– invalid_date

– invalid_custom_field

– invalid
Server Error 5xx HTTP error status code is returned due to an error that occurred in the backend. – internal_error: unexpected error occurred in the CrowdTwist backend

– missing_field

– invalid_data

– not_configured: error occurs when an configuration has not been configured yet



Example Response Codes

Response Code Error Message
400 param_error Requested campaign does not exist.
403 invalid_auth Invalid access credentials.

Samples

Sample Request

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

 

Sample Response Body

{ "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, "date_end": null, "enable_email": 1, "image": "http://www.imagestorage.com/image", "is_enabled": 1, "enable_tos": 0, "tos_text": null, "tos_link_url": null, "questions": [ { "id": "18", "is_required": 1, "title": "What is your favorite color?", "type": 2, "options": [ "blue", "red" ] } ] }

 

Sample Error Response

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