Docs

Create new trunks

https://api.apifonica.com/v2/accounts/{accountSID}/trunks

Overview

To create a new trunks you need to make a POST request to /accounts/{accountSID}/trunks.

The table below lists parameters specified while making this request

INPUT PARAMETERS

ParameterRequiredDescriptionDefault Value
name
yes

name of the trunks

none
ip
yes

IP address of your PBX

none
default_number_sid
yes

SID of the rented number that will be used as a default number for outgoing calls

none

Request example

The following example demonstrates creating an Trunks with the TestTrunks name.

curl –X POST https://api.apifonica.com/v2/accounts/{accountSID}/trunks \
-H 'Content-Type: application/json' \
-d '{
      "name": ”TestTrunks",
      "ip": "192.168.1.1"
      "default_number_sid":"num388ce423-9d2b-3859-9057-3f727f9232fa"
    }' \
-u {accountSID}:{authToken}

Response example

{
   "limit": 20,
   "prev": null,
   "next": null,
   "trunks": [
   {
      "trunk_sid": "trnc0853281-f249-373a-9252-5adef69fb6b0",
      "account_sid": "accd987b8f1-ed12-3158-8a23-59026c0c86e2",
      "name": "TestTrunk",
      "ip": "192.168.1.1",
      "default_number_sid": "num388ce423-9d2b-3859-9057-3f727f9232fa",
      "created": "Tue, 31 Mar 2020 10:02:44 +0000",
      "updated": "Tue, 31 Mar 2020 10:02:44 +0000"
   }
   ]
}