Welcome to Microsoft Q&A platform and thanks for posting your query here.
It looks like the 403 Forbidden error you're encountering while testing the Microsoft Graph REST API for sensitivity labels in Postman is due to permission issues. Here are a few steps to help resolve this:
- Ensure that your Azure AD app has the appropriate Microsoft Graph API permissions assigned. In this case, you'll need:
-
SecurityActions.Read.All
-
InformationProtectionPolicy.Read
- Go to Azure Portal > Azure Active Directory > App Registrations > Your App > API Permissions to verify these.
-
- If these permissions require admin consent, ensure that the admin has granted it. This is necessary for certain security or information protection scopes.
- Make sure your token includes the right scopes for the API. You can check the token in Postman to ensure it contains scopes like
https://graph.microsoft.com/.default
orSecurityActions.Read.All
. - Verify that you are using the correct endpoint and API version. You are currently using the beta version (
/beta/security/informationProtection/sensitivityLabels
), which can sometimes have more restrictions. If possible, try using the v1.0 endpoint if it's available. - Ensure that the user or service principal making the API call has the necessary roles, such as Security Administrator or Global Administrator.
I hope these steps resolves the issue, try the request again. If you continue to face issues, please let us know if you have any questions.