Skip to main content
DialNexa API fundamentals cover the four behaviors every production client needs: Bearer API key authentication, endpoint-specific pagination, structured error handling, and safe retry decisions. Use this page after the Quickstart and before sending real customer traffic.

Before you build a DialNexa API client

  • Create an API key in Settings > API Keys.
  • Use https://api.dialnexa.com/v1 as the base URL.
  • Keep API keys in server-side environment variables or a secrets manager.
  • Read the individual endpoint page before relying on its request, response, side-effect, or retry behavior.

Authenticate DialNexa API requests

An API key has a key ID and secret separated by a colon. Send the complete key_id:secret value as a Bearer token on every request.
A missing, revoked, expired, or malformed key returns 401 Unauthorized.
Every operation under Endpoints supports Bearer API key authentication. Never send an API key from browser or mobile client code, commit it to source control, or include it in logs and screenshots.

Avoid common authentication mistakes

  • Send the full key_id:secret value, not only the key ID.
  • Use the Authorization: Bearer ... header, not x-api-key.
  • Keep /v1 in the configured base URL.
  • Use separate keys for development, staging, and production.
  • Rotate a key immediately after suspected exposure.
Webhook requests use a separate HMAC signature. See Webhooks for raw-body verification examples.

Paginate DialNexa list responses

DialNexa list endpoints do not use one universal response envelope. Most paginated endpoints accept page and limit, but their record keys, metadata fields, defaults, and maximums vary. Treat each endpoint page as the source of truth.
For an endpoint with meta.totalPages, continue until the current page reaches the reported total:
For calls, stop when a page contains fewer records than the requested limit. Catalog endpoints return their complete lists and should not be paged.

Handle DialNexa API errors

Failed API requests return a structured error object. The message field can be a string or an array of validation messages.

Common HTTP status codes

Always check response.ok before using a response body:

Build reliable API clients

A timeout does not prove that a request failed. Repeating a write can create a duplicate resource, purchase another number, or place another call.
The current v1 contract does not define a platform-wide idempotency header or one universal rate limit. Do not invent an idempotency header or hard-code a global request limit.
Set connection and total request timeouts that fit your application. For retry-safe requests, use capped exponential backoff with jitter and honor Retry-After when the response includes it.
For calls, attach a stable correlation value in metadata, save the returned DialNexa call ID, and reconcile recent calls after an ambiguous timeout.

Verify your API client

Before production traffic:
  1. Confirm an authenticated list request returns 200.
  2. Test each list parser against the endpoint’s actual response envelope.
  3. Verify string and array error messages are both handled.
  4. Confirm 4xx failures are not retried automatically.
  5. Simulate a transient read failure and confirm backoff is capped.
  6. Simulate a timed-out write and confirm the client reads or reconciles before retrying.
  7. Redact API keys, secrets, phone numbers, and sensitive metadata from logs.

Troubleshoot API client behavior