cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
813
Views
0
Helpful
4
Replies

Users auto join a space

david.mccann1
Level 1
Level 1

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.

Screenshot_20231016-164743_Webex.jpg

Screenshot_20231016-164736_Webex.jpg

I cant see anywhere in API documentation where this can be auto accepted/forced.

Thanks in advance

1 Accepted Solution

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. 

View solution in original post

4 Replies 4

Raffaele Lagana
Cisco Employee
Cisco Employee

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.

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

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. 

Superb - exactly what I needed thanks for the help in pointing me in the right direction

best regards