Microsoft Advertising API
A Microsoft API that provides programmatic access to Microsoft Advertising to manage large campaigns or to integrate your marketing with other in-house systems.
424 questions
This browser is no longer supported.
Upgrade to Microsoft Edge to take advantage of the latest features, security updates, and technical support.
Hi,
I've been trying to submit offline conversions using the Bing Ads API, but I encounter the error "Invalid client data. Check the SOAP fault details for more information" every time I try to do so.
I am using the parameters as described in the official documentation here: Code Example: Offline conversions.
Additionally, I have a question about the MicrosoftClickId
:
MicrosoftClickId
values that have been actually issued? I'm wondering if this might be a part of my problem.Could you provide any insight into why this error might be occurring and how to resolve it? Any advice would be greatly appreciated.
Thank you!
$wsdl = 'https://campaign.api.sandbox.bingads.microsoft.com/Api/Advertiser/CampaignManagement/v13/CampaignManagementService.svc?wsdl';
$client = new SoapClient($wsdl, [
'trace' => 1,
'exceptions' => true
]);
$headers = [
new SoapHeader('https://bingads.microsoft.com/CampaignManagement/v13', 'DeveloperToken', $developerToken),
new SoapHeader('https://bingads.microsoft.com/CampaignManagement/v13', 'CustomerId', $customerId),
new SoapHeader('https://bingads.microsoft.com/CampaignManagement/v13', 'CustomerAccountId', $accountId),
new SoapHeader('https://bingads.microsoft.com/CampaignManagement/v13', 'AuthenticationToken', $accessToken),
];
$client->__setSoapHeaders($headers);
$conversion = new OfflineConversion();
$conversion->ConversionName = 'Conversion';
$conversion->ConversionTime = '2024-05-05T09:28:41Z';
$conversion->ConversionValue = 5.0;
$conversion->MicrosoftClickId = 'f894f652ea334e739002f7167ab8f8e3';
$conversion->ConversionCurrencyCode = 'USD';
$request = new ApplyOfflineConversionsRequest();
$request->OfflineConversions = [$conversion];
// Call the API method
$result = $client->ApplyOfflineConversions($request);