Share via

Microsoft.BingAds

Anonymous
2024-06-19T12:50:54+00:00

please could you give me some help

I'm trying to read the campaigns

var authorizationData = new AuthorizationData

            {

                Authentication = new OAuthWebAuthCodeGrant(ClientId, ClientSecret, new Uri(" https://www.erp.kalunga/auth2/callback"), ApiEnvironment.Production),

                DeveloperToken = DeveloperToken,

                CustomerId = CustomerId,

                AccountId = AccountId,

            };

            // Example: Retrieve Campaigns

            var campaignManagementService = new ServiceClient<ICampaignManagementService>(authorizationData);

            var request = new GetCampaignsByAccountIdRequest

            {

                CustomerId = "x",

                UserName = "x",

                Password = "x",

                ApplicationToken = "X",

                CustomerAccountId = "x",

                DeveloperToken = "X"

            };

            return (await campaignManagementService.CallAsync((s, r) => s.GetCampaignsByAccountIdAsync(r), request));

System.InvalidOperationException: 'OAuth access token hasn't been requested. Please request it using the corresponding OAuth class method before calling this method'

Microsoft Advertising | Customer tools | Microsoft Advertising Copilot

Locked Question. This question was migrated from the Microsoft Support Community. You can vote on whether it's helpful, but you can't add comments or replies or follow the question.

0 comments No comments

1 answer

Sort by: Most helpful
  1. Anonymous
    2024-06-19T13:52:43+00:00

    Dear Ricardo,

    Thank you for reaching out to us!

    We recommend that you ask your API question at the API Development Forum. In that forum you will find our API development engineers and partners who work with our APIs every day.

    For immediate assistance with API you are always welcome to contact support directly.

    Thank you,
    Vahid | Microsoft Advertising Support Specialist | 800-518-5689

    0 comments No comments