Skip to content

Download an example configuration file (pbx)

get /configuration-import/example

Downloads a complete PBX configuration file of kind external, made up for this purpose. It holds at least one record of every kind a file may contain, and it always passes the current rules, because a test checks it against them. Use it to see how a finished file looks, to test your requests before your own file is ready, and to compare your converter's output with a file Cockpit accepts.

The answer is a zip in the form the import takes: configuration.json and the sound file under files/. You can send it unchanged to POST /configuration-import/validate to test your requests. Do not send it to POST /configuration-imports with the key of a PBX in use: it would add a version whose restore replaces the configuration of that PBX with made-up records.

Needs the configuration-import scope on the API key. Rate limit: 30 requests per minute per PBX, shared with the other reading requests of this section (429 with Retry-After). Answers 503 while configuration versions are switched off on this installation.

HTTP: IntegrationApiKey

API key created on the Cockpit Integrations page (an "API key" integration). It is a bearer token owned by the customer's PBX and limited to the scopes selected when the key was created (e.g. phone-numbers, push-configuration).

Send it in the Authorization header:

Authorization: Bearer <api_key>

Manage keys (create / reveal / revoke) from Integrations → New integration → API key.

HTTP Authorization Scheme
bearer

Responses

The example file as a zip.
Response schema
No response body.
Unauthenticated. The `Authorization: Bearer <token>` header was missing, malformed, or names a token that has been revoked or deleted.
Response schema
messagestring
Forbidden. The bearer token authenticated successfully but does not carry the scope this endpoint requires. Re-create the Integrations API key with the missing scope selected (Integrations > New integration > API key). On a write with a user bearer token, the user lacks the Cockpit permission the same change needs (the message names it).
Response schema
messagestring
Too Many Requests. The rate limit for this action has been exceeded. Retry after the window indicated by the Retry-After header.
Response schema
messagestring
The example could not be prepared. Try again in a moment.
Response schema
messagestring
Service Unavailable. Configuration versions are switched off on this installation, so configuration import is not available. Nothing was read or stored.
Response schema
messagestring
get https://cockpit.voxbi.com/api/v1/configuration-import/example
Base URL
Request sample
curl -X GET 'https://cockpit.voxbi.com/api/v1/configuration-import/example' \
  -H 'Authorization: Bearer YOUR_TOKEN'
const response = await fetch('https://cockpit.voxbi.com/api/v1/configuration-import/example', {
  method: 'GET',
  headers: {
    'Content-Type': 'application/json',
    'Authorization': `Bearer ${YOUR_TOKEN}`,
  },
});

const data = await response.json();
console.log(data);
import requests

response = requests.get('https://cockpit.voxbi.com/api/v1/configuration-import/example',
    headers={'Authorization': f'Bearer {YOUR_TOKEN}'}
)
response.raise_for_status()
data = response.json()
print(data)
<?php
$context = stream_context_create([
    'http' => [
        'method'  => 'GET',
        'header'  => "Content-Type: application/json\r\nAuthorization: Bearer YOUR_TOKEN",
    ],
]);

$response = file_get_contents('https://cockpit.voxbi.com/api/v1/configuration-import/example', false, $context);
$data = json_decode($response, true);
print_r($data);
No example for this status.
Content-Disposition string
The suggested file name.
example: attachment; filename=cockpit-pbx-config-example.zip
{ … }
"message": "Unauthenticated."
}
Content-Type string
example: application/json
{ … }
"message": "Invalid ability provided."
}
Content-Type string
example: application/json
{ … }
"message": "Too Many Attempts."
}
Retry-After integer
Seconds to wait before retrying.
example: 60
Content-Type string
example: application/json
{ … }
"message": "The example file could not be prepared. Try again in a moment."
}
{ … }
"message": "Configuration import is not available on this system: configuration versions are switched off."
}