0

I am working with Microsoft bing ads api, and trying to get user info such as his Microsoft bing ads email, username id ...

the problem is: when i include the scopes : `

openid%20offline_access%20https%3A%2F%2Fads.microsoft.com%2Fmsads.manage%20user.read

` (to get access token), i get this error:

{'error': 'invalid_scope', 'error_description': "AADSTS70011: The provided value for the 
input parameter 'scope' is not valid. One or more scopes in 'openid offline_access https://ads.microsoft.com/msads.manage user.read' are not compatible with each other.\r\nTrace 
ID: 2e39f740-89fa-4c3f-bdba-399a67212300\r\nCorrelation ID: 7f490003-2f31-45f2-a532-ac688ab9ca0e\r\nTimestamp: 2022-11-02 11:27:42Z", 'error_codes': [70011], 'timestamp': '2022-11-02 11:27:42Z', 'trace_id': '2e39f740-89fa-4c3f-bdba-399a67212300', 'correlation_id': '7f490003-2f31-45f2-a532-ac688ab9ca0e'}

How to get the email of the authenticated user in Microsoft Bing ads API? How can we include one or more scopes properly in microsoft apis?

Here's the API call i used:

POST /{tenant}/oauth2/v2.0/token HTTP/1.1
Host: https://login.microsoftonline.com
Content-Type: application/x-www-form-urlencoded

client_id=11111111-1111-1111-1111-111111111111
&scope=openid%20offline_access%20https%3A%2F%2Fads.microsoft.com%2Fmsads.manage%20user.read
&code=OAAABOxVXr...
&redirect_uri=http%3A%2F%2Flocalhost%2Fmyapp%2F
&grant_type=authorization_code
&client_secret=jXoM3iz...  
MOnir
  • 29
  • 3
  • To get the user details such as user id and email from microsoft graph API we use:https://learn.microsoft.com/en-us/graph/api/user-get?view=graph-rest-1.0&tabs=http#example-1-standard-users-request, not sure regarding Microsoft Bing ads API, can you please share any reference document. – Mehtab Siddique Nov 07 '22 at 11:50

0 Answers0