Debug API errors via API Diagnostics
The API Diagnostics tab lets you find, view and download all the failed data entries in the Content API requests that you upload on the Google Merchant Center account.
The key features of this API debug tool are:
- Find all the entry-related errors in the API requests for a given time period.
- Determine the total number of failed data entries per error category.
- View a sample request that caused the entry-related error.
- Modify and test the same request snippet in dry-run mode before fixing similar errors in all the original requests.
- Download the full request and full response for further analysis.
You can analyse the affected data entries and find all the API requests that have a similar error, at your end. After fixing the errors, resubmit the API requests.
Use the timeline to find failed data entries
The Timeline utility lets you find the failed data entries in the API requests uploaded within a given time period. The results displayed include the total number of failed instances across the error categories.
To view the failed data entries, follow these steps:
- Sign in to your Merchant Center account and click API Diagnostics on the left hand navigation. The page is displayed.
- In the Timeline utility, select a pre-defined time period (your options are: 1 minute, 5 minutes, 1 hour, 1 day, and so on).
- Optionally, you can zoom to a specific number of days by sliding the timeline bar below the graph. This can be useful when you need to locate specific error entries within a few hours or days. For instance, when your account is experiencing a spike in errors on a particular day.
The API debugger utility searches all the API requests that you uploaded in the specified time period and renders a graph displaying the Number of failed entries vs. the Total number of entries. The sample failed requests (if any) are displayed below Details on Failed Entries and are grouped by type of request.
Note: The displayed timestamp on the graph is per the time zone specified in the web browser.
View data for sub-accounts of a multi-client account
If you're viewing the API Diagnostics tab of a subaccount (account under a multi-client account), you can restrict the results by selecting one of the following options:
- My requests only (selected by default): restricts the results to the requests you made on behalf of this sub-account.
- All requests targeting this account: displays results for all requests made on behalf this sub-account, regardless of their origin.
View and download failed data entries
After the Details on Failed Entries section displays the error lists and sample codes, you can browse through them to quickly determine the causes of the failed entries in the API requests.
To view and download the failed data entries, follow these steps:
- In the Details on Failed Entries section, click the '+' and '-' icons to browse through the errors and their respective sample snippets. The Sample displays the request type (GET, POST, PUT or DELETE), along with its URL.
- Now, view the error in the sample code, by clicking the Request Snippet and Response Snippet tabs.
Note: If you own a multi-client account, you can also see a list of the top 20 subaccounts affected by an error by clicking on Top 20 subaccounts.
- Optionally, you can download the full requests, by clicking the full request and full response links, next to Download.
Use the above error messages as guidelines to fix your API requests and resubmit them. You can also try to fix the request snippet errors in the dry-run mode. Refer to the steps mentioned in the section below.
Note 1: The errors are listed by descending number of instances.
Note 2: Errors related to malformed XML requests are currently not captured by the API debug tool.
Modify and test failed data entries
You can modify and test the erroneous sample data entries. This enables you to try and fix the said error in dry-run mode.
To modify and test a sample failed data entry, follow these steps:
- In the Details on Failed Entries section, expand a sample request snippet, belonging to an items feed.
- Click Replay request to open the Replay Request in Dry-Run Mode window.
- Click the Replay request button to view the errors in the Response code window. The number of errors is displayed above this window, in the status section.
- Now, modify the Request code snippet to try and fix the error, and again click Replay request.
- If the error is fixed, a 'success' message is flashed above the Response code window.
You can repeat the above steps for all the sample errors that you have downloaded. After you figure out a fix for the sample error, carry out similar fixes in all the affected requests, and resubmit them successfully.
Note: The dry-run mode is available only for item feeds.