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

Pavan Sainadh 0 Reputation points
2024-11-21T11:14:16.89+00:00

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

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.