Tag Archives: 403

while try to Create new contact using microsoft graph explorer throws http 403


Ok, recently i got a chance to create a new contact in Office 365 using Microsoft Graph API. I used Microsoft Graph Explorer for it.

I got the error HTTP 403 Forbidden at Graph Explorer and in the response we see that “ErrorAccessDenied”. It’s telling that you need permissions to make the above API call successful.

Note:  Also you may want to validate your token in https://jwt.ms as well to make sure that you have necessary permissions/scopes or not.

Le Cafe de Deva - Deva Blogs © 2021

In order to proceed further, you need to provide consent to the necessary permissions required at “Modify Permissions” in Graph Explorer.

Le Cafe de Deva - Deva Blogs © 2021

Select the consent button in you will see the permissions requested popup, provide your consent as well.

Le Cafe de Deva - Deva Blogs © 2021

Right after the above successful step, i went back to Microsoft Graph Explorer, tested the API – it worked like a charm. Hope this comes handy to you.

Happy Graph coding!!

Investigate Microsoft Graph API call getOffice365ActiveUserDetail(period=’D7′) error HTTP 403 with Microsoft Graph explorer


One of my developer customer updated me that he tried calling reports from his custom application, using the Microsoft Graph API call “getOffice365ActiveUserDetail(period=’D7′)”, but receive HTTP 403. In order to isolate the issue, i tried repro the issue using Microsoft Graph Explorer and i can repro so. HTTP 403 – Forbidden!!
image

Being said that, Graph explorer updated me that i need to consent to the permissions on the “Modify Permissions” tab; in another words in order to run the reports i need the permissions. 
How cool is this new feature introduced in new MS Graph explorer?

Ok, I followed the steps in Graph explorer:

image

Just hover over the description. It provides a info clearly (see the below snapshot):

image

In order to make the permissions (admin consent required) to effect with my app (in this scenario, it will be MS Graph explorer), it thrown the dialog box to confirm:

image

On successful of the above, i made the same API call with Microsoft Graph explorer and it worked as i expected…!!

Happy Microsoft Graphing Winking smile

Debug: Graph API throws HTTP 403 with $filter for some users


In recent times, i worked with one of the ISV developer who reported that for some users when they use $filter with Graph API calls throws HTTP 403 – Forbidden. The same call works fine with $filter for most of the users. We chased and found it happens for some users (and not for all the users, but for Guest users). 

We noticed that their application only had delegated permissions for https://graph.microsoft.com/User.ReadBasic.All. So when you just use User.ReadBasic.All, then your app won’t have permission to read the userType property. It also means that it doesn’t have permission to filter on that property. So you’ll find any user in the tenant will have the same experience, including a member or a global administrator, not just your guest user. So we asked the user to try with User.Read.All in their app then we noticed the filter worked as expected for the user in the guest role – so it helped us to move forward.

Please note that if the above doesn’t help (as your scenario may vary) then I suggest you to have a look at the related Stackoverflow thread.

Hope this helps.