Graph API GetPresence returns 403 Forbidden

Amir Sohail 411 Reputation points
2021-12-01T17:42:02.207+00:00

Hi, everyone
I hope you are all feeling well!
I am facing an issue when I call get presence graph API in post-man I have completed some prerequisite e.g
****1) I have registered an app in azure.****

154169-create-azure-app.jpg

****second image****

154119-create-app2jpg.jpg

****2) I have Granted required permissions in graph API like(Presence.Read, Presence.ReadAll).****

154177-permissions.jpg

****3) I have added a secret key to the app.****

154201-secretkey.jpg

****4) I make a call for getting the Bearer token and I got the token successfully.****

154184-barrer-token.jpg

****5) I make calls for getting all users and get all user's data.****

154211-all-users.jpg

****but when I try to call get presence graph API for user status then the response is****

154178-getpresence-response.jpg
{
"error": {
"code": "Forbidden",
"message": "",
"innerError": {
"request-id": "",
"date": "2021-12-01T16:04:25",
"client-request-id": ""
}
}
}

*****Please help me*****

Microsoft Graph
Microsoft Graph
A Microsoft programmability model that exposes REST APIs and client libraries to access data on Microsoft 365 services.
10,771 questions
Microsoft Teams Development
Microsoft Teams Development
Microsoft Teams: A Microsoft customizable chat-based workspace.Development: The process of researching, productizing, and refining new or existing technologies.
2,904 questions
{count} votes

Accepted answer
  1. Pierre Audonnet - MSFT 10,166 Reputation points Microsoft Employee
    2021-12-02T04:49:55.187+00:00

    Actually the documentation states that the Application API access aren't supported, it has to be a delegated access. Isn't it the issue? It seems you are making a call as an Application in Postman?

    I tried in Postman with a password grant type (just for the sake of using delegated access) and it does work for me.
    154372-image.png
    154371-image.png

    1 person found this answer helpful.
    0 comments No comments

8 additional answers

Sort by: Newest
  1. awijekoon 1,185 Reputation points Microsoft Vendor
    2023-12-25T00:39:00.16+00:00

    @Amir Sohail

    Just to update you. Get User Presence API with Application Permission now available in Graph v1.0. I verified it.

    See this comment too from December 21, 2023. The Graph API change log is not yet updated.

    therefore, following Api should work now with application permission.

    https://graph.microsoft.com/v1.0/users/6e7b768e-07e2-4810-8459-485f84f8f204/presence
    
    https://graph.microsoft.com/v1.0/communications/presences/6e7b768e-07e2-4810-8459-485f84f8f204
    

    If the answer is helpful, please click Accept Answer and kindly upvote. If you have any further questions about this answer, please click Comment.

    0 comments No comments

  2. Deleted

    This answer has been deleted due to a violation of our Code of Conduct. The answer was manually reported or identified through automated detection before action was taken. Please refer to our Code of Conduct for more information.


    Comments have been turned off. Learn more

  3. henry crist 0 Reputation points
    2022-05-18T04:14:55.967+00:00

    Any more updates regarding this? Thanks in advance.


  4. ksoyale 1 Reputation point
    2022-02-09T05:28:25.39+00:00

    Thanks buddy for updating and giving this complete information. Need this.

    0 comments No comments