Skip to content
Timothy Duffy edited this page Apr 5, 2015 · 3 revisions

###publish_post.json###

The publish_post.json end point allows the client to publish a post to the server with any number of media objects associated with it. This is an HTTP POST end point.

publish_post.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.

[POST]
assignment_id:

    This is of type text, and holds the assignment id the post is responding to.  This field will hold
    the assignment id that the post is responding to.  If this is a free-post (not associated with an
    assignment) then set this to "0".

[POST]
media_objects:

    This is of type text, and is a json object that holds an array of media_id's.  The json array
    looks like this:

        [
            "4ebbb6c0-bd4c-43fc-8242-5aec49989f61",
            "b71d403b-caf1-470c-ad29-51229526fe1e"
        ]

    The supplied id's must be associated with valid mediaobject uploads, and should only come from the
    upload_media.json response json dictionary.

A valid response looks like:

{
    "new_user": false,
    "post_id": 1,
    "success": true
}
Clone this wiki locally