Requesting presence for all extensions always returns "Offline"

  • 1
  • Question
  • Updated 3 months ago
  • Answered
  • (Edited)
I am needing to pull all presence details for all extensions, and according to the documentation, I should be able to do this without problem. According to the documentation
The presenceStatus is returned as Offline (the parameters telephonyStatusmessageuserStatus and dndStatus are not returned at all) for the following extension types: Department/Announcement Only/Take Messages Only (Voicemail)/Fax User/Paging Only Group/Shared Lines Group/IVR Menu/Application Extension/Park Location.
The extensions that I am working with are not any of any of these types (mainly "DigitalUser"). Also, I have checked that my admin extension has the feature name "Presence" set to true, which seems to mean that it should be able to pull other extension's presence. 
Enables user extension to monitor other extensions' presence
Please help me identify what I am doing wrong. Reading through the documentation, everything should be setup, and I cannot see anything that I am doing wrong.

Thanks!

Update:

I should also mention that when requesting an individual extension's presence, I get what I am expecting. The presence is not "Offline", and I am getting the TelephonyStatus, UserStatus, DndStatus, and Message, where it exists. I am not getting any of these other statuses when using the bulk request described above.

Thanks again!
Photo of Spring IT

Spring IT

  • 310 Points 250 badge 2x thumb

Posted 2 years ago

  • 1
Photo of Benjamin Dean

Benjamin Dean

  • 8,602 Points 5k badge 2x thumb
I do not see the "bulk request" you mentioned, could you please provide the full API request/response with headers which you are using?
Photo of Spring IT

Spring IT

  • 310 Points 250 badge 2x thumb
Thanks Ben. I have verified the credentials that I am using are for an AccountAdministration user. Which means that I would have to get the Super Admin credentials to accomplish item 2 on your list. I could do some testing in sandbox as you suggest in step 3, however, I have already verified that the result I am getting back from the https://platform.ringcentral.com/restapi/v1.0/account/~/presence URI is not correct. This was done by requesting the presence for a single extension which had a presenceStatus of "Offline" from the above request using the https://platform.ringcentral.com/restapi/v1.0/account/~/extension/{ids}/presence URI, and received a presenceStatus of "Available" as mentioned above. I do not see the benefit of trying to do some additional validation when I have already proved that the results are incorrect from the request returned from the first URI.
Photo of Spring IT

Spring IT

  • 310 Points 250 badge 2x thumb
It looks like I do have the "Super Admin" credentials. How would I go about seeing the extension information in the online portal?
Photo of Benjamin Dean

Benjamin Dean

  • 8,602 Points 5k badge 2x thumb
As I stated before, you will see "Offline" ONLY if an extension has TURNED OFF presence visibility permission (see this screenshot) from within the Online Account Portal (https://service[.devtest].ringcentral.com). This must be turned on from within the Online Account Portal.





You can see this response I executed after turning off this extension's presence permission (extension 103) is identical to yours "OFFLINE" only.

However all of the other extensions which have this feature turned on respond with the data you are expecting (for instance the 101 extension which shows all the data in both the presenceList and the presenceByExtensionId).

presenceByExtensionId Response ({{rcApiBaseUri}}/v1.0/account/~/extension/133128004/presence):

{  "uri": "https://platform.devtest.ringcentral.com/restapi/v1.0/account/133128004/extension/133128004/presence...;,
  "extension": {
    "uri": "https://platform.devtest.ringcentral.com/restapi/v1.0/account/133128004/extension/133128004";,
    "id": 133128004,
    "extensionNumber": "101"
  },
  "presenceStatus": "Available",
  "telephonyStatus": "NoCall",
  "userStatus": "Available",
  "dndStatus": "DoNotAcceptDepartmentCalls"
}

presenceList Response ({{rcApiBaseUri}}/v1.0/account/~/presence):

{  "uri" : "https://platform.devtest.ringcentral.com/restapi/v1.0/account/133128004/presence?page=1&perPage=...;,
  "records" : [ {
    "uri" : "https://platform.devtest.ringcentral.com/restapi/v1.0/account/133128004/extension/135445004/presence...;,
    "extension" : {
      "uri" : "https://platform.devtest.ringcentral.com/restapi/v1.0/account/133128004/extension/135445004";,
      "id" : 135445004,
      "extensionNumber" : "1"
    },
    "presenceStatus" : "Offline"
  }, {
    "uri" : "https://platform.devtest.ringcentral.com/restapi/v1.0/account/133128004/extension/133128004/presence...;,
    "extension" : {
      "uri" : "https://platform.devtest.ringcentral.com/restapi/v1.0/account/133128004/extension/133128004";,
      "id" : 133128004,
      "extensionNumber" : "101"
    },
    "presenceStatus" : "Available",
    "telephonyStatus" : "NoCall",
    "userStatus" : "Available",
    "dndStatus" : "DoNotAcceptDepartmentCalls"
  }, {
    "uri" : "https://platform.devtest.ringcentral.com/restapi/v1.0/account/133128004/extension/133165004/presence...;,
    "extension" : {
      "uri" : "https://platform.devtest.ringcentral.com/restapi/v1.0/account/133128004/extension/133165004";,
      "id" : 133165004,
      "extensionNumber" : "102"
    },
    "presenceStatus" : "Available",
    "telephonyStatus" : "NoCall",
    "userStatus" : "Available",
    "dndStatus" : "DoNotAcceptDepartmentCalls"
  }, {
    "uri" : "https://platform.devtest.ringcentral.com/restapi/v1.0/account/133128004/extension/138323004/presence...;,
    "extension" : {
      "uri" : "https://platform.devtest.ringcentral.com/restapi/v1.0/account/133128004/extension/138323004";,
      "id" : 138323004,
      "extensionNumber" : "105"
    },
    "presenceStatus" : "Available",
    "telephonyStatus" : "NoCall",
    "userStatus" : "Available",
    "dndStatus" : "TakeAllCalls"
  }, {
    "uri" : "https://platform.devtest.ringcentral.com/restapi/v1.0/account/133128004/extension/664573005/presence...;,
    "extension" : {
      "uri" : "https://platform.devtest.ringcentral.com/restapi/v1.0/account/133128004/extension/664573005";,
      "id" : 664573005,
      "extensionNumber" : "103"
    },
    "presenceStatus" : "Offline"
  }, {
    "uri" : "https://platform.devtest.ringcentral.com/restapi/v1.0/account/133128004/extension/134694004/presence...;,
    "extension" : {
      "uri" : "https://platform.devtest.ringcentral.com/restapi/v1.0/account/133128004/extension/134694004";,
      "id" : 134694004,
      "extensionNumber" : "104"
    },
    "presenceStatus" : "Offline",
    "telephonyStatus" : "NoCall",
    "userStatus" : "Offline",
    "dndStatus" : "DoNotAcceptAnyCalls"
  } ],
  "paging" : {
    "page" : 1,
    "totalPages" : 1,
    "perPage" : 100,
    "totalElements" : 6,
    "pageStart" : 0,
    "pageEnd" : 5
  },
  "navigation" : {
    "firstPage" : {
      "uri" : "https://platform.devtest.ringcentral.com/restapi/v1.0/account/133128004/presence?page=1&perPage=...;
    },
    "lastPage" : {
      "uri" : "https://platform.devtest.ringcentral.com/restapi/v1.0/account/133128004/presence?page=1&perPage=...;
    }
  }
}

If you are not seeing the same thing, just communicate the differences with the team handling your support ticket just as you have with me sir. This could possibly be 
Photo of Benjamin Dean

Benjamin Dean

  • 8,602 Points 5k badge 2x thumb
LOL. We were posting at the same time.

Here is the KB Article for managing presence for extensions: https://success.ringcentral.com/articles/RC_Knowledge_Article/How-to-set-up-Presence-permissions-for...
Photo of Spring IT

Spring IT

  • 310 Points 250 badge 2x thumb
Thanks for the documentation. I was searching around the wrong area :)

