Add a Route to Route Set
/{versionId}/routeSets/{routeSetId}/entries
Request
-
routeSetId(required):
The route set id to which route needs to be added.
-
versionId(required):
The rest api version, it's value is v1.3.
Response
200 Response
400 Response
401 Response
403 Response
404 Response
500 Response
Examples
Examples of Accessing the API
See Authenticate for how to acquire a session cookie.
The following example shows how to add a route to route set using curl.
curl -X POST \
-b sessionid.txt \
--header "Accept: application/xml" \
--header "Content-Type: application/xml" \
"https://example.com:8443/rest/v1.3/routeSets/{routeSetId}/entries"
The following example shows how to add a route to route set using Python.
import requests
from lxml import etree
url = "https://example.com:8443/rest/v1.3/routeSets/{routeSetId}/entries"
headers = { "Accept":"application/xml", "Content-Type: application/xml", "Cookie":cookie }
data = etree.tostring(etree.parse("request.json"))
resp = requests.post(url, headers=headers, data=data)
Example of the Request Body
The following example shows the contents of the request body in XML.
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<routeSetEntry>
<pubId>12345689</pubId>
<pUser1>admin</pUser1>
<pUser2>admin1</pUser2>
<sed>ThirdaddtestentryRestAPIEnonmpty</sed>
<destinationGroup>xxx</destinationGroup>
<description>LastnonEmptyDescEntered</description>
<nextHop>xxx</nextHop>
<trunkGroup>xxx</trunkGroup>
<trunkContext>xxx</trunkContext>
<routingNum>33</routingNum>
<carrierIdCode>22</carrierIdCode>
<user1>u1</user1>
<user2>xxx</user2>
<user3>xxx</user3>
<user4>xxx</user4>
<user5>xxx</user5>
<sedFormula></sedFormula>
</routeSetEntry>
No JSON example has been provided.
Example of the Response Body
The following example shows the contents of the response body in XML.
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<routeSetEntry>
<carrierIdCode>22</carrierIdCode>
<description>LastnonEmptyDescEntered</description>
<destinationGroup>xxx</destinationGroup>
<format></format>
<nextHop>xxx</nextHop>
<npa></npa>
<nxx></nxx>
<objectId>ID1</objectId>
<priority></priority>
<pubId>12345689</pubId>
<pubIdFormula></pubIdFormula>
<routingNum>33</routingNum>
<sed>ThirdaddtestentryRestAPIEnonmpty</sed>
<sedFormula></sedFormula>
<trunkContext>xxx</trunkContext>
<trunkGroup>xxx</trunkGroup>
<user1>u1</user1>
<user2>xxx</user2>
<user3>xxx</user3>
<user4>xxx</user4>
<user5>xxx</user5>
<weight></weight>
<pUser1>admin</pUser1>
<pUser2>admin1</pUser2>
</routeSetEntry>
No JSON example has been provided.
Example for Range Type RouteSet
This example shows the request and response available in NNC 9.0.2 and later.
An example XML request body:
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<routeSetEntry>
<rangeStart>100</rangeStart>
<rangeEnd>110</rangeEnd>
<sed>abcde</sed>
<destinationGroup>xxx</destinationGroup>
<description>LastnonEmptyDescEntered</description>
<nextHop>xxx</nextHop>
<trunkGroup>xxx</trunkGroup>
<trunkContext>xxx</trunkContext>
<routingNum>33</routingNum>
<carrierIdCode>22</carrierIdCode>
<user1>u1</user1>
<user2>xxx</user2>
<user3>xxx</user3>
<user4>xxx</user4>
<user5>xxx</user5>
<sedFormula></sedFormula>
</routeSetEntry>
An example JSON request body:
{
"rangeStart":"12345",
"rangeEnd":"12358",
"sed": "SED2",
"destinationGroup": "xxx",
"description": "Test",
"nextHop": "xxx",
"trunkGroup": "xxx",
"trunckContext": "xxx",
"routingNum": "33",
"carrierIdCode": "22",
"user1": "u1"
}
An example XML response:
<routeSetEntry>
<carrierIdCode>22</carrierIdCode>
<description>LastnonEmptyDescEntered</description>
<destinationGroup>xxx</destinationGroup>
<format></format>
<nextHop>xxx</nextHop>
<objectId>ID3</objectId>
<priority></priority>
<rangeEnd>110</rangeEnd>
<rangeStart>100</rangeStart>
<routingNum>33</routingNum>
<sed>abcde</sed>
<sedFormula></sedFormula>
<trunkContext>xxx</trunkContext>
<trunkGroup>xxx</trunkGroup>
<user1>u1</user1>
<user2>xxx</user2>
<user3>xxx</user3>
<user4>xxx</user4>
<user5>xxx</user5>
<weight></weight>
</routeSetEntry>
An example JSON response:
{
"carrierIdCode": "22",
"description": "Test",
"destinationGroup": "xxx",
"format": "",
"nextHop": "xxx",
"objectId": "ID2",
"priority": "",
"rangeEnd": "12358",
"rangeStart": "12345",
"routingNum": "33",
"sed": "SED2",
"sedFormula": "",
"trunkContext": "",
"trunkGroup": "xxx",
"user1": "u1",
"user2": "",
"user3": "",
"user4": "",
"user5": "",
"weight": ""
}