BingAds / BingAds-Java-SDK

Other
42 stars 47 forks source link

v11 / KeywordPerformanceReport - Invalid Client Data #70

Closed TompiT closed 6 years ago

TompiT commented 6 years ago

Hi there,

I try to retrieve Keyword Performance Report from our Sandbox Account.

Following exception is raised com.microsoft.bingads.v11.reporting.AdApiFaultDetail_Exception: Invalid client data.

Executed code is exactly the same as the following example.

As mentioned on the example there is 3 options to retrieve the report (A,B,C). In my case A & B return null (i.e. no file, no exception) and C raises the exception above.

Any help or suggestion would be greatly appreciated.

eric-urban commented 6 years ago

It will help if you can provide the SOAP request (without credentials) and response. For suggestions on capturing the SOAP trace please see Handling Service Errors and Exceptions. Thank you.

TompiT commented 6 years ago

Hi Eric,

The API seems to refuse our credentials. We use a Sandbox account and we are able to use the campaign management (v11) service without issue with this account and the same credentials. Request API ID: 30000000000896802 SOAP Reply <TrackingId>4e6beb57-99ee-4a66-8708-fd06b9549790</TrackingId><Errors><AdApiError><Code>105</Code><Detail i:nil="true"/><ErrorCode>InvalidCredentials</ErrorCode><Message>Authentication failed. Either supplied credentials are invalid or the account is inactive</Message></AdApiError></Errors></AdApiFaultDetail></detail>

eric-urban commented 6 years ago

@TompiT - The 105 error code indicates some mismatch of either environment or user credentials + developer token. For the error above are you calling Reporting service in sandbox environment with the global (shared) sandbox developer token BBD37VB98 + your sandbox username/password? Otherwise if you are using production please double check that you are using your production developer token with production credentials.

TompiT commented 6 years ago

@eric-urban thanks for your reply.

For the error above are you calling Reporting service in sandbox environment with the global (shared) sandbox developer token BBD37VB98 + your sandbox username/password?

Yes we did that.

eric-urban commented 6 years ago

@TompiT -

Thanks for confirming. It should work in that case. Hmmm. Will you please triple check the endpoint you are hitting is reporting.api.sandbox. I have made this mistake many times when trying different tests, and its a common pitfall. For example you might have set the sandbox environment for campaign management service client, but didn't set it for the reporting service client. To ensure you are configured for sandbox please check this guide.

Otherwise you are welcome to contact support or reach out to me directly and I can review your full SOAP request + response.

TompiT commented 6 years ago

@eric-urban weird indeed as our ReportServiceManager is properly set with the Sandbox env. i.e. ReportingServiceManager = new ReportingServiceManager(authorizationData, ApiEnvironment.SANDBOX);

eric-urban commented 6 years ago

@TompiT please check if the error occurs when you poll after creating a new ReportingServiceOperation. I found a gap in the code sample that is fixed with this check-in.

TompiT commented 6 years ago

@eric-urban Thanks, everything seems to be ok now.