POST v1/SMS/PurchasePhoneNumber?accountName={accountName}&areaCode={areaCode}

Purchases the phone number for account.

Request Information

URI Parameters

NameDescriptionTypeAdditional information
accountName

Name of the account.

string

Required

areaCode

The area code.

string

Required

Body Parameters

None.

Response Information

Resource Description

IncomingPhoneNumber
NameDescriptionTypeAdditional information
FriendlyName

string

None.

AccountSid

string

None.

SmsUrl

string

None.

PhoneNumber

string

None.

SmsMethod

string

None.

ApiVersion

string

None.

Sid

string

None.

VoiceCallerIdLookup

boolean

None.

SmsFallbackUrl

string

None.

VoiceUrl

string

None.

SmsFallbackMethod

string

None.

VoiceMethod

string

None.

SmsApplicationSid

string

None.

VoiceFallbackUrl

string

None.

VoiceApplicationSid

string

None.

DateCreated

date

None.

VoiceFallbackMethod

string

None.

AddressRequirements

string

None.

DateUpdated

date

None.

StatusCallback

string

None.

Capabilities

Capabilities

None.

StatusCallbackMethod

string

None.

RestException

RestException

None.

Uri

URI

None.

Errors

Collection of Exception

None.

IsSuccess

boolean

None.

Response Formats

application/json, text/json

Sample:
{
  "FriendlyName": "sample string 1",
  "AccountSid": "sample string 2",
  "SmsUrl": "sample string 3",
  "PhoneNumber": "sample string 4",
  "SmsMethod": "sample string 5",
  "ApiVersion": "sample string 6",
  "Sid": "sample string 7",
  "VoiceCallerIdLookup": true,
  "SmsFallbackUrl": "sample string 9",
  "VoiceUrl": "sample string 10",
  "SmsFallbackMethod": "sample string 11",
  "VoiceMethod": "sample string 12",
  "SmsApplicationSid": "sample string 13",
  "VoiceFallbackUrl": "sample string 14",
  "VoiceApplicationSid": "sample string 15",
  "DateCreated": "2021-07-31T06:19:01.9111871-07:00",
  "VoiceFallbackMethod": "sample string 17",
  "AddressRequirements": "sample string 18",
  "DateUpdated": "2021-07-31T06:19:01.9111871-07:00",
  "StatusCallback": "sample string 20",
  "Capabilities": {
    "Voice": true,
    "SMS": true,
    "MMS": true
  },
  "StatusCallbackMethod": "sample string 21",
  "RestException": {
    "Status": "sample string 1",
    "MoreInfo": "sample string 2",
    "Code": "sample string 3",
    "Message": "sample string 4"
  },
  "Uri": "http://webapihelppage22.com",
  "Errors": [
    {
      "ClassName": "System.Exception",
      "Message": null,
      "Data": null,
      "InnerException": null,
      "HelpURL": "sample string 1",
      "StackTraceString": null,
      "RemoteStackTraceString": null,
      "RemoteStackIndex": 0,
      "ExceptionMethod": null,
      "HResult": 3,
      "Source": "sample string 2",
      "WatsonBuckets": null
    },
    {
      "ClassName": "System.Exception",
      "Message": null,
      "Data": null,
      "InnerException": null,
      "HelpURL": "sample string 1",
      "StackTraceString": null,
      "RemoteStackTraceString": null,
      "RemoteStackIndex": 0,
      "ExceptionMethod": null,
      "HResult": 3,
      "Source": "sample string 2",
      "WatsonBuckets": null
    }
  ],
  "IsSuccess": true
}

application/xml, text/xml

