Subscription for entire company presence data

  • 1
  • Question
  • Updated 3 months ago
I currently have set up a poll from RC to get the presence data every 20 seconds. Currently we are running into issues. I am moving over to polling RC once a day to get the initial data and then using subscription to get the rest of the data. I have read some blogs on here linked below. But I can't seem to find a way to subscribe to the entire companies presence data. 

The reason for this is we have a KPI board that shows whos in the queue and whos not. 

Currently in my program. I have the subscription set up like so:

`subscription.EventFilters.Add("/restapi/v1.0/account/~/extension/~/presence?detailedTelephonyState=true");`

I am logging in with a super admin username and password,

`login = await ringCentral.Authorize("16503514555", "", "xxxxxxx");`

 but the subscription that it looks like it is creating is 

`/restapi/v1.0/account/134091004/extension/134091004/presence?detailedTelephonyState=true`


Any help would be much appreciated.

Thank You
Andy


Blogs that relate:
https://devcommunity.ringcentral.com/ringcentraldev/topics/explain-subscription-api-presence-api?top...
https://devcommunity.ringcentral.com/ringcentraldev/topics/requesting-presence-for-all-extensions-al...
Photo of Andy Haas

Andy Haas

  • 322 Points 250 badge 2x thumb

Posted 3 months ago

  • 1
Photo of Igor Bebin

Igor Bebin, Official Rep

  • 540 Points 500 badge 2x thumb
Hi Andy,

Try to subscribe on Account Presence changes, i.e.
"/restapi/v1.0/account/~/presence?detailedTelephonyState=true"

In this case subscriober will receive notifications regarding presence changes for all User extensions on Account, if it has all required permissions. 

Thanks,
Photo of Andy Haas

Andy Haas

  • 322 Points 250 badge 2x thumb
@Igor,
I have tried that and now in my subscribor isn't getting any notification events. 

The subscription did get created
"id": "1cb52a4e-0a2e-48ff-99ca-c611be377ee4", "creationTime": "2018-03-01T17:01:52.412Z", "status": "Active", "eventFilters": [ "/restapi/v1.0/account/134091004/presence?detailedTelephonyState=true" ],

But in my logs I am not getting any notes that there was a message notification.

I am using the latest C# SDK for this application also.

For permissions this application has 
- Edit Presence
- Read Accounts
- Read Call Log
- Read Messages
- Read Presence
- SMS
- Webhook Subscriptions

Thank You
Andy
(Edited)
Photo of Paco Vu

Paco Vu

  • 416 Points 250 badge 2x thumb
Hi Andy,

I would like to see what is your account level. Can you login to your developer account at developer.ringcentral.com portal. Open the APU Reference page and search for Presence. Let me know what APIs do you see under the Presence group. 

+ Phong
Photo of Andy Haas

Andy Haas

  • 322 Points 250 badge 2x thumb
@Paco,
I only see 2 a get and a put



Thank You
Andy
Photo of Phong Vu

Phong Vu, Devangelist

  • 1,936 Points 1k badge 2x thumb
I can find it. Can you share the sandbox company number?

Thanks
Photo of Andy Haas

Andy Haas

  • 322 Points 250 badge 2x thumb
+16503514555
Photo of Phong Vu

Phong Vu, Devangelist

  • 1,936 Points 1k badge 2x thumb
Access level changed to Advanced. Can you logout then login again to see if you can see more APIs under Presence section. If you can see, try again your subscription at the account level as instructed above.
Photo of Andy Haas

Andy Haas

  • 322 Points 250 badge 2x thumb
I have access to that end point and it does get the call details. The main problem that I had and I guess I didn't see it right away was I was playing with edit presence and I turned off allowSeeMyPresence. Oops. 

But this is now up and working 

Thank you all for your help
Andy
Photo of Igor Bebin

Igor Bebin, Official Rep

  • 440 Points 250 badge 2x thumb
Good to know it works for you now.