0

Can Bing Ads Offline Conversions be achieved in a REST API way with the Curl command on Linux? Or, is there a way to understand the SOAP API process with Curl so that I can understand the lower-level HTTP calls it makes and can parse the SOAP XML response?

Volomike
  • 23,743
  • 21
  • 113
  • 209

1 Answers1

1

GetUser API calls

I'll start out with using curl command on Linux for accessing BingAds API/ to understand the same process of SOAP API process with Curl/ lower-level HTTP call it makes...

Consider these basic examples:

accessToken=<fill in..>
developerToken=<fill in..>

soapRequest='<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:v13="https://bingads.microsoft.com/Customer/v13"><soapenv:Header><v13:DeveloperToken>'$developerToken'</v13:DeveloperToken><v13:AuthenticationToken>'$accessToken'</v13:AuthenticationToken></soapenv:Header><soapenv:Body><v13:GetUserRequest><v13:UserId xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:nil="true" /></v13:GetUserRequest></soapenv:Body></soapenv:Envelope>'

echo "soapRequest: $soapRequest"

soapResponse=$(curl -X POST -H "Content-Type: text/xml" -H "SOAPAction: GetUser" -d "$soapRequest" https://clientcenter.api.bingads.microsoft.com/Api/CustomerManagement/v13/CustomerManagementService.svc)

echo "soapRequest: $soapResponse"

enter image description here

Bing Ads Offline Conversions API calls

I can point you to the following links, which you may try out using above method.

However, other than for the purpose of understanding SOAP API calls to BingAds, I would recommend against using curl for your automation. Instead, use C#/Java/Php/Python APIs links. C# in .net core works executes well in Linux platform.

AAATechGuy
  • 385
  • 2
  • 9
  • There evidently is a way to do it a bit easier. Once a developer figures out the proper IDs (as discussed in the following online tutorial), and generates an access token with HTTP REST, they can then use the following tutorial to make a simple XML SOAP envelope and do an HTTP POST to the server to get an XML SOAP envelope response back. https://aude53.medium.com/upload-revenue-to-bing-ads-with-javascript-cc2546050f5c I'll document this in more detail in another answer soon. Just 2 API calls to MS does it all. – Volomike Aug 01 '22 at 06:18