Getting 403 error in https://graph.microsoft.com/v1.0/subscriptions

Nandini Bandyopadhyay 0 Reputation points
2025-04-15T12:16:18.68+00:00

We are calling microsoft graph APIs on users behalf , and getting the following error :

{"code"=>"ExtensionError", "message"=>"Operation: Create; Exception: [Status Code: Forbidden; Reason: Access to OData is disabled: [ESAPRC_3]: Request was blocked due to a Tenant-Configured UserAgent AllowList being set for this Organization. The UserAgent in the request is Ruby.]"

the error is in https://graph.microsoft.com/v1.0/subscriptions call , with status code 403 . Kindly help us understand and resolve the issue.

Microsoft Security Microsoft Graph
0 comments No comments
{count} votes

1 answer

Sort by: Most helpful
  1. Saranya Madhu-MSFT 2,375 Reputation points Microsoft External Staff
    2025-04-16T05:41:05.4833333+00:00

    Hi Nandini Bandyopadhyay,

    Thanks for reaching out to Microsoft!

    The "Access to OData is disabled." message indicates that an application access policy is configured, restricting API access to the mailbox. To resolve this issue, you should check the EWS (Exchange Web Services) setting.

    Firstly, run the below PowerShell code to connect to the office 365 tenant.

    $Pwd = ConvertTo-SecureString –String $Password –AsPlainText -Force
    $userCredential = New-Object –TypeName "System.Management.Automation.PSCredential" –ArgumentList $Account,$Pwd
    $O365Session = New-PSSession -ConfigurationName Microsoft.Exchange -ConnectionUri https://outlook.office365.com/powershell-liveid/ -Credential $userCredential -Authentication Basic –AllowRedirection
    Import-PSSession $O365Session –AllowClobber -DisableNameChecking
    

    Follow here: How to Fix "Access to OData is disabled" when Calling Graph API

    Hope this helps!

    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

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.