How to get refresh token based on access token for auth module Bing ads

Elite 1 Reputation point
2021-09-20T15:46:53.637+00:00

Hello ,
I am having a difficult time to get the refresh token for the auth module to connect to Bing Ads for reports . We are using Fivetran and in order to programmatically authorize , we need client_id , client_access and refresh_token. I am able to get a access_token following the doc below
https://learn.microsoft.com/en-us/advertising/guides/authentication-oauth-get-tokens?view=bingads-13

Having a tough time getting the POST Request correct with the access code. Could you provide the python script so that I can plug and play the information and get the refresh_token ?

I also tried using POSTMAN and get invalid Grant Error

Bing | Bing Search APIs | Bing Web Search API
Microsoft Security | Microsoft Entra | Microsoft Entra ID
{count} votes

2 answers

Sort by: Most helpful
  1. YutongTie-MSFT 53,966 Reputation points Moderator
    2021-10-04T17:00:00.68+00:00

    @Elite

    Hello,

    Hope you have solved your issue. If not, could you please check the sample provided in comment and let us know how this goes on your side? We are here to help.

    Regards,
    Yutong

    0 comments No comments

  2. 2021-12-02T16:34:08.95+00:00

    Hi Yutong,

    I'm also facing similar issue. Trying to get the access token from Bing ads api by passing below details - clientid, code, granttype , refresh token & scope as per documentation https://learn.microsoft.com/en-us/advertising/guides/authentication-oauth-get-tokens?view=bingads-13, but getting below error.

    "error_description": "AADSTS70000: The provided value for the input parameter 'refresh_token' or 'assertion' is not valid.\r\nTrace ID: 369b2372-4666-41cd-9b59-03916d828d05\r\nCorrelation ID: d0fef881-efff-42a3-b52f-24af5a611bfa\r\nTimestamp: 2021-12-02 16:33:36Z",

    Please help to resolve.

    Thanks!


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.