Get Quiz Details


Request Details

Item Value
Description This endpoint returns details of a quiz created via Control Center.
Method GET
Endpoint https://[environment]api[client_id].crowdtwist.com/v2/quiz/[activity_id]?api_key=[api_key]&__locale__=[lang_id]
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
activity_id 1234 Yes String CrowdTwist generated activity ID.
QUERY PARAMETERS
api_key QWERTYP Yes String  
__locale__   No String Allows you to request the results in alternative configured languages enabled for your program.

Response

Response Body

Field Name

Sample Value

Required

Format

Description

activity_id 1234 Yes Integer Internal CrowdTwist Activity ID.
title "Poll Title" Yes String Title of the quiz.
description "Description of this poll" Yes String Description of the quiz.
image_url "https://image-url.jpg" Yes String URL for the image uploaded for the quiz.
num_points 100 Yes Integer Points awarded for answering the quiz.
date_start "2016-09-20T10:15:14.511+00:00" Yes String Date and time when the quiz starts.
date_end "2016-09-20T10:15:14.511+00:00" No String Date and time when the quiz ends.
is_enabled true Yes Boolean Indicates if the quiz is active or not.
minimum_score 3 Yes Integer The minimum number of correct answers required for a member to receive points.
completed_message "You've finished the quiz!" Yes String A message displayed to the member after they've completed the quiz.
display_summary true Yes Boolean Indicates if a question summary should be displayed after the quiz has been submitted.
paginated true Yes Boolean Indicates if questions should be paginated or displayed all at once.
extra_data See the EXTRA DATA OBJECT section. No Object This is client defined additional data.
activity_tags See the ACTIVITY TAGS ARRAY section. No Array Tags associated with activities.
questions See the QUESTIONS OBJECT section. Yes Object Array of questions to be asked during quiz.
ACTIVITY TAGS ARRAY
id 1 Yes Number Internal CrowdTwist Activity Tag ID.
name "Digital" Yes String Activity tag description.
EXTRA DATA OBJECT
Test Test No String Additional data as added.
QUESTIONS OBJECT
id 1 Yes Integer ID of the question.
value "What year did the Titanic sink?" Yes String The question text.
question_type

"select_one"

"select_multiple"

Yes String Type of question.
correct_answer

1

[1,2,3]

Yes Integer or Array  The correct answer for this question. The type returned for this key is dependent on the question_type.
display_order 1 Yes Integer The order in which this question should be displayed.
answer_options See the ANSWER OPTIONS ARRAY section. Yes Array Answer options associated with the question.
ANSWER OPTIONS ARRAY
id 1 Yes Integer ID of the answer.
value "Red" Yes String The answer text.
image_url "https://image-url.jpg" No String The URL of the image associated with this answer.
display_order 1 Yes Integer The order in which this answer should be displayed.




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
404 page_not_found activity id 9292 does not exist.
403 invalid_auth Invalid access credentials.

Samples

Sample Request

curl -X GET https://[environment]api[client_id].crowdtwist.com/v2/quiz/1234?api_key=[api_key]

 

Sample Response Body

{ "activity_id": 1234, "title": "Quiz title", "description": "Quiz description", "image_url": "https://image-url.jpg", "num_points": 100, "date_start": "2016-09-20T10:15:14.511+00:00", "date_end": "2018-09-20T10:15:14.511+00:00", "is_enabled": true, "minimum_score": 2, "completed_message": "You finished the quiz!", "display_summary": true, "paginated": true, "extra_data": null, "activity_tags": [ { "id": 1, "name": "Digital" }, { "id": 2, "name": "Mobile" } ], "questions": [ { "id": 1, "value": "What year did the Titanic sink?", "question_type": "select_one", "correct_answer": 1, "answer_options": [ { "id": 1, "display_order": 1, "value": "1912", "image_url": "https://image-url.jpg" }, { "id": 2, "display_order": 2, "value": "1936", "image_url": "https://image-url.jpeg" } ], "display_order": 1 } ] }

 

Sample Error Response

{ "error": "page_not_found", "message": "activity 1322 does not exist." }