TSG Global API Documentation
  • Get Started
  • ISO/IEC/SOC Certification
  • Staging Environment Access
  • API Reference
    • Programmable SMS
      • Send an SMS Message
      • Receive an SMS Message
      • Delivery Receipts (DLRs)
      • SMPP
        • Headers
        • Errors
    • Programmable MMS
      • Send an MMS Message
      • Receive an MMS Message
      • Receive DLRs
      • SMTP
    • Phone Numbers
      • Search For New Available Numbers
      • Add Number to Cart
      • Get Reserved Numbers In Cart
      • Remove Reserved Number From Cart
      • Checkout Numbers in Cart
      • Disconnect Number
      • Get Number Information
      • Manage Number for SMS & 10DLC
        • Enable SMS/10DLC on a Number
        • Disable SMS on a Number
        • Update inbound SMS webhook/URI
      • Manage Number for MMS
        • Enable MMS on a Number
        • Disable MMS on a Number
        • Update inbound MMS webhook/URI
      • Manage Number for Voice
        • List Destination Priority
        • Add Destination Priority
        • Update Destination Priority
        • Delete Destination Priority
      • Protect your phone number
        • TextProtect Webhook
      • Toll-free phone numbers - search & ordering
    • Data Services
      • CNAM Lookup
      • Lookup SMS Carrier
    • Reports
      • CDR Records
        • Get Count of CDR Records
        • Get CDR Records
    • Compliance & Identity
      • Business Identity & 10DLC (TNID v1)
      • Toll-Free Verified Sender (Order)
      • Short Code Submission (Order)
  • GraphQL API & Authentication
Powered by GitBook
On this page
  • Overview
  • Authentication
  • Method
  • Add a destination priority associated with a phone number.
  • Example POST (PSTN)
  • Example POST (VOIP)
  • Error Codes

Was this helpful?

  1. API Reference
  2. Phone Numbers
  3. Manage Number for Voice

Add Destination Priority

Overview

This method lets you update the voice destination priority for phone numbers.

Authentication

Authentication is done by passing your TSG Global API key via the Authorization header in the format "Authorization: Bearer <api_key>"

Method

Add a destination priority associated with a phone number.

POST https://api-service.tsgglobal.world/v1/did/priority

Request Body

Name
Type
Description

did*

String

The phone number (e.g. 12022011234)

priority*

String

1-3 in order of preferred priority.

destination*

String

192.168.1.1 (for VOIP), 16352321233 (for PSTN)

call_type*

String

VOIP, PSTN

call_option

String

WP, NP

For VOIP Call Type you need to enter just the IP Address of the Gateway and we will format the rest of the destination. For PSTN Call Type you need to just enter the PSTN Destination in e.164 format or e.164 (-) the Plus.

Type must only contain one of the following VOIP = VOIP Destination | PSTN = PSTN Destination (This is case sensitive.)

NP = VOIP DID Sent to Gateway with out plus | WP = VOIP DID Sent to Gateway with plus. (This is case sensitive.)

Example POST (PSTN)

curl -n https://api-service.tsgglobal.world/v1/did/priority -XPOST -H "Authorization: Bearer <api_key>" \
-H "Content-Type: application/json" -d '{
  "did": "12003004000",
  "destination": "16352321233",
  "priority": 2,
  "call_type": "PTSN",
  "call_option": "NP"
}'

Example POST (VOIP)

curl -n https://api-service.tsgglobal.world/v1/did/priority -XPOST -H "Authorization: Bearer <api_key>" \
-H "Content-Type: application/json" -d '{
  "did": "12003004000",
  "destination": "192.168.1.1",
  "priority": 3,
  "call_type": "VOIP",
  "call_option": "NP"
}'

Error Codes

  • -1000 Invalid or Blank API Key

  • -1001 Invalid or Blank Call Option

  • -1003 Invalid or No DID Provided

  • -1004 Invalid or No Priority Provided

  • -1005 Invalid or No Destination Provided

  • -1006 Invalid or No Call Type Provided

  • -1007 Priority Already Exists Use Another Priority

  • -1008-V Priority Added to Database as VoIP Destination

  • -1008-P Priority Added to Database as PSTN Destination

  • -1010 Unknown Error Please Contact TSG Support with URL String for Review

PreviousList Destination PriorityNextUpdate Destination Priority

Last updated 2 years ago

Was this helpful?