Update SIP Trunk - API
This API allows you to update a SIP trunk by providing the trunk ID and updated fields.
HTTP method and endpoint
PUT
|
https://api.videosdk.live/v2/sip-trunk/:idHeaders Parameters
REQUIRED
values : YOUR_TOKEN_WITHOUT_ANY_PREFIX
This will be a JWT token generate using VideoSDK ApiKey and Secret.
Note that the token will not include any prefix such as "Basic " or "Bearer ". Just pass a token as value.
You can generate a new token by refering this Guide: Generate Auth token
REQUIRED
values : application/json
This is usefull for json body parameters, so that VideoSDK servers can understand that the incoming body parameter will be a JSON string.
Parameters
REQUIRED
trunkId
of the SIP trunk. Body Parameters
REQUIRED
- auth: Object
- username: string
- password: string
REQUIRED
Name of the SIP Trunk.
REQUIRED
Domain of the SIP Trunk.
REQUIRED
Trunk direction — 'inbound' or 'outbound'.
REQUIRED
Array of phone numbers assigned to the trunk.
PUT
|
https://api.videosdk.live/v2/sip-trunk/:id
NodeJS
import fetch from 'node-fetch';
const options = {
method: "PUT",
headers: {
"Authorization": "Bearer $YOUR_TOKEN",
"Content-Type": "application/json",
},
};
const url= `https://api.videosdk.live/v2/sip-trunk/:id`;
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
RESPONSE
{
"trunkId": "SqlZqn1U1ezvhWGRek6ow",
"auth": {
"username": "newUser",
"password": "newPassword"
},
"name": "updatedTwilio",
"domain": "updated.example.com",
"direction": "inbound",
"numbers": [
"+1987654321"
]
}
Got a Question? Ask us on discord