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:

  1. Missing or invalid configuration – required settings are empty or incorrect.
  2. Token request failure – the token endpoint returned an error or was unreachable.
  3. 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:

SettingDescription
API Base URLThe base URL of the AutoScout24 API endpoint. Must not include a trailing slash.
Client IDOAuth 2.0 client identifier provided by the API provider.
Client SecretOAuth 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

  1. In the WordPress admin, go to the plugin's System & Help tab.
  2. 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

  1. Go to the plugin Settings tab.
  2. Confirm that API Base URL, Client ID, Client Secret and Seller ID(s) are all filled in.
  3. Confirm the Base URL does not have a trailing slash and matches the format https://….
  4. If you have configured a custom Token URL or Token Audience, verify they are correct.
  5. 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 codeMeaning
as24ci_missing_credentialsClient ID or Client Secret is empty.
as24ci_missing_base_urlAPI Base URL is empty.
as24ci_token_failedThe token endpoint returned a non-2xx HTTP status or an invalid JSON body.
as24ci_token_missingThe token endpoint returned a 2xx response but the JSON body did not contain an access_token field.
as24ci_http_errorAn authenticated API request returned a non-2xx HTTP status. The log entry includes the URL and HTTP status code.
as24ci_json_errorAn 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:

  1. Confirm your server can reach the external API endpoint. Use a tool such as curl or wp shell (WP-CLI) to perform a test HTTP request from the server.
  2. Check that your hosting environment does not block outbound HTTPS on port 443.
  3. Check that a firewall, proxy or security plugin is not blocking wp_remote_post or wp_remote_get calls.
  4. 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:

  1. 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.
  2. 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 running delete_transient('as24ci_access_token') via WP-CLI.
  3. Re-test the connection.

Configuration reference

SettingWhere to configureNotes
API Base URLPlugin Settings tabRequired. No trailing slash.
Client IDPlugin Settings tabRequired.
Client SecretPlugin Settings tabRequired. Stored in wp_options.
Seller ID(s)Plugin Settings tabRequired. Comma-separated for multiple sellers.
Token URLPlugin Settings tabOptional. Falls back to {BASE_URL}/public/v1/clients/oauth/token.
Token AudiencePlugin Settings tabOptional. 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 the expires_in field 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_post and wp_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

SymptomLikely causeCheck
"Not connected – no Seller ID configured"Seller IDs field is emptyAdd at least one seller ID in Settings
"Missing API credentials" in logClient ID or Secret is emptyFill in credentials in Settings
"No API Base URL configured" in logBase URL field is emptyEnter the correct Base URL in Settings
Token request fails with HTTP 401Incorrect Client ID or SecretVerify credentials with the API provider
Token request fails with HTTP 403Client may lack permission for the endpointVerify API subscription or contact the provider
Token request times outServer cannot reach the token endpointCheck outbound network access from the server
API request fails with HTTP 401Token is expired or invalidDelete the as24ci_access_token transient and retry
API request fails with HTTP 404Base URL or path is incorrectVerify Base URL and API version with the provider
as24ci_json_errorAPI returned non-JSON (proxy or CDN HTML error page)Check for proxy, firewall or CDN issues
Connection test passes but imports return zero vehiclesSeller ID is correct but has no active or live listingsVerify listings are active in AutoScout24