Create connection policy target
Network element entry points into your communications infrastructure
Path parameters
-
The SID of the Connection Policy that owns the Target.
Minimum length is
34
, maximum length is34
. Format should match the following pattern:^NY[0-9a-fA-F]{32}$
.
Body
-
The SIP address you want Twilio to route your calls to. This must be a
sip:
schema.sips
is NOT supported. -
A descriptive string that you create to describe the resource. It is not unique and can be up to 255 characters long.
-
The relative importance of the target. Can be an integer from 0 to 65535, inclusive, and the default is 10. The lowest number represents the most important target.
-
The value that determines the relative share of the load the Target should receive compared to other Targets with the same priority. Can be an integer from 1 to 65535, inclusive, and the default is 10. Targets with higher values receive more load than those with lower ones with the same priority.
-
Whether the Target is enabled. The default is
true
.
curl \
--request POST 'https://voice.twilio.com/v1/ConnectionPolicies/{ConnectionPolicySid}/Targets' \
--user "username:password" \
--header "Content-Type: application/x-www-form-urlencoded" \
--data 'Target=sip%3Asip-box.com%3A1234&Weight=20&Enabled=true&Priority=1&FriendlyName=friendly_name'
{"Target"=>"sip:sip-box.com:1234", "Weight"=>20, "Enabled"=>true, "Priority"=>1, "FriendlyName"=>"friendly_name"}
{
"sid": "NEaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
"url": "https://voice.twilio.com/v1/ConnectionPolicies/NYaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Targets/NEaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
"target": "sip:sip-box.com:1234",
"weight": 20,
"enabled": true,
"priority": 1,
"account_sid": "ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
"date_created": "2020-03-18T23:31:36Z",
"date_updated": "2020-03-18T23:31:36Z",
"friendly_name": "friendly_name",
"connection_policy_sid": "NYaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"
}