cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
1048
Views
10
Helpful
4
Replies

Webex spaces - webhook to notify on room/space creation

DammitSteve
Level 1
Level 1

Hey guys,

I'm looking to write an integration using webex, however one of the requirements would be to keep track of when rooms/spaces are created. I'd ideally want to do this without having to invite a user/bot into a room, so that there's no user interaction required.

Am I reading the documentation correctly that if I request the spark-compliance:rooms_read permission, that I should get room notifications for the entire org through the rooms:created webhook?

Worst case, could I use polling to query GET https://webexapis.com/v1/rooms with spark-compliance:rooms_read to see a list of all rooms/spaces? Is there another approach that'd make more sense? 

Cheers in advanced.

1 Accepted Solution

Raffaele Lagana
Cisco Employee
Cisco Employee

Hello,

Creating a rooms:created webhook with a token that has the compliance scopes will not automatically trigger that webhook every time a room is created within the org that the token's owner resides in. It will still only get triggered when the user who created the webhook creates a room/space. Not sure where you read that this would be possible, please share the doc if possible.

There is a roundabout way to get all rooms created within an org, with a token that has the compliance scopes. But it will probably require some code logic. We have a /list-events API that allows compliance officers (the users who need to authorize an integration to get the required compliance scopes assigned to a token) to fetch all memberships created within an org. This API does not provide the rooms:created event but the fact it gets all memberships created, means that the response body of this event will contain the roomId where the membership was created. So, you could have code logic that checks for each membership:created event, takes in the roomId and checks it against all roomIds (you would probably need to store the roomIDs somehow, to then iterate through them in the code) and if it doesn't exist then this would mean that you have a new room that's been created.

Not sure if this is helpful, but it's the only way as far as I'm aware. The only other option is to add a user to every room that's created and then go from there but I understand that you'd like to avoid this. CO users can add themselves to rooms/spaces even if they are not part of them or not the moderator, in case this helps.

View solution in original post

4 Replies 4

Raffaele Lagana
Cisco Employee
Cisco Employee

Hello,

Creating a rooms:created webhook with a token that has the compliance scopes will not automatically trigger that webhook every time a room is created within the org that the token's owner resides in. It will still only get triggered when the user who created the webhook creates a room/space. Not sure where you read that this would be possible, please share the doc if possible.

There is a roundabout way to get all rooms created within an org, with a token that has the compliance scopes. But it will probably require some code logic. We have a /list-events API that allows compliance officers (the users who need to authorize an integration to get the required compliance scopes assigned to a token) to fetch all memberships created within an org. This API does not provide the rooms:created event but the fact it gets all memberships created, means that the response body of this event will contain the roomId where the membership was created. So, you could have code logic that checks for each membership:created event, takes in the roomId and checks it against all roomIds (you would probably need to store the roomIDs somehow, to then iterate through them in the code) and if it doesn't exist then this would mean that you have a new room that's been created.

Not sure if this is helpful, but it's the only way as far as I'm aware. The only other option is to add a user to every room that's created and then go from there but I understand that you'd like to avoid this. CO users can add themselves to rooms/spaces even if they are not part of them or not the moderator, in case this helps.

Cheers Raffaele, I'll move forward in that direction.

DammitSteve
Level 1
Level 1

Thanks Hazeena for the feedback.

Would there be a better way to do this without this level of permissions?

hazeena farook
Cisco Employee
Cisco Employee

Hi, This will work, but please note spark-compliance scopes can only be used by an organization's compliance officers. See the Compliance Guide for more information.

spark-compliance:rooms_read