Previously GET /users/me/topics

Return JSON object that lists spaces (topics) that the current user has joined. List is ordered by most recent activity. Direct space object includes the most recent chat message. Note: Use nextPageUrl and prevPageUrl from the response data for query pagination.

Recent activity includes:

  • Space title changed
  • New user joined space
  • User quit/kicked from space
  • Space member roster change: member or admin promotion and demotion, member property change (name, profile picture, etc.)
  • New message in direct space only
  • Deleted message in direct space only

URL Parameters

NameDescriptionLocationRequiredDefault Value
sizeNumber of topics in the response data.queryNo10 (Max: 50)
page(Deprecated) The page number of the response data, for pagination. This paramater cannot be used with the following parameters: after, pageref, and pageToken.queryNo0
searchString value. Regular expression to filter spaces (topics) returned. Uses "contain" string logic.
For "begin with" logic, use "^" sign, e.g.: ".../spaces?search=^{query}"
For "end with" logic, use "$" sign, e.g.: ".../spaces?search={query}$"
queryNo
topicstatusTopic status: "0" (normal), "1" (archived), or "all" ("all"="0"+"1"+"2").queryNo0
topictypeThe space type: "group", "direct", "personal" or "all" ("all" = "group"+"direct").

You can also pass multiple types separated by comma

queryNogroup
filtertype'pinned' (is the space a favorite)queryNo
includedeletedBoolean value to include deleted spaces (topic). A deleted space is:
  • User was kicked from space
  • Space was archived and user is not an admin of that space
queryNofalse
pagerefInteger value. For reference only. Server will increment this value in nextPageUrl and decrement in prevPageUrl.queryNo
afterOnly show spaces (topics) modified after this reference point (number of milliseconds elapsed since 1 January 1970 00:00:00 UTC).queryNo
pageTokenString value. Reference for pagination. Server will populate this in prevPageUrl and/or nextPageUrl.queryNo

Body Parameters

None.

Authentication

JwtAuthenticator, Oauth2Authenticator, AnonymousAuthenticator, ServiceAppAuthenticator

Authorization

OAuthAuthorizer

Example Request

URL

For Production: GET https://spacesapis.avayacloud.com/api/users/me/spaces
For Staging: GET https://loganstagingapis.esna.com/api/users/me/spaces

Headers

Authorization: "jwt eyJhbGciOiJSUzI1NiIsIdfgdfgnR5cCI6IkpXVCJ9.eyJ1c2VyX2lkX3NpZyI6ImxPWHpxNzVzR3J3X0xwWEMyRGRMakhyYXJlWVhyT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J5RVFzU0JGVnpaWElZZ0lEQXMtX25fUW9NIiwidmVyIjoiMi4wIn0.SqZpw1uPIebqW3qlDsm0-DWYFKEH0SgPwtD-tSESWOF-5hLkZMqJH28ooWux2S7s9riIew7pTVPnZpTgJa5zHcEAG0gXSEJVOqmpGp_4ufM8YtZoZMpBFjyAkwyAt-ILkGUYIo0GU5WyzMPLV8YLXfgdfgOgkE2MGGOajBkjPmC2Db3pA0D0M9k-21EL1gwWBC5YIq0PDAkgulegwl6khRmB8irJQ-dfg-d-KV9eYfFpsCdJKRGzSfqg"

Example Responses

GET https://spacesapis.avayacloud.com/api/users/me/spaces?page=2&size=1&topictype=all
{
  "data": [
    {
      "_id": "5890b188b1021d1d23a00815",
      "title": "patrickhan",
      "description": "",
      "status": 0,
      "unreadMessagesCount": 0,
      "messagesLastReadTime": "2017-09-05T20:42:41.043Z", 
      "members": [
        {
          "member": "5890b1243bab0e18ff044943",
          "memberType": "userId",
          "role": "admin",
          "joinTime": "2017-01-31T15:47:20.915Z",
          "username": "patrickhan@esna.com",
          "displayname": "Patrick-123 Han-han",
          "picture_url": "https://www.onesna.com/norevimages/noimage.jpg"
        }
      ],
      "settings": {
        "mdSrv": "ams",
        "confId": "234057438"
      },
      "created": "2017-01-31T15:47:20.915Z",
      "type": "group",
      "isPinned": null,
      "notification": null,
      "role": "admin",
      "lastAccess": "2017-04-26T13:29:50.079Z"
    }
  ],
  "from": 2,
  "to": 2,
  "nextPageUrl": "/api/users/me/spaces?page=3&size=1&topictype=all",
  "previousPageUrl": "/api/users/me/spaces?page=1&size=1&topictype=all"
}
GET https://spacesapis.avayacloud.com/api/users/me/spaces?pageref=1&topictype=direct
{
  "data": [
    {
      "_id": "59a9aec84d6a919bde4b48e9",
      "title": "new334333",
      "description": "",
      "status": 0,
      "unreadMessagesCount": 0,
      "messagesLastReadTime": "2017-09-05T20:42:41.043Z", 
      "members": [
        {
          "member": "588cc8827b40f9a576054c20",
          "memberType": "userId",
          "role": "admin",
          "joinTime": "2017-09-01T19:02:32.142Z",
          "username": "patrickhan@esna.com",
          "displayname": "Patrick-123 Han-han",
          "picture_url": "xxxxx"
        }
      ],
      "settings": {
        "confId": "221312218",
        "mdOpts": [],
          "mdSvr": "ams"
      },         
      "type": "group",
      "isPinned": null,
      "notification": null,
      "role": "admin",
      "created": "2017-09-01T19:02:32.149Z",       
      "modified": "2017-09-05T19:02:32.149Z", 
      "lastAccess": "2017-09-05T20:42:41.043Z", 
      "lastUpdateTime": "2017-09-05T20:42:41.043Z", 
      "lastMessage": {  //Only included for direct spaces
        "_id": "58ed325779bf9c47479faf9b",
        "category": "chat",                 
        "content": {
          "bodyText": "hello",
          "description": "",
          "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"
          }
        }
      }
    },
    { //Archived Space
      "_id": "59a9aec84d6a919bde4b48e9",
      "status": 1, 
      "lastAccess": "2017-09-05T20:42:41.043Z", 
      "lastUpdateTime": "2017-09-05T20:42:41.043Z",
      "modified": "2017-04-11T19:46:40.867Z",
    },
    { //Deleted Space
      "_id": "59a9aec84d6a919bde4b48e9",
      "status": 2, 
      "lastAccess": "2017-09-05T20:42:41.043Z", 
      "lastUpdateTime": "2017-09-05T20:42:41.043Z",
      "modified": "2017-04-11T19:46:40.867Z",
    }
  ],
  "nextPageUrl": "/api/users/me/spaces?pageref=1&size=1&topictype=direct&pageToken=eyJuZXh0UmVmVGltZSI6MTUxNDU3MjM4MTI0OCwibmV4dFJlZk9iaklkIjoiNWE0M2M4ZThjNzkxMTQwNzNhMWE4MjQ0In0=",
  "previousPageUrl": ""
}