api:pbx:phonebook:upload
Table of Contents
API : PBX : Phonebook Upload
Request
This request will create multiple contacts in a request. At the moment it only supports Excel-files (.xlsx), following this template:
| URL | https://api.telecomx.dk/pbx/phonebook/upload | ||
|---|---|---|---|
| Method | POST | ||
| Access level | PERSONAL if contact is personal or shared, VIEWER, MANAGER, OWNER, RESELLER or ADMIN if contact is shared. | ||
| Query | customer | Id | Id of the contact (24 hex-char string). |
| personal | Boolean | True if the contacts should be personal, false if contacts should be shared. | |
| type | String | Type of uploaded file (currently only supports 'xlsx') | |
| Body | file | file | File to import contacts from, currently only supports excel |
Response
| JSON object | ||
|---|---|---|
| success | Boolean | True on success |
Example
{ success: true }
Errors
When any of the rows return an error, the request as a whole responds with an error, and an error object containing all the errors. The [x] in the error code below will contain the row index of the uploaded Excel-file.
| Error code | Message | Description |
|---|---|---|
| 400 | customer | No customer provided |
| 403 | personal | Invalid customer for personal contacts |
| 422 | name[x] | Either givenName has to be specified, or companyName |
| 422 | addresses[x].address | Address invalid - either all address properties must be defined, or none |
| 422 | addresses[x].country | Country code invalid |
| 422 | main_number[x] | [number] is not a valid phone number |
| 422 | work_number[x] | [number] is not a valid phone number |
| 422 | mobile_number[x] | [number] is not a valid phone number |
| 422 | emailAddresses[x].address | Missing or invalid e-mail address |
| 403 | access_denied | Insufficient access level |
| 403 | access_denied | Minimum access level required is manager to upload shared contacts |
| 500 | internal_error | <Unspecified> |
api/pbx/phonebook/upload.txt · Last modified: 2022/02/08 12:43 by Per Møller