Offline Numbers API
REST · JSON v1.7 20 February 2020

Offline Numbers API

Manage static tracking phone numbers for offline media channels: print, billboards, business cards, and more.

Introduction #

The Optico Offline Numbers API manages static tracking phone numbers, permanently assigned to specific destination numbers for offline media such as print ads, billboards, business cards, and catalogues. Unlike online tracking numbers (assigned dynamically per web visitor), offline numbers are persistent and tied to a named campaign or destination.

Base URL https://www.optico.fr

Transport & Conventions

MethodAll endpoints use GET
ParametersQuery string parameters
Response formatapplication/json
Timeout5 seconds recommended

Authentication #

Every request must include the key parameter, the Offline Numbers API key for the domain. This key is available in your domain settings in the Optico backend.

GET
/offline-numbers-api?key=offl_b7e2c8a14f9dcdef&action=check&tracking_number=0899123456
The Offline Numbers API must be explicitly enabled for the domain in the Optico admin. Requests with a valid key but disabled API return {"status": "error", "error": "Access denied to this API"}.

Errors #

Response envelope

Every request returns 200 OK with a JSON envelope. Branch on the status field; on error, the error field carries the reason.

Success

json
{ "status": "success", "phone_number": "0612345678", "tracking_number": "0899123456" }

Error

json
{ "status": "error",
  "error": "No tracking number available" }

Common error messages

MessageCauseFix
Invalid API keyThe key is missing, revoked, or does not belong to this domain.Use the Offline Numbers API key from your domain settings.
Access denied to this APIThe Offline Numbers API is not enabled for the domain.Contact Optico to enable the API on the domain.
No tracking number availableThe private pool for the requested type is exhausted.Request additional numbers from Optico, or pick a different prefix.
Tracking number already assignedThe number you are trying to assign is already in use.Use reassign to change its destination, or unassign first.
Unknown tracking numberThe given tracking_number is not part of this domain's pool.Check the number with /offline-numbers-api/list.

Idempotency

Read actions (check, /list) are safe to call repeatedly. Write actions (assign, unassign, reassign, redirect_setup) return the current state on success; re-issuing an unassign or redirect_setup after success is a no-op. assign allocates a new number from the pool each time it succeeds; do not retry blindly on timeout, call check first.

Retries & timeouts

Use a 5-second client timeout. Retry on network timeout or HTTP 5xx only for read actions. For assign, treat a timeout as "unknown" and call check with the destination phone_number to discover whether a number was allocated before retrying.

Rate limits

No fixed public rate limit is enforced. These endpoints are administrative; typical use is a handful of requests per day, not per second. Contact support before scripting bulk reassignments.

Endpoints #

EndpointMethodPurpose
/offline-numbers-apiGETManage tracking numbers: assign, unassign, reassign, check, and more.
/offline-numbers-api/listGETList all tracking and destination phone numbers for a domain.

GET /offline-numbers-api #

GET/offline-numbers-api

Common Parameters

ParameterTypeDescription
keystring RequiredOffline Numbers API key for the domain.
actionstring RequiredOne of: assign, unassign, reassign, check, redirect_setup.
phone_numberstringThe destination (real) phone number to forward calls to.
tracking_numberstringThe Optico tracking phone number (from the private pool).
descriptionstringLabel for the tracking number (e.g. campaign name, ad placement).
typeintegerTracking number prefix type. See table below.
cost_groupstringFor surtax type numbers, optionally filter by cost group. E.g. A299.
allow_redirect0 or 1Set whether calls should redirect when the callee is not responding.
timetablearray|intTimetable for the redirect feature. Pass 0 to unset, or an array of day/range entries e.g. timetable[monday]=10:00-12:00;17:15-18:24.

Type and Prefix Reference

IDPrefixIDPrefixIDPrefixIDPrefix
108002081030940820
50899601702803
9041005110892120897
170826180805200811210821
2208252300442024004925004990
260034900270044912800349290044800
300032310891320890330895
340806

Success Response Fields

FieldDescription
statussuccess or error
phone_numberDestination phone number (the real number).
tracking_numberAssigned Optico tracking number.
allow_redirectCurrent redirect setting (0 or 1).
timetableActive timetable (0 if empty, otherwise JSON array of day/range entries).

Action: assign #

Assign a tracking number from the domain's private pool to a destination phone number.

ParameterRequired for this action
phone_numberRequired
descriptionRequired
typeRequired
allow_redirect, cost_group, timetable, operatorOptional
GET
/offline-numbers-api?key=offl_key&action=assign&phone_number=0612345678&description=Magazine+Ad&type=1&allow_redirect=1
json
{ "status": "success", "phone_number": "0612345678", "tracking_number": "0899123456", "allow_redirect": "1" }

Action: unassign #

Release a tracking number back to the private pool. Provide either tracking_number or phone_number.

GET
/offline-numbers-api?key=offl_key&action=unassign&tracking_number=0899123456

Action: reassign #

Change the destination phone number for an existing tracking number.

ParameterRequired
phone_numberRequired
tracking_numberRequired
description, allow_redirectOptional

Action: check #

Query the current status of a tracking number or destination phone. Provide either tracking_number or phone_number.

json
{ "status": "success", "phone_number": "0612345678", "tracking_number": "0899123456", "allow_redirect": "1" }

Action: redirect_setup #

Update the call forwarding redirect flag and/or the timetable for an existing tracking number.

ParameterRequired
allow_redirectRequired
tracking_number or phone_numberRequired (one of)
timetableOptional
json
{ "status": "success", "phone_number": "0612345678", "tracking_number": "0899123456",
  "allow_redirect": "1", "timetable": [{ "day": "mon", "from": "09:00", "to": "18:00" }] }

GET /offline-numbers-api/list #

GET/offline-numbers-api/list

Returns all tracking numbers (both assigned offline numbers and unassigned pool numbers) associated with the domain.

Parameters

ParameterTypeDescription
keystring RequiredOffline Numbers API key.
details0 or 1 OptionalIf 1, returns full details per number. Default returns a simple mapping.

Simple response (details=0)

json
{
  "0899123456": "0612345678",
  "0899789012": "0698765432"
}

Tracking number → destination phone

Detailed response (details=1)

json
{
  "tracking_number_details": [{
    "tracking_phone": "0899123456",
    "destination_phone": "0612345678",
    "description": "Magazine Ad",
    "product_name": "example.com",
    "last_update": "2019-10-01 12:00:00"
  }]
}