Getting Invalid client data error with TrackingId "ca4fde87-dc33-4d65-b69a-4eeeb06a0f7a" when using Bing Ads API. How can I solve this?

FIonn_423 0 Reputation points


I have been trying to get the Bing Ads API to work, but I keep running into an error when trying to run the GetUser method on the customer_service object, or when trying to make any request after authenticating and creating the authorization_data object.

I have created the Application Registration in Azure, which has the correct API permission of msads.manage, and my account has Owner access to this application and Super Admin access to the Microsoft Ads account I want to connect to. I can authorize with the application successfully, and create the authorization_data object. But it outputs the error, "Invalid client data" error with TrackingId "ca4fde87-dc33-4d65-b69a-4eeeb06a0f7a".

I contacted Microsoft Ads support about this, and after about 2 weeks of communication, the final answer I got was that the error associated with the TrackingId was "Error: UserPuidNotFound - Puid not found", and that I should try again with a new refresh token. But each time I try to run it, I use a new refresh token, so this is not an issue. And now they have stopped responding to my emails.

This error is outputted when I run this code -

get_user_response=customer_service.GetUser(UserId = "XXXXXXXXXXXXX").

I can see my UserID when I go to this link - So I can see my PUID.

Furthermore, when I try to make any request to extract data, I get the same error, this time with TrackingId "19beab01-4b35-4587-aa20-011de194da3d".

Can anyone help me with this? Everything seems to be okay in terms of access, and how I am going about the process, but it keeps outputting "Invalid client data".

Kind regards,


I have tried to insert the correct PUID as an argument in the function.

I have tried to use multiple new refresh tokens.

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.
382 questions
0 comments No comments
{count} votes