-
Notifications
You must be signed in to change notification settings - Fork 5
get_local_posts.json
luis rosario edited this page Apr 5, 2015
·
2 revisions
###get_local_posts.json###
This end point allows users to get the posts local to them (~ 5 miles square).
get_local_posts.json?cuid=<client_id>&lat=<lat>&lng=<lng>&language_code=<language_code>
There are four required fields:
[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 this:
"posts": [
{
"last_name": null,
"language_code": "en",
"post_id": 5,
"verified_user": false,
"post_datetime": "2015-03-27 15:58:23.122724",
"media_objects": [
{
"media_id": "9b6b9682-1bad-479f-8d1c-440a8f2bb1d3",
"preview_file_name": "a81a24b7-9f3f-49af-8d50-da13f52ef112p.jpg",
"file_name": "a81a24b7-9f3f-49af-8d50-da13f52ef112.jpg",
"media_text": "",
"caption": "I like our little city :).",
"media_type_description": "An Image.",
"media_type_name": "image"
}
],
"first_name": null,
"question_text": "How will you be spending New Years Eve?",
"is_up_vote": 0,
"down_vote_count": 0,
"has_voted": 0,
"language_name": "English",
"up_vote_count": 1
}
]