Import Emergency Numbers
Import emergency numbers from a CSV file.
Request URL
POST {base_url}/{api_path}/emergency_number/import?access_token={access_token}
Request parameters
| Parameter | Required | Type | Description |
|---|---|---|---|
| file | Yes | File | The CSV file to import. The file must be UTF-8 encoded (with BOM), and its columns must match the emergency number import template: Name, Emergency Number, Emergency Outbound Caller ID Priority, Trunk, Trunk's Emergency Outbound Caller ID, Strip, Prepend for Emergency Number, Emergency Number Extension Scope, and Extensions/Extension Groups. |
| format | Yes | String | The format of the import file. The value is fixed as csv. |
Response parameters
| Parameter | Type | Description |
|---|---|---|
| errcode | Integer | Returned error code.
Note: You can check the error code and
error message in Error Code and Error Message.
|
| errmsg | String | Returned message.
|
| download_resource_url | String | The download URL of the import result file, which contains the failure reason
of each row. Note: This URL is returned only when some rows
fail or all rows fail. |
Example
Request example
POST /openapi/v1.0/emergency_number/import?access_token=lweYFZuwsgSrhFOKC3Z0XmDRXfbPohi6 HTTP/1.1
Host: yeastardocs.example.yeastarcloud.com
Content-Type: multipart/form-data
--multipart-boundary
Content-Disposition: form-data; name="file"; filename="emergency_number.csv"
Content-Type: text/csv
Name,Emergency Number,Emergency Outbound Caller ID Priority,Trunk,Trunk's Emergency Outbound Caller ID,Strip,Prepend for Emergency Number,Emergency Number Extension Scope,Extensions/Extension Groups
API Test Import,9117,ext_first,BRI1-1,5500123,0,9,All Extensions,
--multipart-boundary
Content-Disposition: form-data; name="format"
csv
--multipart-boundary--
Response example
HTTP/1.1 200 OK
{
"errcode": 0,
"errmsg": "SUCCESS"
}