question

andy-haas avatar image
andy-haas asked ·

Subscription for entire company presence data

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...
topic-default
1 |1000 characters needed characters left characters exceeded

Up to 8 attachments (including images) can be used with a maximum of 1.0 MiB each and 10.0 MiB total.

igor-bebin avatar image
igor-bebin answered ·
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,
Share
1 |1000 characters needed characters left characters exceeded

Up to 8 attachments (including images) can be used with a maximum of 1.0 MiB each and 10.0 MiB total.

andy-haas avatar image
andy-haas answered ·
@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
Share
1 |1000 characters needed characters left characters exceeded

Up to 8 attachments (including images) can be used with a maximum of 1.0 MiB each and 10.0 MiB total.

paco-vu avatar image
paco-vu answered ·
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
Share
1 |1000 characters needed characters left characters exceeded

Up to 8 attachments (including images) can be used with a maximum of 1.0 MiB each and 10.0 MiB total.

andy-haas avatar image
andy-haas answered ·
@Paco,
I only see 2 a get and a put



Thank You
Andy
9 comments Share
1 |1000 characters needed characters left characters exceeded

Up to 8 attachments (including images) can be used with a maximum of 1.0 MiB each and 10.0 MiB total.

Look like your account level is not supporting company presence. Can you share the account email address or number so I can check and make change if possible.
0 Likes 0 · ·
BTW, you have logged in before taking that screenshot right?
0 Likes 0 · ·
Yes I logged in before. The emails I tried with was andyhaas@point-of-rental.com or  rc-admin@point-of-rental.com both are super admins

Thank You
Andy
0 Likes 0 · ·
Just to mention also I am on a sandbox account for this application. This shouldn't matter but just to point out
0 Likes 0 · ·
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
1 Like 1 · ·
Show more comments

Write an Answer

Hint: Notify or tag a user in this post by typing @username.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MiB each and 10.0 MiB total.