How do I mention all room members with the Rest API (@all)


#1

I have built a custom integration from Salesforce to Hip Chat. In preparation to the move to Stride I am building an app in salesforce to do the same thing that I was doing in Hip chat but in Stride. One thing I was able to do is mention all member in a room when I sent a message to that room. I cannot seem to figure out how to do that with the Stride API.


#2

@cody ,

I think these sample ADF messages are what you’re looking for. They will make @all and @here work when posting a message to Stride.

@all ADF Example

{
 "version":1,
 "type":"doc",
 "content":[{
   "type":"paragraph",
   "content":[{
       "type":"mention",
       "attrs":{
           "id":"all",
           "text":"@all",
           "accessLevel":"CONTAINER",
           "userType":"SPECIAL"
       }
    }]
  }]
}

@here ADF example

{
 "version":1,
 "type":"doc",
 "content":[{
   "type":"paragraph",
   "content":[{
       "type":"mention",
       "attrs":{
           "id":"here",
           "text":"@here",
           "accessLevel":"CONTAINER",
           "userType":"SPECIAL"
       }
    }]
  }]
}

I hope this helps you move forward with your project!
Regards,
Jon Ross


#3

Thank you,

So, I am testing in Postman and generating a 401 Unauthorized

curl -X POST
https://api.atlassian.com/site/-------/conversation/------/message
-H ‘Authorization: Bearer *********’
-H ‘Cache-Control: no-cache’
-H ‘Content-Type: application/json’
-H ‘Postman-Token: *****’
-d ‘{
“version”:1,
“type”:“doc”,
“content”:[{
“type”:“paragraph”,
“content”:[{
“type”:“mention”,
“attrs”:{
“id”:“all”,
“text”:"@all",
“accessLevel”:“CONTAINER”,
“userType”:“SPECIAL”
}
“type”: “text”,
“text”: “Hello world”
}]
}]
}’


#4

Hi @cody,

The oAuth token’s expire after an hour. You will probably need to regenerate it.
I have an guide I published about using postman with our REST API - “How To Get Started Using the Stride REST API With Postman Using OAuth2 2LO Tokens”
Regards,
Jon Ross