Phone Presence unknow

Hi,

I am having a play with the presence API, but when I try and get the presence of a users (any) phone, I get

“presence”: {
“extended”: {},
“status”: “Unknown”
},

The phone (on prem) is online, is this an issue with the cloudlink gateway not seeing the status from the MiVB? when I do a “SIP LINK STATE ALL” on the MiVB I see that the cloudlink SIP trunk has a register failed, not sure if this is related?

Link Cloudlink state is IN SERVICE (link down count 0) - REGISTER Failed

Welcome to the forums, Paul! Is the ‘REGISTER FAILED’ message what you’re seeing in the CloudLink Account Console? If so, then yes you likely have a communication issue with the Gateway and you can raise a support request through Tech Central Tracker in MiAccess. I still want to do some due diligence here though…

When you’re using GET https://presence.dev.api.mitel.io/2017-09-01/presentities/{principalId}, are you using the endpointId (extension) or the userId as the principalId?

HI Budd,

Thanks for the quick response This is my process

I first get an auth token using my login, I then get the the uniqueUserId from

https://admin.api.mitel.io/2017-09-01/accounts/{account_id}/users

and I then hit

https://presence.ap.api.mitel.io/2017-09-01/presentities/{uniqueUserId }

I then take the principalId and hit

https://presence.ap.api.mitel.io/2017-09-01/presentities/{principalId }/categories/phones

and this the full output

{
“_embedded”: {
“items”: [
{
“_links”: {
“self”: “/2017-09-01/presentities/fcb34103-cca4-42fc-94be-db4930fabd44/categories/phones/sip:fcb34103-cca4-42fc-94be-db4930fabd44@1f73a07f-a85b-4fab-b2da-613bd7f2cd2c.ap.api.mitel.io”
},
“categoryId”: “phones”,
“createdBy”: “fcb34103-cca4-42fc-94be-db4930fabd44”,
“createdOn”: “2022-08-01T02:57:35.776Z”,
“modifiedBy”: “fcb34103-cca4-42fc-94be-db4930fabd44”,
“modifiedOn”: “2022-08-01T02:57:35.776Z”,
“presence”: {
“extended”: {},
“status”: “Unknown”
},
“principalId”: “fcb34103-cca4-42fc-94be-db4930fabd44”,
“sourceId”: “sip:fcb34103-cca4-42fc-94be-db4930fabd44@1f73a07f-a85b-4fab-b2da-613bd7f2cd2c.ap.api.mitel.io
}
]
},
“_links”: {
“self”: “/2017-09-01/presentities/fcb34103-cca4-42fc-94be-db4930fabd44/categories/phones”
},
“categoryId”: “phones”,
“count”: 1,
“principalId”: “fcb34103-cca4-42fc-94be-db4930fabd44”
}

I worked it out, we have two cloudline accounts, one is the partner and the other is the customer cloudlink, I was running the query on the partner account!, I am now seeing the presence

Glad you were able to figure it out!