10-18-2023 04:20 AM
Hi community
I have been working on a solution that involves the following steps:
1. Create a Team in Webex (https://webexapis.com/v1/teams)
2. Add specific users to that team (https://webexapis.com/v1/team/memberships)
3. Create a room (https://webexapis.com/v1/rooms) and associate with the new team ("teamId": "$team")
4. Post a message to that room (https://webexapis.com/v1/messages) ("roomId":"$roomid")
5. Create a webhook to receive new notifications regarding replies to messages sent to the room (https://webexapis.com/v1/webhooks)
All works as expected except for one little element. In order for users to see the messages posted to that room then need to join the space. This is not achieved automatically despite utilising the memberships api. Is there a way of auto accepting participation for each of the users defined in step 2?
I have attached a couple of screenshots to show where this has to be achieved manually.
I cant see anywhere in API documentation where this can be auto accepted/forced.
Thanks in advance
Solved! Go to Solution.
10-18-2023 06:15 AM
Please note that /team/memberships API is different to /memberships API I shared previously. The former is used to add members to the team and the latter is used to add members to a space directly.
10-18-2023 05:13 AM
That message is specific to the Webex Native app. If you want to add members to team's subspaces (all spaces within a team are known as subspaces, unless it's the General space), then you need to use the /memberships with the roomId. You can automate this through code.
10-18-2023 05:26 AM
Hi Raffaele, thanks for the reply
I have already done this in step2 - I create the team first, associate the members to the team, then create a room and associate to that team:
https://webexapis.com/v1/teams
{
"name": "demo $var1",
"description": "demo"
}
https://webexapis.com/v1/team/memberships
for each {
"personEmail": "$user",
"teamId": "$newteamid'",
"isModerator": "true"
}
https://webexapis.com/v1/rooms
{
"title": "demo $var1"
"description": "demo",
"teamId": "$newteamid"
}
https://webexapis.com/v1/messages
{
"roomId": "$newroomid",
"text": "$body"
}
https://webexapis.com/v1/webhooks
{
"event": "created",
"name": "demo $var1",
"filter": "roomId=$newroomid",
"targetUrl": "$mytargeturl",
"resource": "messages"
}
But for each member of that team they need to join that space manually as seen in the screenshots..
Cheers
10-18-2023 06:15 AM
Please note that /team/memberships API is different to /memberships API I shared previously. The former is used to add members to the team and the latter is used to add members to a space directly.
10-18-2023 07:17 AM
Superb - exactly what I needed thanks for the help in pointing me in the right direction
best regards
Discover and save your favorite ideas. Come back to expert answers, step-by-step guides, recent topics, and more.
New here? Get started with these tips. How to use Community New member guide