BingAds / BingAds-Python-SDK

Other
118 stars 164 forks source link

suds.WebFault: Server raised fault: 'Invalid client data. Check the SOAP fault details for more information. TrackingId: #239

Closed Zyuhang17 closed 1 year ago

Zyuhang17 commented 1 year ago

Can you help me with this please? I am trying to connect to the API

qitia commented 1 year ago

Message: The account ID is invalid. Please make sure you are using the correct AccountId. You can find your AccountId from UI.

here is the doc: https://learn.microsoft.com/en-us/advertising/campaign-management-service/getlabelsbyids?view=bingads-13

CustomerAccountId | The identifier of the ad account that owns or is associated with the entities in the request. This header element must have the same value as the AccountId body element when both are required. This element is required for most service operations, and as a best practice you should always set it.For more information see Get Your Account and Customer IDs. -- | -- CustomerAccountId The identifier of the ad account that owns or is associated with the entities in the request. This header element must have the same value as the AccountId body element when both are required. This element is required for most service operations, and as a best practice you should always set it. For more information see [Get Your Account and Customer IDs](https://learn.microsoft.com/en-us/advertising/guides/get-started?view=bingads-13#get-ids).
menporulporiayalan commented 1 year ago

@qitia I am having a similar issue. I can able to get the campaigns and Adgroups from the account. But I am receiving this error when I tried to submit "GenerateReport".

qitia commented 1 year ago

I cannot help anything without detail @menporulporiayalan. Can you please share trackingid/requestid, time when you made the call and so on?

menporulporiayalan commented 1 year ago

@qitia Sorry, I found out the issue. I was passing the account ID below

scope.AccountIds=account_id

Instead of

scope.AccountIds={'long': [account_id] }

which caused the error. Now its working fine

qitia commented 1 year ago

@Zyuhang17, is your issue resolved?

Zyuhang17 commented 1 year ago

@qitia Thank you for the response. Unfortunately, the problem is still not solved. I tried to use account_id as the form {'long': [account_id] }, the error tracking id is: suds.WebFault: Server raised fault: 'Invalid client data. Check the SOAP fault details for more information. TrackingId: 9d851d96-ad7d-4f3c-b8ac-0a65d1833300.'

May I ask:

  1. We are currently using the account ID from the UI. But is the account ID all numbers or it is letters+numbers
  2. It looks like I can get the User ID response when passing through XML UserID request, but when i pass in the account ID, program fails using python SDK.
  3. are we passing in the master customer ID for each API call or we should pass in client specific Customer IDs

Thank you!

qitia commented 1 year ago

it is still the "AccountId invalid" error. AccountId is all numbers. @Zyuhang17 image

Zyuhang17 commented 1 year ago

@qitia, Thanks for the help. Issue has been resolved. Can I ask a different question please: - How long does the refresh token last before we need to rotate it out?

qitia commented 1 year ago

around 90 days. but there is no guarantee. please open another issue as necessary thus we can track easier.

Zyuhang17 commented 1 year ago

thanks, Could you please help me check this ID? suds.WebFault: Server raised fault: 'Invalid client data. Check the SOAP fault details for more information. TrackingId: ef67a92f-529e-448b-9b24-daa3dbf2ba94.'