Previously POST /users/me/topics/{topicId}/preference

Change the preference setting for a space (topic) that the current user is a member of. The available settings are: toggle favorite and toggle notifications.

URL Parameters

NameDescriptionLocationRequiredDefault Value
spaceIdUnique identifier of the space (topic) to modify.pathYes

Body Parameters

NameDescriptionJSON typeRequiredDefault Value
isPinnedIs the space a favorite.booleanNo
notificationWill the user receive notifications for this space.booleanNo
restrictManage permissions for different user groups in topic. i.e. By default restricts guest users from accessing historic messagesarrayNo["deny_guest_access_history_msg"]

Authentication

JwtAuthenticator, Oauth2Authenticator, AnonymousAuthenticator

Authorization

PERM_TOPIC_UPDATE

Example Request

URL

For Production: POST https://spacesapis.avayacloud.com/api/users/me/spaces/{spaceId}/preference
For Staging: POST https://loganstagingapis.esna.com/api/users/me/spaces/{spaceId}/preference

Headers

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

Or

Authorization: "bearer f746696f5de4528u128ae2f274eea253e8a7943a"

Example Request Body

{
          "isPinned": false, "notification": false
}

Example Response


  {
    "status": 0,
    "unread": false,
    "_id": "5f0577d29e96f98705577e1d",
    "targetId": "5f0577d29e96f9d1a4577e1c",
    "userId": "5ef9b678aa4a347af983c74c",
    "userType": "user",
    "lastAccess": "2020-07-24T09:00:55.936Z",
    "role": "admin",
    "targetType": "topic",
    "title": "test space",
    "type": "group",
    "isPinned": false,
    "notification": false
  }
      

Creating a Public Space

Guest users are able to access historic message in a public space. By default a created space is a private space and only admin and members are able to view historic messages in a private space. To make a space public change the `restrict` parameter. Removing the "deny_guest_access_history_msg" string from `restrict` Array will allow guest users to access historic messages

Example Request

URL

POST https://spacesapis.avayacloud.com/api/users/me/spaces/{spaceId}/preference

Headers

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

Or

Authorization: "bearer f746696f5de4528u128ae2f274eea253e8a7943a"

Example Request Body


  {
    "_id": "5af9ee07fc1d67d251bb05e1",
    "title":"publicB",
    "restrict":[]
  }

Example Response


{
  "_id": "5af9ee07fc1d67d251bb05e2",
  "targetId": "5af9ee07fc1d67d251bb05e1",
  "userId": "5890b1243bab0e18ff044943",
  "userType": "user",
  "role": "admin",
  "targetType": "topic",
  "title": "t1",
  "lastAccess": "2017-04-26T17:15:42.977Z",
  "type": "group",
  "isPinned": false,
  "notification": false
}