Skip to content
V2 (Legacy) API ReferenceGet started

List phone numbers (deprecated)

Deprecated
client.Phonenumbers.List(ctx) (*PhonenumberListResponse, error)
GET/v3/phonenumbers

Deprecated. Use GET /v3/phone_numbers instead.

ReturnsExpand Collapse
type PhonenumberListResponse struct{…}
PhoneNumbers []PhonenumberListResponsePhoneNumber

List of phone numbers assigned to the partner

ID string

Unique identifier for the phone number

formatuuid
PhoneNumber string

Phone number in E.164 format

Capabilities PhonenumberListResponsePhoneNumberCapabilitiesOptional
Mms bool

Whether MMS messaging is supported

SMS bool

Whether SMS messaging is supported

Voice bool

Whether voice calls are supported

CountryCode stringOptional

Deprecated. Always null.

Type stringOptional

Deprecated. Always null.

List phone numbers (deprecated)

package main

import (
  "context"
  "fmt"

  "github.com/linq-team/linq-go"
  "github.com/linq-team/linq-go/option"
)

func main() {
  client := linqgo.NewClient(
    option.WithAPIKey("My API Key"),
  )
  phonenumbers, err := client.Phonenumbers.List(context.TODO())
  if err != nil {
    panic(err.Error())
  }
  fmt.Printf("%+v\n", phonenumbers.PhoneNumbers)
}
{
  "phone_numbers": [
    {
      "id": "550e8400-e29b-41d4-a716-446655440000",
      "phone_number": "+12025551234",
      "capabilities": {
        "mms": true,
        "sms": true,
        "voice": false
      },
      "country_code": "US",
      "type": null
    }
  ]
}
{
  "error": {
    "status": 401,
    "code": 2004,
    "message": "Unauthorized - missing or invalid authentication token"
  },
  "success": false
}
{
  "error": {
    "status": 500,
    "code": 3006,
    "message": "Internal server error"
  },
  "success": false
}
Returns Examples
{
  "phone_numbers": [
    {
      "id": "550e8400-e29b-41d4-a716-446655440000",
      "phone_number": "+12025551234",
      "capabilities": {
        "mms": true,
        "sms": true,
        "voice": false
      },
      "country_code": "US",
      "type": null
    }
  ]
}
{
  "error": {
    "status": 401,
    "code": 2004,
    "message": "Unauthorized - missing or invalid authentication token"
  },
  "success": false
}
{
  "error": {
    "status": 500,
    "code": 3006,
    "message": "Internal server error"
  },
  "success": false
}