Share via

When iam trying to get bing ads bulk download iam getting "invalid client data" as error

Pavan Sainadh 0 Reputation points
Nov 21, 2024, 11:14 AM

code snippet iam using :

authorization_data = AuthorizationData(
        authentication=auth,
        developer_token=DEVELOPER_TOKEN,
    )

    service = ServiceClient(
        service='CustomerManagementService',
        version=13,
        authorization_data=authorization_data,
    )
    accounts = service.GetAccountsInfo()
    account_ids = [account.Id for account in accounts.AccountInfo]
    if not account_ids:
        raise Exception("No account IDs found.")
    print("account ids in ",account_ids)
    bulk_service = BulkServiceManager(
        authorization_data=authorization_data,
        poll_interval_in_milliseconds=5000
    )
    entities = ['Campaigns', 'AdGroups', 'Ads']
    download_parameters = DownloadParameters(
        campaign_ids=None,
        data_scope=['EntityData'],
        download_entities=entities,
        result_file_directory='.',
        result_file_name=f'bulk_data_account_{account_ids[0]}.zip',
        overwrite_result_file=True
    )
    print("Submitting bulk data download request...")
    download_request_id = bulk_service.submit_download(download_parameters)

The error was like this:

Web service reported a SOAP processing fault using an unexpected HTTP status code 200 and reporting as an internal server error.

raise WebFault(fault, replyroot)

suds.WebFault: Server raised fault: 'Invalid client data. Check the SOAP fault details for more information. TrackingId: 243a8434-c180-4497-b298-15e982a4e1.'

Microsoft Advertising API
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.
428 questions
0 comments No comments
{count} votes

1 answer

Sort by: Most helpful
  1. umer asif 0 Reputation points
    Nov 23, 2024, 2:42 PM

    The "Invalid client data" error typically occurs due to issues with credentials or parameters. Here's a short checklist to resolve it:

    1. Check credentials: Ensure your DEVELOPER_TOKEN and authentication details are correct and active.
    2. Validate account IDs: Confirm that GetAccountsInfo() is returning valid account IDs.
    3. Check download parameters: Ensure the campaign_ids parameter can accept None and is correctly set.
    4. API version: Confirm that you're using the correct API version (you might want to try version=14).
    5. Handle errors: Add better error handling to capture detailed SOAP fault information for debugging.

    If the problem persists, use the provided tracking ID to contact Bing Ads support. For better performance, you may also want to try using a Calculadora Alicia to test the API.

    0 comments No comments

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.