Create Trunk Group#
Description
Creates a Trunk Group.
Request#
HTTP Method: POST
URI Path: /v3/trunk_groups
URI Query Parameters:
Name |
Type |
Is Required? |
Description |
|---|---|---|---|
include |
|
Optional |
Request Body Object Attributes:
Name |
Type |
Nullable |
Is Required? |
Description |
|---|---|---|---|---|
name |
|
False |
Yes |
Unique name of the Trunk Group. |
capacity_limit |
|
False |
Optional |
Maximum number of simultaneous calls for the Trunk Group. |
Request Body Object Relationships:
Title |
Type |
Description |
|---|---|---|
trunks |
To many | Linkage for included trunks. |
|
Examples#
http
1POST /v3/trunk_groups HTTP/1.1
2Host: api.didww.com
3Content-Type: application/vnd.api+json
4Accept: application/vnd.api+json
5Api-Key: [API token]
6
7{
8 "data": {
9 "type": "trunk_groups",
10 "attributes": {
11 "name": "Main group",
12 "capacity_limit": 100
13 }
14 }
15}
curl
1curl -i -X POST https://api.didww.com/v3/trunk_groups -H "Accept: application/vnd.api+json" -H "Api-Key: [API token]" -H "Content-Type: application/vnd.api+json" --data-raw '{"data": {"attributes": {"capacity_limit": 100, "name": "Main group"}, "type": "trunk_groups"}}'
response
1HTTP/1.1 201 Created
2Content-Type: application/vnd.api+json
3
4{
5 "data": {
6 "id": "a6370df6-86db-4a1a-9a54-3742f1d8615c",
7 "type": "trunk_groups",
8 "attributes": {
9 "created_at": "2017-06-25T14:56:31.513Z",
10 "name": "Main group",
11 "capacity_limit": 100
12 },
13 "relationships": {
14 "trunks": {
15 "links": {
16 "self": "https://api.didww.com/v3/trunk_groups/a6370df6-86db-4a1a-9a54-3742f1d8615c/relationships/trunks",
17 "related": "https://api.didww.com/v3/trunk_groups/a6370df6-86db-4a1a-9a54-3742f1d8615c/trunks"
18 }
19 }
20 },
21 "meta": {
22 "trunks_count": 0
23 }
24 },
25 "meta": {
26 "api_version": "2017-09-18"
27 }
28}
http
1POST /v3/trunk_groups HTTP/1.1
2Host: api.didww.com
3Content-Type: application/vnd.api+json
4Accept: application/vnd.api+json
5Api-Key: [API token]
6
7{
8 "data": {
9 "type": "trunk_groups",
10 "attributes": {
11 "name": "Main group",
12 "capacity_limit": 100
13 },
14 "relationships": {
15 "trunks": {
16 "data": [
17 {
18 "type": "trunks",
19 "id": "b7a9d1ce-6a89-4071-bc0d-486ee223787d"
20 },
21 {
22 "type": "trunks",
23 "id": "7ca415f8-8342-427a-bbfc-171b995f75d6"
24 },
25 {
26 "type": "trunks",
27 "id": "46aa9cac-a8dd-4a06-82db-cb0731e53ba0"
28 }
29 ]
30 }
31 }
32 }
33}
curl
1curl -i -X POST https://api.didww.com/v3/trunk_groups -H "Accept: application/vnd.api+json" -H "Api-Key: [API token]" -H "Content-Type: application/vnd.api+json" --data-raw '{"data": {"attributes": {"capacity_limit": 100, "name": "Main group"}, "relationships": {"trunks": {"data": [{"type": "trunks", "id": "b7a9d1ce-6a89-4071-bc0d-486ee223787d"}, {"type": "trunks", "id": "7ca415f8-8342-427a-bbfc-171b995f75d6"}, {"type": "trunks", "id": "46aa9cac-a8dd-4a06-82db-cb0731e53ba0"}]}}, "type": "trunk_groups"}}'
response
1HTTP/1.1 201 Created
2Content-Type: application/vnd.api+json
3
4{
5 "data": {
6 "id": "faea735d-ba77-40ef-bf13-f4dfc0f43a68",
7 "type": "trunk_groups",
8 "attributes": {
9 "created_at": "2017-06-25T14:56:31.513Z",
10 "name": "Main group",
11 "capacity_limit": 100
12 },
13 "relationships": {
14 "trunks": {
15 "links": {
16 "self": "https://api.didww.com/v3/trunk_groups/faea735d-ba77-40ef-bf13-f4dfc0f43a68/relationships/trunks",
17 "related": "https://api.didww.com/v3/trunk_groups/faea735d-ba77-40ef-bf13-f4dfc0f43a68/trunks"
18 }
19 }
20 },
21 "meta": {
22 "trunks_count": 3
23 }
24 },
25 "meta": {
26 "api_version": "2017-09-18"
27 }
28}
http
1POST /v3/trunk_groups?include=trunks HTTP/1.1
2Host: api.didww.com
3Content-Type: application/vnd.api+json
4Accept: application/vnd.api+json
5Api-Key: [API token]
6
7{
8 "data": {
9 "type": "trunk_groups",
10 "attributes": {
11 "name": "Main group",
12 "capacity_limit": 100
13 },
14 "relationships": {
15 "trunks": {
16 "data": [
17 {
18 "type": "trunks",
19 "id": "1dcbcdae-4ad6-4c42-acc3-b4ec097dd2f7"
20 },
21 {
22 "type": "trunks",
23 "id": "c606cd05-a19f-4d3c-9362-3857a79a6e1d"
24 }
25 ]
26 }
27 }
28 }
29}
curl
1curl -i -X POST 'https://api.didww.com/v3/trunk_groups?include=trunks' -H "Accept: application/vnd.api+json" -H "Api-Key: [API token]" -H "Content-Type: application/vnd.api+json" --data-raw '{"data": {"attributes": {"capacity_limit": 100, "name": "Main group"}, "relationships": {"trunks": {"data": [{"type": "trunks", "id": "1dcbcdae-4ad6-4c42-acc3-b4ec097dd2f7"}, {"type": "trunks", "id": "c606cd05-a19f-4d3c-9362-3857a79a6e1d"}]}}, "type": "trunk_groups"}}'
response
1HTTP/1.1 201 Created
2Content-Type: application/vnd.api+json
3
4{
5 "data": {
6 "id": "3b49216d-ccb0-4376-b9fa-a43ffcb48c35",
7 "type": "trunk_groups",
8 "attributes": {
9 "created_at": "2017-08-16T14:04:36.013Z",
10 "name": "Main group",
11 "capacity_limit": 100
12 },
13 "relationships": {
14 "trunks": {
15 "links": {
16 "self": "https://api.didww.com/v3/trunk_groups/3b49216d-ccb0-4376-b9fa-a43ffcb48c35/relationships/trunks",
17 "related": "https://api.didww.com/v3/trunk_groups/3b49216d-ccb0-4376-b9fa-a43ffcb48c35/trunks"
18 },
19 "data": [{
20 "type": "trunks",
21 "id": "1dcbcdae-4ad6-4c42-acc3-b4ec097dd2f7"
22 },
23 {
24 "type": "trunks",
25 "id": "c606cd05-a19f-4d3c-9362-3857a79a6e1d"
26 }
27 ]
28 }
29 },
30 "meta": {
31 "trunks_count": 2
32 }
33 },
34 "included": [{
35 "data": {
36 "id": "1dcbcdae-4ad6-4c42-acc3-b4ec097dd2f7",
37 "type": "trunks",
38 "attributes": {
39 "priority": 1,
40 "capacity_limit": 2,
41 "weight": 65535,
42 "name": "Office PSTN",
43 "cli_format": "e164",
44 "cli_prefix": null,
45 "description": null,
46 "ringing_timeout": null,
47 "configuration": {
48 "type": "pstn_configurations",
49 "attributes": {
50 "dst": "18337249999"
51 ]
52 }
53 }
54 },
55 "relationships": {
56 "trunk_group": {
57 "links": {
58 "self": "https://api.didww.com/v3/trunks/1dcbcdae-4ad6-4c42-acc3-b4ec097dd2f7/relationships/trunk_group",
59 "related": "https://api.didww.com/v3/trunks/1dcbcdae-4ad6-4c42-acc3-b4ec097dd2f7/trunk_group"
60 }
61 }
62 }
63 }
64 },
65 {
66 "data": {
67 "id": "c606cd05-a19f-4d3c-9362-3857a79a6e1d",
68 "type": "trunks",
69 "attributes": {
70 "priority": 1,
71 "capacity_limit": 18,
72 "weight": 65535,
73 "name": "Office sip",
74 "cli_format": "e164",
75 "cli_prefix": "+1",
76 "description": null,
77 "ringing_timeout": null,
78 "configuration": {
79 "type": "sip_configurations",
80 "attributes": {
81 "dst": "1xxxxxxxxx",
82 "host": "example.com",
83 "port": null,
84 "codec_ids": [
85 9,
86 6
87 ]
88 }
89 }
90 },
91 "relationships": {
92 "trunk_group": {
93 "links": {
94 "self": "https://api.didww.com/v3/trunks/c606cd05-a19f-4d3c-9362-3857a79a6e1d/relationships/trunk_group",
95 "related": "https://api.didww.com/v3/trunks/c606cd05-a19f-4d3c-9362-3857a79a6e1d/trunk_group"
96 }
97 }
98 }
99 }
100 }
101 ],
102 "meta": {
103 "api_version": "2017-09-18"
104 }
105}
Other Responses#
Code |
Success |
Description |
|---|---|---|
422 |
No |
|
401 |
No |