-
Notifications
You must be signed in to change notification settings - Fork 5
get_assignments.json
Timothy Duffy edited this page Apr 5, 2015
·
3 revisions
###get_assignments.json###
The get_assignments.json end point will return all assignments that have geo fences that include the current lat/lng of the user. This is a HTTP GET end point.
get_assignments.json?cuid=<client_id>&language_code=<language_code>&lat=<lat>&lng=<lng>
Field Descriptions:
[GET]
client_id:
This is of type text, and is the unique id of the client. This is a uuid that is generated by the
client and is associated with a user within the database. Event if a user is 'validated' their
unique client_id is still used to identify them.
[GET]
language_code:
This is of type text, and holds the two letter language code the post is in. Language codes must
match those codes that exist within the languages table within the database. Valid values currently
are:
en - English
es - Español
Note: If responding to an assignment, the response post should have the same language code as the
question being asked.
[GET]
lat:
This is the latitude of the user. 43.1656 is an example.
[GET]
lng
This is the longitude of the user. -77.6114 is an example.
A valid response looks like:
{
"assignments": [
{
"bottom_right_lat": -77.3,
"question_text": "How do you feel about broccoli?",
"answer9": "",
"answer8": "",
"assignment_id": 1,
"answer4": "",
"answer7": "",
"top_left_lng": -77.9,
"answer1": "",
"answer0": "",
"answer3": "",
"answer2": "",
"expire_datetime": "2014-09-21 16:03:11.435792",
"description": "Tell me how you really feel about broccoli. Be as detailed as you want!",
"answer6": "",
"top_left_lat": 43.4,
"question_type_id": 1,
"organization": "Yellr",
"answer5": "",
"publish_datetime": "2014-08-22 16:03:11.435785",
"bottom_right_lng": -77.3,
"post_count": 14
}
],
"success": true
}