Hello Valentyn Derkach,
Thank you for contacting Microsoft Support!
The 402 Payment Required error you’re encountering with delegated permissions when calling the assignSensitivityLabel
endpoint indicates that the user token might not be properly licensed for the metered API. Here are a few steps you can take to resolve this issue:
- Verify Licensing: Ensure that the user account has the necessary licenses to access the metered API. The error message suggests checking the Graph metered API overview for details on required licenses.
- Check Permissions: Confirm that the delegated permissions granted to the user include the necessary scopes for the metered API. The user token should have the appropriate permissions to perform the action.
- Billing Setup: Make sure that your Azure billing subscription is correctly set up for the application. This includes setting up a payment model for each API request of a metered API.
- Consent: Ensure that the user has consented to the required permissions.
Hope this helps!
If the answer is helpful, please click Accept Answer and kindly upvote it. If you have any further questions about this answer, please click Comment.