Skip to content

API_1_GET_MESSAGES

pvicente edited this page Jun 24, 2013 · 6 revisions

API ▸ Google API 1 Get Messages

###GET /1/google/messages/:appid Get pending messages of appid

###Resource URL https://katooserver.herokuapp.com/1/google/messages/:appid

Parameters  
appid required String: Application ID

State Machine

|appid|Actions| |:-------------|:--|:--|:--|:--|:--| | Found | T | OK Response. Get all pending messages from appid | | Not found | - | 404 Not Found |

###Return JSON:

{
"current_time": "2012-10-15T08:21:35.011605Z", 
"success": true,
"connected": true,
"messages": 
          [{
           "msgid": "0",
           "time": "2012-10-15T08:19:55.796145Z", 
           "fromid": "user@gmail.com", 
           "data": "Hi"
          }, 
          {
           "msgid": "1",
           "time": "2012-10-15T08:20:11.456034Z", 
           "fromid": "user@gmail.com", 
           "data": "How are you?"
          }, 
         {
          "msgid": "2",
          "time": "2012-10-15T08:20:38.975220Z", 
          "fromid": "user@gmail.com", 
          "data": "What are you doing here rightnow?"
         }], 
"len": 3,
"reason": "ok"
}

###current_time Server time in zulu format (UTC)

###success True or False

###connected True or False

###messages List of messages with the following record format:

msgid: Message id or empty if not setted
time: reception time in UTC
chat_id: jid of contact (at ownmessages jid of other side)
data: message

###len Len of message list

###reason ok when success == True or string message when success == False

Clone this wiki locally