Latest Legacy

Retrieve a number

Retrieves the details of the specified number from the specified number pool.

API Endpoint

GET https://api.plivo.com/v1/Account/{auth_id}/NumberPool/{number_pool_uuid}/{number}/

Arguments

No arguments need to be passed.

Returns

This API call returns the details for the number identified by the number specified in the request URL.

Response

HTTP Status Code: 200

{
    "account_phone_number_resource": "/v1/Account/{auth_id}/Number/{your_number}/",
    "added_on": "2022-10-09T11:24:35.085797Z",
    "api_id": "612982e8-0a87-11ea-b072-0242ac110007",
    "country_iso2": "CA",
    "number": "{your_number}",
    "number_pool_uuid": "{number_pool_uuid}",
    "type": "fixed"
}

Example Request

1
2
3
4
5
6
import plivo
import json

client = plivo.RestClient('<auth_id>','<auth_token>')
powerpack = client.powerpacks.get(uuid="powerpack_uuid")
print str(powerpack.find_number('your-number'))
1
2
3
4
5
6
7
8
9
10
11
12
13
14
require 'rubygems'
require 'plivo'
include Plivo
include Plivo::Exceptions

api = RestClient.new("<auth_id>","<auth_token>")
begin
  powerpack = api.powerpacks.get(uuid='powerpack_uuid')
  puts powerpack
  response = powerpack.find_number(number='your_number')
  puts response
rescue PlivoRESTError => e
  puts 'Exception: ' + e.message
end
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
var plivo = require('plivo');
var client = new plivo.Client("<auth_id>","<auth_token>");

client.powerpacks.get("0166c910-1268-47c7-bf30-f5809ee843b9").then(
   function (powerpack) {
     return powerpack.find_number(
     "<your_number>"
     )
   })
 .then(function (result) {
   console.log(result)
 })
 .catch(function (response) {
   console.log(response);
 });
1
2
3
4
5
6
7
8
9
10
11
12
13
14
<?php
require 'vendor/autoload.php';
use Plivo\RestClient;

$client = new RestClient("<auth_id>","<auth_token>");
$client->client->setTimeout(40);
try {
    $powerpack = $client->powerpacks->get("your-powerpack-uuid");
    $response = $powerpack->find_number('your_number');
    print_r($response);
}
catch (PlivoRestException $ex) {
    print_r($ex);
}
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
package com.plivo.api;

import com.plivo.api.models.powerpack.Numbers;
import com.plivo.api.models.powerpack.Powerpack;
import com.plivo.api.exceptions.PlivoRestException;

import java.io.IOException;

public class PowerpackTest {
  public static void main(String[] args) {
    Plivo.init("<auth_id>", "<auth_token>");
    try {
      Powerpack powerpack = Powerpack.getter("powerpack_uuid").get();
      Numbers response = powerpack.find_number().number("<your_number>").get();
      System.out.println(response);
    }
    catch (  PlivoRestException | IOException e ) {
      e.printStackTrace();
    }
  }
}
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
using System;
using Plivo;
using Plivo.Exception;
using System.Collections.Generic;

namespace test_apps
{
    class Program
    {
        static void Main(string[] args)
        {
            var api = new PlivoApi("<auth_id>","<auth_token>");
            try
            {
                var response = api.Powerpacks.Get("powerpack_uuid");
                Console.WriteLine(response.Find_Number("<your_number>"));
            }
            catch (PlivoRestException e)
            {
                Console.WriteLine("Exception: " + e.Message);
            }
        }
    }
}
1
2
3
curl -X GET -i --user auth_id:auth_token \
-H "Content-Type: application/json" \
https://api.plivo.com/v1/Account/{auth_id}/NumberPool/{number_pool_uuid}/Number/{number}
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
package main

import (
	"fmt"

	plivo "github.com/plivo/plivo-go/v7"
)

func main() {

	client, err := plivo.NewClient("<auth_id>", "<auth_token>",
		&plivo.ClientOptions{})
	if err != nil {
		fmt.Print("Error", err.Error())
		return
	}

	// Get Powerpack
	powerpack, err := client.Powerpack.Get("<powerpack_uuid>")
	if err != nil {
		fmt.Print("Error", err.Error())
		return
	}
	// Retrieve a Number
	response, err := powerpack.Find_numbers("<sms_or_mms_number>")
	if err != nil {
		fmt.Print("Error", err.Error())
		return
	}
	fmt.Printf("Response: %#v\n", response)
}