Sample:
<TwilioModels.IncomingPhoneNumber xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://schemas.datacontract.org/2004/07/OpenTech.IssnWebApi.Web.Models.TwilioModels">
  <Errors xmlns:d2p1="http://schemas.datacontract.org/2004/07/System" xmlns="http://schemas.datacontract.org/2004/07/OpenTech.IssnWebApi.Web.Models.BindingModels">
    <d2p1:Exception>
      <ClassName xmlns:d4p1="http://www.w3.org/2001/XMLSchema" i:type="d4p1:string" xmlns="">System.Exception</ClassName>
      <Message i:nil="true" xmlns="" />
      <Data i:nil="true" xmlns="" />
      <InnerException i:nil="true" xmlns="" />
      <HelpURL xmlns:d4p1="http://www.w3.org/2001/XMLSchema" i:type="d4p1:string" xmlns="">sample string 1</HelpURL>
      <StackTraceString i:nil="true" xmlns="" />
      <RemoteStackTraceString i:nil="true" xmlns="" />
      <RemoteStackIndex xmlns:d4p1="http://www.w3.org/2001/XMLSchema" i:type="d4p1:int" xmlns="">0</RemoteStackIndex>
      <ExceptionMethod i:nil="true" xmlns="" />
      <HResult xmlns:d4p1="http://www.w3.org/2001/XMLSchema" i:type="d4p1:int" xmlns="">3</HResult>
      <Source xmlns:d4p1="http://www.w3.org/2001/XMLSchema" i:type="d4p1:string" xmlns="">sample string 2</Source>
      <WatsonBuckets i:nil="true" xmlns="" />
    </d2p1:Exception>
    <d2p1:Exception>
      <ClassName xmlns:d4p1="http://www.w3.org/2001/XMLSchema" i:type="d4p1:string" xmlns="">System.Exception</ClassName>
      <Message i:nil="true" xmlns="" />
      <Data i:nil="true" xmlns="" />
      <InnerException i:nil="true" xmlns="" />
      <HelpURL xmlns:d4p1="http://www.w3.org/2001/XMLSchema" i:type="d4p1:string" xmlns="">sample string 1</HelpURL>
      <StackTraceString i:nil="true" xmlns="" />
      <RemoteStackTraceString i:nil="true" xmlns="" />
      <RemoteStackIndex xmlns:d4p1="http://www.w3.org/2001/XMLSchema" i:type="d4p1:int" xmlns="">0</RemoteStackIndex>
      <ExceptionMethod i:nil="true" xmlns="" />
      <HResult xmlns:d4p1="http://www.w3.org/2001/XMLSchema" i:type="d4p1:int" xmlns="">3</HResult>
      <Source xmlns:d4p1="http://www.w3.org/2001/XMLSchema" i:type="d4p1:string" xmlns="">sample string 2</Source>
      <WatsonBuckets i:nil="true" xmlns="" />
    </d2p1:Exception>
  </Errors>
  <IsSuccess xmlns="http://schemas.datacontract.org/2004/07/OpenTech.IssnWebApi.Web.Models.BindingModels">true</IsSuccess>
  <AccountSid>sample string 2</AccountSid>
  <AddressRequirements>sample string 18</AddressRequirements>
  <ApiVersion>sample string 6</ApiVersion>
  <Capabilities xmlns:d2p1="http://schemas.datacontract.org/2004/07/Twilio">
    <d2p1:MMS>true</d2p1:MMS>
    <d2p1:SMS>true</d2p1:SMS>
    <d2p1:Voice>true</d2p1:Voice>
  </Capabilities>
  <DateCreated>2021-07-31T06:19:01.9111871-07:00</DateCreated>
  <DateUpdated>2021-07-31T06:19:01.9111871-07:00</DateUpdated>
  <FriendlyName>sample string 1</FriendlyName>
  <PhoneNumber>sample string 4</PhoneNumber>
  <RestException>
    <Code>sample string 3</Code>
    <Message>sample string 4</Message>
    <MoreInfo>sample string 2</MoreInfo>
    <Status>sample string 1</Status>
  </RestException>
  <Sid>sample string 7</Sid>
  <SmsApplicationSid>sample string 13</SmsApplicationSid>
  <SmsFallbackMethod>sample string 11</SmsFallbackMethod>
  <SmsFallbackUrl>sample string 9</SmsFallbackUrl>
  <SmsMethod>sample string 5</SmsMethod>
  <SmsUrl>sample string 3</SmsUrl>
  <StatusCallback>sample string 20</StatusCallback>
  <StatusCallbackMethod>sample string 21</StatusCallbackMethod>
  <Uri>http://webapihelppage22.com/</Uri>
  <VoiceApplicationSid>sample string 15</VoiceApplicationSid>
  <VoiceCallerIdLookup>true</VoiceCallerIdLookup>
  <VoiceFallbackMethod>sample string 17</VoiceFallbackMethod>
  <VoiceFallbackUrl>sample string 14</VoiceFallbackUrl>
  <VoiceMethod>sample string 12</VoiceMethod>
  <VoiceUrl>sample string 10</VoiceUrl>
</TwilioModels.IncomingPhoneNumber>