curladsbingbing-ads-apiconversions-api

Can Bing Ads Offline Conversions Be Achieved with Curl Command


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?


Solution

  • 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.