Skip to content

admin publish_assignment.json

Timothy Duffy edited this page Mar 8, 2015 · 1 revision

###admin/publish_assignment.json###

All admin api's require a token to be passed in. See get_access_token.json for more information.

admin/publish_assignment.json?token=238236fa-0e1a-499c-8051-c46e2f416387

This call is an HTTP POST API. The command takes six fields:

name
    This is a short name for the assignment so it is easily picked out when several are displayed.
    This is only used on the moderator side, and will not be displayed to users.

life_time
    This is a non-zero integer that represents the number of hours the assignment should live for.

questions
    This is a JSON array of question ids that are associated with the assignment.
    note: see admin/create_question.json for more information on question ids.

top_left_lat
     The top left latitude of the geo fence bounding box for the assignment in degrees.

top_left_lng
     The top left longitude of the geo fence bounding box for the assignment in degrees.

bottom_right_lat
    The bottom right latitude of the geo fence bounding box for the assignment in degrees.

bottom_right_lng
    The bottom right longitude of the geo fence bounding box for the assignment in degrees.

Note: set the bounding box to these values for 'the whole earth':

top_left_lat: 90
top_left_lng: -180
bottom_right_lat: -90
bottom_right_lng: 180

Note: set the bounding box to these values for 'Monroe County, NY':

top_left_lat: 43.4
top_left_lng: -77.9
bottom_right_lat: 43.0
bottom_right_lng: -77.3

A successful response looks like this:

{
    "assignment_id": 4,
    "success": true
}

Possible errors include:

{
    "error_text": "One or more of the following fields is missing or invalid: life_time,questions (JSON list of question id's). ",
    "success": false
}
Clone this wiki locally