Saltar al contenido principal
PATCH
/
v1
/
phone
/
{phone_id}
/
sip-config
Update Sip Config
import requests

url = "https://api.diga.io/v1/phone/{phone_id}/sip-config"

payload = {
    "inbound_config": { "allowed_addresses": ["<string>"] },
    "outbound_config": {
        "termination_uri": "<string>",
        "username": "<string>",
        "password": "<string>"
    }
}
headers = {
    "Authorization": "Bearer <token>",
    "Content-Type": "application/json"
}

response = requests.patch(url, json=payload, headers=headers)

print(response.text)
{
  "id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
  "number": "<string>",
  "nickname": "<string>",
  "released_at": "2023-11-07T05:31:56Z",
  "scheduled_release_at": "2023-11-07T05:31:56Z",
  "assigned_at": "2023-11-07T05:31:56Z",
  "inbound_agent_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
  "outbound_agent_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
  "sip_config": {
    "termination_uri": "<string>",
    "username": "<string>",
    "inbound_media_encryption": "allow",
    "outbound_media_encryption": "allow",
    "allowed_addresses": [
      "<string>"
    ]
  }
}

Autorizaciones

Authorization
string
header
requerido

Bearer authentication header of the form Bearer <token>, where <token> is your auth token.

Parámetros de ruta

phone_id
string<uuid>
requerido

Cuerpo

application/json
inbound_config
InboundConfigUpdateSchema · object | null

Incoming call configuration fields to update

outbound_config
OutboundConfigUpdateSchema · object | null

Outgoing call configuration fields to update

Respuesta

Successful Response

id
string<uuid>
requerido

Unique identifier for the phone register record

number
string
requerido

The phone number or SIP identifier

telephony_provider
enum<string>
requerido

The telephony provider (NETELIP for purchased numbers, CUSTOM for imported numbers)

Opciones disponibles:
netelip,
custom
status
enum<string>
requerido

Current status of the phone register (RESERVED, ASSIGNED, RELEASED, FINISHED)

Opciones disponibles:
reserved,
assigned,
released,
finished
nickname
string | null

The nickname given to the phone number

released_at
string<date-time> | null

The date and time when the phone was released

scheduled_release_at
string<date-time> | null

The date and time when the phone is scheduled to be released. If set, the phone will be released at this time at the end of the billing period.

assigned_at
string<date-time> | null

The date and time when the phone was assigned

inbound_agent_id
string<uuid> | null

The unique identifier for the agent that will receive the call when this phone receives an inbound call

outbound_agent_id
string<uuid> | null

The unique identifier for the agent that will make the calls when using this phone to make outbound calls

sip_config
SipConfigResponseSchema · object | null

SIP trunk configuration details (only for custom/imported phones)