So, my question is this - What does your presenceByExtensionId result look like for extension 103 (you showed 101) when the presence is set to non visible? I would expect it to also show as "Offline", not as "Available" as I am seeing. 

I have checked that my example extension from above (extensionNumber: 492) does indeed have its presence set to visible.



So, based on your test here, I should indeed be seeing a presenceStatus of "Available" as it is showing as available here in the portal

Photo of Igor Bebin

Igor Bebin, Official Rep

  • 540 Points 500 badge 2x thumb
I'm afraid green icon on below screenshot is not the same as what you're getting via API:


This icon shows device registartion state, but not "presence" status. 

Could you please confirm the following:
1. So you're getting "presenceStatus" : "Offline" without any other details for ext 492 when polling {{rcApiBaseUri}}/v1.0/account/~/presence, but getting expected response for ({{rcApiBaseUri}}/v1.0/account/~/extension/{ext 492}/presence)?
2. How many Users/extensions do you have on account? 
3. Could you please provide extensionId?

Just in case, there is another way to get bulk response, e.g. ({{rcApiBaseUri}}/v1.0/account/~/extension/{ext1,ext2,ext3...}/presence)
Photo of Spring IT

Spring IT

  • 310 Points 250 badge 2x thumb
Thanks, Igor, for your reply.

Here is the phone status from Phones & Numbers => Phone Details for extension 492:



Is there something else that I should be checking?

Here are the answers to your questions:

1. Yes, this is exactly correct.
2. We have 4394 extensions.
3. I did not provide the extension ID as I was not sure if was something that should be kept confidential. If there is no reason not to share it, I will be happy to provide it.

I do understand that I can use the ({{rcApiBaseUri}}/v1.0/account/~/extension/{ext1,ext2,ext3...}/presence) URI as you mention, however, this has a limit of 30 extensionID's per call. So, while this does seem to work, It will be much, much less efficient than using the {{rcApiBaseUri}}/v1.0/account/~/presence URI.

Thanks again.
Photo of Anton Nikitin

Anton Nikitin, Official Rep

  • 2,522 Points 2k badge 2x thumb
We have an issue with this API for large accounts (actually for ones which have more than 300 extensions) which causes such such effect.
We plan to fix it as soon as possible. Actually account presence API was not publicly announced because of a number of known issues.

How critical is this issue for you use case? The answer will let us to prioritize it properly. 
Photo of Spring IT

Spring IT

  • 310 Points 250 badge 2x thumb
This is great news! I will keep my eye out for the update in February.

My current plan was to poll it daily to get the current presence. However, it sounds like there may be a better way using notification subscriptions. I have not experimented with these yet and am not entirely sure how to use them, but I will search through the documentation to see what I can come up with.

Thanks!
Photo of Andy Haas

Andy Haas

  • 322 Points 250 badge 2x thumb
@Anton, How would I subscribe to the entire company to get presence update on those users?
Photo of Anton Nikitin

Anton Nikitin, Official Rep

  • 2,522 Points 2k badge 2x thumb
Andy, can you try subscribing with "/restapi/v1.0/account/~/presence" filter? Does it work for you?
Photo of Andy Haas

Andy Haas

  • 322 Points 250 badge 2x thumb
I have and I get no notification when I do that.
Photo of Andy Haas

Andy Haas

  • 322 Points 250 badge 2x thumb
This is working. allowSeeMyPresence was turned off for the user that I was using.