Cannot connect to the Microsoft/Bing Ads API in node via SOAP

I am trying to connect to the Microsoft Ads API. I am using the soap npm package. When I try to send a request I get an error with the message "Error http status codes" and a status code of 400. I am unfamiliar with SOAP and cannot figure out why. My code us below – any ideas?

const soap = require("soap");  const main = async () => {   try {     const url =       "https://campaign.api.bingads.microsoft.com/Api/Advertiser/CampaignManagement/v13/CampaignManagementService.svc?wsdl";     const requestArgs = { AccountId: "X1612017", CampaignType: "Search" };     const soapClient = await soap.createClientAsync(url);     soapClient.addSoapHeader({       AuthenticationToken:{my token},       CustomerAccountId: {my Customer Account Id},       CustomerId: {my customer id},       DeveloperToken: {my dev token},     });     const result = await soapClient.GetCampaignsByAccountIdAsync(requestArgs);   } catch (error) {     console.log(error);   } };  main(); 

Thanks

Add Comment
0 Answer(s)

Your Answer

By posting your answer, you agree to the privacy policy and terms of service.