BingAds-Python-SDK: Invalid client data soap

ipappi 1 Reputation point
2021-11-09T16:11:45.2+00:00

Hi,

The following error came up while trying to retrieve campaigns using Bingads Python API (for a specific accountid and customerid, substituted with XXXX in the code snippet) :

Web service reported a SOAP processing fault using an unexpected HTTP status code 200. Reporting as an internal server error.
<suds.sax.document.Document object at 0x0000026EA74E9C08>
Server raised fault: 'Invalid client data. Check the SOAP fault details for more information. TrackingId: cc0bdf1a-095e-4448-abce-9b370f01e5be.'

The code I used to reach up to this point was the following:
147855-image.png

Everything ran without errors and then continued to take the oauth_tokens by manual user authentication through a browser pop-up and then copying and pasting the refresh token into the system input:

147810-image.png

So far so good, then I stored the generated refresh_token:

147770-image.png

The error in the beginning of my message (invalid client) appeared when I ran the following snippet and the exception was triggered:

147848-image.png

This snipped used in the background the following routines appearing below:

147873-image.png

I can't really explain the error and the threads already posted were not very helpful in my case. I ran the script using my Microsoft account and the respective developer token as an administrator for this account. So in my case I don't think the problem is really that my user does not have enough rights for actions inside the account.
Could you please help?

PS. The final goal of my project is also to create an automation which will be triggered and run directly on the cloud to interact with Bing Ads and thus a non -manual step of acquiring the refresh token and a full authentication is needed for this. Is there a solution about this? I read the documentation quite carefully but I didn't find something relevant to what I am trying to achieve.

Thanks beforehand!

Microsoft Authenticator
Microsoft Authenticator
A Microsoft app for iOS and Android devices that enables authentication with two-factor verification, phone sign-in, and code generation.
5,591 questions
0 comments No comments
{count} votes