BingAds / BingAds-Python-SDK

Other
116 stars 162 forks source link

Server raised fault: Invalid client data. Check the SOAP fault details for more information. #235

Closed vp-at-st closed 1 year ago

vp-at-st commented 1 year ago

Getting the following error when trying to update a FinalUrlSuffix for a particular Campaign Id.

Method: UpdateCampaigns() Language: python

ERROR: suds.WebFault: Server raised fault: Invalid client data. Check the SOAP fault details for more information.

TrackingId: f1448115-fbed-4ae4-9f8b-ad1f0bcb3981.

vp-at-st commented 1 year ago

Hello @qitia , please inform if you'll be able to assist on this matter.

qitia commented 1 year ago

logs show that you are not passing valid AccountId.

vp-at-st commented 1 year ago

@qitia, The exact same AccountId works for GetCampaignsByIds() and GetAccount(). The documentation on all 3 methods mentions the same AccountId property. What's the difference then?

vp-at-st commented 1 year ago

Ran the script one more time: I picked 1 AccountId and used it for 2 methods. Got a successful response from GetCampaignsByIds() Got a successful response from GetAccount()

Then I used THE SAME ACCOUNT ID for UpdateCampaigns()

Got an error with this TrackingId: cb139a92-cc7b-44b4-a481-e34e402ad6c7.

qitia commented 1 year ago

hi there, logs for your request is interesting. it shows "Parameter 'Campaigns' is required and hasn't been found". May I Know how you are calling this UpdateCampaigns API?

vp-at-st commented 1 year ago

TrackingId: e1d7dd3b-0fba-4141-a742-b0fc0cb6b6a8.

` ACCOUNT_ID = 1111111 customer_id = 22222

auth_helper = AuthHelper() auth_data_2, cmp_service = auth_helper.get_service_client( service_type="CampaignManagementService", account_id=ACCOUNT_ID, customer_id=customer_id, )

campaigns = cmp_service.factory.create("ArrayOfCampaign") campaign = cmp_service.factory.create("Campaign")

campaign.FinalUrlSuffix = "utm_dc=test_testtest{test_id}" campaign.Id = 335442238

campaigns = campaigns.Campaign.append(campaign)

campaign_update_response = cmp_service.UpdateCampaigns(AccountId=ACCOUNT_ID, Campaigns=campaigns) `

vp-at-st commented 1 year ago

@qitia , We are using an account with API USER permissions to authenticate with the API. Could this be the reason why we can't update the Campaign?

qitia commented 1 year ago

in your code, you set campaigns = campaigns.Campaign.append(campaign)? thus the campaigns is none. You should just call campaigns.Campaign.append(campaign). Pls reopen this if it does not help.

vp-at-st commented 1 year ago

@qitia, No, it didn't help

vp-at-st commented 1 year ago

Don't close the issue until it's fully resolved

qitia commented 1 year ago

OK, let's reopen it. Did you fix the code pointed above? @vp-at-st

vp-at-st commented 1 year ago

Yes, I did. Got a response that I had to paste on a different ticket because you closed this ticket for some reason. Check it here for details: https://github.com/BingAds/BingAds-Python-SDK/issues/238