Get column mapping options for an import (user)
Returns everything the client needs to render the mapping step: the detected
file columns (each with a stable id used as column in the mapping
payload) and the allow-listed target fields a column may be mapped to. Only
these target fields are accepted when saving a mapping: no other model
attribute (e.g. private_owner_id, pbx_id, groups) can be targeted, and
nothing is auto-mapped. Only an incomplete import can be read here
(otherwise 409).
User bearer token. Default authentication for customer-facing endpoints.
Obtain a token by calling POST /login with your credentials, then send it
on every subsequent request as Authorization: Bearer <token>. The token
inherits the permissions and PBX scope of the authenticated user.
- HTTP Authorization Scheme
bearer- Bearer format
Bearer <token>
application/jsonResponses
file_columnsarray<object>
0First nametarget_fieldsarray<object>
name1First nametext relationshiptext1subfieldsarray<object>
typeenumoptionsarray<string>
Authorization Token is missingmessagearray<string>
https://cockpit.voxbi.com/api/v1/contacts/imports/{id}/mapping-options
curl -X GET 'https://cockpit.voxbi.com/api/v1/contacts/imports/{id}/mapping-options' \
-H 'Authorization: Bearer YOUR_TOKEN'
const response = await fetch('https://cockpit.voxbi.com/api/v1/contacts/imports/{id}/mapping-options', {
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/contacts/imports/{id}/mapping-options',
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/contacts/imports/{id}/mapping-options', false, $context);
$data = json_decode($response, true);
print_r($data);
{ … }
"file_columns": [ … ],
{ … },
{ … },
{ … }
"target_fields": [ … ]
{ … },
{ … }
"subfields": [ … ]
{ … }
"options": [ … ]
{ … }
private, must-revalidatekeep-aliveapplication/jsonOrigin6057{ … }
"message": [ … ]
private, must-revalidatekeep-aliveapplication/jsonOrigin6057{ … }
application/json