Loading...

Description

This endpoint will search for and request a new telephone number. You many search for a phone number using this endpoint, which will orders the first X quantity of numbers requested. SearchBy indicates how you wish for the pattern field to be interpreted: 0) None -- The pattern is ignored and a random list of numbers will be returned. 1) AreaCode -- The pattern indicates a NANP area code to search with in. (E.g. "512") 2) CityState -- The pattern indicates a city state to search within. (E.g. "Austin, TX") 3) ZipCode -- The pattern is a 5 digit US zip code to search within. (E.g. "78746") 10) SearchId -- The pattern is a search ID to use from a previous call to search-for-tn.


Request URL

POST   https://api.3seventy.com/api/v2.1/account/{accountId}/request-tn

Request Properties

Parameter Description Mandatory
accountId Account ID making the request. Yes
Quantity How many phone numbers to search for. Yes
Pattern The search pattern to use when looking for an available number. Yes
OrderBy How we should interpret the search pattern. Yes

Response Properties

Property Description
Id The ID of the order.
Quantity The number of phone numbers requested.
Pattern The search pattern used for provisioning this order.
OrderBy The type of order that is being provisioned.
OrderStatus The current status of the order
PhoneNumbers List of phone numbers that have been provisioned so far.

C#
PHP


using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Linq;
using ThreeSeventy.Vector.Client;
using ThreeSeventy.Vector.Client.Enums;
using ThreeSeventy.Vector.Client.Models;

public class Program
{

private static void Main(string[] args)
{

const int accountId = XXXX;

var context = new T70Context();

var requestTnRepo = context.Repository<RequestTn>(new { AccountId = accountId });

var item = new RequestTn()

{

AccountId = accountId,

OrderBy = OrderBy.AreaCode,

Pattern = "XXX",

Quantity = 1

};

requestTnRepo.Add(item);

}

}

 

Stay tuned for JAVA code snippet
Stay tuned for RUBY code snippet
Stay tuned for PHP code snippet