Documentation · Troubleshooting
API Connection Errors
This document covers common API connection problems that can prevent the ADP Car Market Hub plugin from retrieving vehicle listings from the AutoScout24 API. It lists likely causes, diagnostic checks and corrective steps.
When to use this document
Read this document when:
- The System Status page reports a connection error or shows "Not connected".
- Import runs produce zero results and the log contains authentication or HTTP errors.
- Manual import attempts return error messages related to credentials, tokens or unreachable endpoints.
Overview
The plugin connects to the AutoScout24 Public API using an OAuth 2.0 client credentials flow. Before each API request, it requests an access token from the configured token endpoint and caches the token in a WordPress transient for the duration of its validity. All authenticated requests include a Bearer token in the Authorization header.
Connection failures can occur at three points:
- Missing or invalid configuration – required settings are empty or incorrect.
- Token request failure – the token endpoint returned an error or was unreachable.
- API request failure – the token was obtained but a subsequent API call failed with an HTTP error or an invalid response body.
Prerequisites
The following settings must be configured in the plugin admin before any connection can succeed:
| Setting | Description |
|---|---|
| API Base URL | The base URL of the AutoScout24 API endpoint. Must not include a trailing slash. |
| Client ID | OAuth 2.0 client identifier provided by the API provider. |
| Client Secret | OAuth 2.0 client secret provided by the API provider. |
| Seller ID(s) | One or more seller IDs, comma-separated. Used to identify the seller account. |
| Token URL (optional) | Override for the token endpoint URL. If left empty, the plugin derives it from the Base URL as {BASE_URL}/public/v1/clients/oauth/token. |
| Token Audience (optional) | Override for the OAuth audience parameter. If left empty, the plugin derives it from the Base URL scheme and host. |
These values are provided by the API service. Verify them against your AutoScout24 API account or the credentials supplied by the integration provider. Do not enter test credentials in a production environment.
Diagnostic steps
Step 1: Check the System Status page
- In the WordPress admin, go to the plugin's System & Help tab.
- Look at the connection status indicator. - If it shows a specific error message, note the error code and message text. - If it shows "Not connected – no Seller ID configured in Settings", proceed to Step 2.
Step 2: Verify the plugin settings
- Go to the plugin Settings tab.
- Confirm that API Base URL, Client ID, Client Secret and Seller ID(s) are all filled in.
- Confirm the Base URL does not have a trailing slash and matches the format
https://…. - If you have configured a custom Token URL or Token Audience, verify they are correct.
- Save the settings and re-test the connection from the System Status page.
Step 3: Read the log file
Open the plugin log file at:
wp-content/uploads/as24ci-logs/adp-car-market-hub.log
Search for recent entries containing the following error codes or keywords:
| Error code | Meaning |
|---|---|
as24ci_missing_credentials | Client ID or Client Secret is empty. |
as24ci_missing_base_url | API Base URL is empty. |
as24ci_token_failed | The token endpoint returned a non-2xx HTTP status or an invalid JSON body. |
as24ci_token_missing | The token endpoint returned a 2xx response but the JSON body did not contain an access_token field. |
as24ci_http_error | An authenticated API request returned a non-2xx HTTP status. The log entry includes the URL and HTTP status code. |
as24ci_json_error | An API request returned a 2xx response but the body was not valid JSON. |
Note: the log automatically masks credential values. You will see client_secret=*** and Bearer *** instead of real values.
Step 4: Test network connectivity
If the log confirms the plugin attempted a request but received a connection error:
- Confirm your server can reach the external API endpoint. Use a tool such as
curlorwp shell(WP-CLI) to perform a test HTTP request from the server. - Check that your hosting environment does not block outbound HTTPS on port 443.
- Check that a firewall, proxy or security plugin is not blocking
wp_remote_postorwp_remote_getcalls. - Confirm the API endpoint domain resolves correctly from your server (DNS resolution).
Step 5: Check for expired or rotated credentials
If the connection was working previously and has stopped:
- Confirm with the API provider or your account settings that the Client ID and Client Secret are still valid and have not been rotated or revoked.
- Delete the cached access token transient. The transient key is
as24ci_access_token. You can delete it from the WordPress admin via Tools → Delete Transients (requires a transient management plugin) or by runningdelete_transient('as24ci_access_token')via WP-CLI. - Re-test the connection.
Configuration reference
| Setting | Where to configure | Notes |
|---|---|---|
| API Base URL | Plugin Settings tab | Required. No trailing slash. |
| Client ID | Plugin Settings tab | Required. |
| Client Secret | Plugin Settings tab | Required. Stored in wp_options. |
| Seller ID(s) | Plugin Settings tab | Required. Comma-separated for multiple sellers. |
| Token URL | Plugin Settings tab | Optional. Falls back to {BASE_URL}/public/v1/clients/oauth/token. |
| Token Audience | Plugin Settings tab | Optional. Falls back to {scheme}://{host} of Base URL. |
Operational notes
- The access token is cached in a WordPress transient (
as24ci_access_token) for the duration reported by theexpires_infield in the token response, minus 60 seconds as a safety margin. - All API requests use a 30-second HTTP timeout. On shared hosting with low timeout limits, requests may fail. Verify this behavior in the current plugin version before publishing.
- The plugin uses
wp_remote_postandwp_remote_get, which respect WordPress HTTP API filters and settings. Any plugin or configuration that modifies or disables the WordPress HTTP API may affect connectivity. - The Market Hub API (used for price comparison data) uses a separate base URL (
https://api.car-market-hub.ad-promotion.ch/v1). Access to it is governed by your plugin license, not by a separately entered key — there is no customer-managed Hub API key. Connection problems with Market Hub data do not affect the main AutoScout24 import. See Market Insights Issues.
Troubleshooting
| Symptom | Likely cause | Check |
|---|---|---|
| "Not connected – no Seller ID configured" | Seller IDs field is empty | Add at least one seller ID in Settings |
| "Missing API credentials" in log | Client ID or Secret is empty | Fill in credentials in Settings |
| "No API Base URL configured" in log | Base URL field is empty | Enter the correct Base URL in Settings |
| Token request fails with HTTP 401 | Incorrect Client ID or Secret | Verify credentials with the API provider |
| Token request fails with HTTP 403 | Client may lack permission for the endpoint | Verify API subscription or contact the provider |
| Token request times out | Server cannot reach the token endpoint | Check outbound network access from the server |
| API request fails with HTTP 401 | Token is expired or invalid | Delete the as24ci_access_token transient and retry |
| API request fails with HTTP 404 | Base URL or path is incorrect | Verify Base URL and API version with the provider |
as24ci_json_error | API returned non-JSON (proxy or CDN HTML error page) | Check for proxy, firewall or CDN issues |
| Connection test passes but imports return zero vehicles | Seller ID is correct but has no active or live listings | Verify listings are active in AutoScout24 |