-
Notifications
You must be signed in to change notification settings - Fork 5
create_response_message.json
Timothy Duffy edited this page Apr 5, 2015
·
2 revisions
###create_response_message.json###
This API is used to respond to a message sent by an admin/mod/sub.
create_response_message?cuid=<client_id>&language_code=<language_code>&lat=<lat>&lng=<lng>
This call is an HTTP POST API. The command takes the following 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.
[POST]
subject
The free-form text that is the subject of the message (can be unique from the parent message)
[POST]
text
The free-from text that is the body of the message.
[POST]
parent_message_id
This is the message if of the parent message. This is included in the response form
get_messages.json.
Valid responses:
{
"error_text": "One or more of the following fields is missing or invalid: client_id, parent_message_id, :subject, text.",
"success": false
}
{
"error_text": "Message already has posted response.",
"success": false
}
{
"message_id": 6,
"success": true
}