Return JSON object that lists messages (chat, post, task) for the current user and specified space(s). New messages and updated messages are included by default, deleted messages can also be included with query string parameter. List is ordered by modified time. Note: Use nextPageUrl and prevPageUrl from the response data for query pagination.

URL Parameters

NameDescriptionLocationRequiredDefault Value
spacelistComma separated list of spaces for which to retrieve messages. Must contain at least 1 spaceID and a maximum of 15 spaceIDs.queryYes
sizeNumber of messages in the response data.queryNo10 (Max: 50)
includedeletedBoolean value to include deleted messages.queryNofalse
pagerefFor reference only. Server will increment this value in nextPageUrl and decrement in prevPageUrl.queryNo
afterOnly show messages modified/created after this reference point (number of milliseconds elapsed since 1 January 1970 00:00:00 UTC).queryNo
pageTokenReference for pagination. Server will populate this in prevPageUrl and/or nextPageUrl.queryNo

Body Parameters

None.

Authentication

JwtAuthenticator, Oauth2Authenticator, AnonymousAuthenticator

Authorization

OAuthAuthorizer

Example Request

URL

GET https://spaces.zang.io/api/users/me/messages?spacelist=58c97998d56ed915c3d28e32

Headers

Authorization: "jwt eyJhbGciOiJSUzI1NiIsIdfgdfgnR5cCI6IkpXVCJ9.eyJ1c2VyX2lkX3NpZyI6ImxPWHpxNzVzR3J3X0xwWEMyRGRMakhyYXJlWVhyTzFMdEZHZkhkOWNkTXciLCJwcm9kdWN0X3R5cGUiOiJhY2NvdW50cyIsImxhc3R1cGRhdGV0aW1lIjoiMjAxNy0wMS0zMFQxMzo1ODo0Ny4yMDYiLCJpc3MiOiJ6YW5nLmlvIiwicHVibGlja2V5aWQiOiJhZ3h6Zm05dVpYTnVZVEl3TVRSeUdnc1NEVWRLZDNSUWRXSnNhV05MWlhrdfgdWdJQ2dsUEtFakFvTSIsImV4cCI6MTQ5NTM5MTIwMywidXNlcl9pZCI6ImFneHpmbTl1WlhOdVlUSXdNVFJ5RVFzU0JGVnpaWElZZ0lEQXMtX25fUW9NIiwidmVyIjoiMi4wIn0.SqZpw1uPIebqW3qlDsm0-DWYFKEH0SgPwtD-tSESWOF-5hLkZMqJH28ooWux2S7s9riIew7pTVPnZpTgJa5zHcEAG0gXSEJVOqmpGp_4ufM8YtZoZMpBFjyAkwyAt-ILkGUYIo0GU5WyzMPLV8YLXfgdfgOgkE2MGGOajBkjPmC2Db3pA0D0M9k-21EL1gwWBC5YIq0PDAkgulegwl6khRmB8irJQ-dfg-d-KV9eYfFpsCdJKRGzSfqg"

Or

Authorization: "bearer f746696f5de4528u128ae2f274eea253e8a7943a"

Example Response

{
  "data": [
      { //New Message
        "_id": "58ed325779bf9c47479faf9b",
        "category": "chat",
        "topicId": "58c97998d56ed915c3d28e32",     
        "status": 0, //It is normal message
        "content": {
            "bodyText": "",
            "description": "",
            "data": [
              {
                "provider": "native",
                "providerFileType": "",
                "fileType": "document",
                "name": "Angularjs.docx",
                "fileId": "7de9fe09-2b4e-4a6d-9bfd-a3c8e78a7d59",
                "icon": "",
                "thumbnail": "",
                "keywords": "",
                "description": "",
                "previewFile": "",
                "fileSize": 238051,
                "thumbnailFile": "7de9fe09-2b4e-4a6d-9bfd-a3c8e78a7d59_convert/thumbnail.jpg",
                "metaData": {
                  "stgeProvd": "gcs",
                  "prvwProvd": "gcs",
                  "paging": 0
                },
                "pages": 17,
                "nextSchedule": null,
                "convertStart": null,
                "convertStatus": 2,
                "convertError": "",
                "path": "xxxxxx",
                "previewUrl": "xxxxxx",
                "thumbnailUrl": "xxxxxx"
              }
            ],
            "assignees": []
        },
        "created": "2017-04-11T19:45:27.163Z",
        "modified": "2017-04-11T19:46:40.867Z",
        "sender": {
            "_id": "5846cc603bab0e18ff03cca0",
            "type": "user",
            "username": "ericd@esna.com",
            "displayname": "ericd ding",
            "picture_url": "xxxxx"
        },
        "likeCount": 0,
        "chatCount": 0,
        "__v": 0
    },
    {   //Deleted Message
        "_id": "58ed325779bf9c47479faf9b",
        "status": 1, 
        "modified": "2017-04-11T19:46:40.867Z"
    }
  ],
  "nextPageUrl": "/api/users/me/messages?spacelist=58c97998d56ed915c3d28e32&pageref=1&pageToken=eyJxdWVyeSI6eyIkb3IiOlt7Im1vZGlmaWVkIjp7IiRsdCI6IjIwMTctMTItMjdUMTY6MzE6NDUuNDE0WiJ9fSx7Im1vZGlmaWVkIjoiMjAxNy0xMi0yN1QxNjozMTo0NS40MTRaIiwiX2lkIjp7IiRsdCI6IjVhNDNjYWYxOGE3YWMxMDc5NDJlNzI1ZCJ9fV19LCJkaXJlY3Rpb24iOiJuZXh0In0%3D",
  "previousPageUrl": ""
}