Latest Legacy

Retrieve an endpoint

Retrieves the details of an existing endpoint.

API Endpoint

GET https://api.plivo.com/v1/Account/{auth_id}/Endpoint/{endpoint_id}/

Arguments

No arguments need to be passed.

Returns

Returns an Endpoint object if valid parameters were provided. Returns an error otherwise.

Note: The password returned is an MD5 hash value of the actual password.

Response

HTTP Status Code: 200

Plivo returns this JSON response when the endpoint is not registered on a SIP client.

{
	"alias": "zumba",
	"api_id": "39015de8-4fb3-11e4-a2d1-22000ac5040c",
	"application": "/v1/Account/MA2025RK4E639VJFZAGV/Application/379619814477342321/",
	"endpoint_id": "39452475478853",
	"password": "8bc0002a467b8276aaaf47e92bc46b9f",
	"resource_uri": "/v1/Account/MA2025RK4E639VJFZAGV/Endpoint/39452475478853/",
	"sip_registered": "false",
	"sip_uri": "sip:zumba141009125224@phone.plivo.com",
	"sub_account": null,
	"username": "zumba141009125224"
}

When the endpoint is registered with a SIP client, Plivo returns this JSON response.

{
	"alias": "callme",
	"application": "/v1/Account/MA2025RK4E639VJFZAGV/Application/33406267401237901/",
	"endpoint_id": "32866729519064",
	"resource_uri": "/v1/Account/MA2025RK4E639VJFZAGV/Endpoint/32866729519064/",
	"sip_contact": "sip:callme140703093224@122.172.71.207:57563;ob",
	"sip_expires": "2022-07-21 19:26:08", // Format: YYYY-MM-DD HH:mm:ss Timezone: UTC
	"sip_registered": "true",
	"sip_uri": "sip:callme140703093944@phone.plivo.com",
	"sip_user_agent": "Telephone 1.1.4",
	"sub_account": null,
	"username": "callme140703093944"
}

Example Request

1
2
3
4
5
6
import plivo

client = plivo.RestClient('<auth_id>','<auth_token>')
response = client.endpoints.get(
    endpoint_id='1465909595140', )
print(response)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
#
# Example for Endpoint Get
#
require 'rubygems'
require 'plivo'

include Plivo
include Plivo::Exceptions

api = RestClient.new("<auth_id>","<auth_token>")

begin
  response = api.endpoints.get(
    '39452475478853'
  )
  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
16
17
// Example for Endpoint get

var plivo = require('plivo');

(function main() {
    'use strict';
    
   // If auth id and auth token are not specified, Plivo will fetch them from the environment variables.
    var client = new plivo.Client("<auth_id>","<auth_token>");
    client.endpoints.get(
        "39452475478853", // endpoint id
    ).then(function (response) {
        console.log(response);
    }, function (err) {
        console.error(err);
    });
})();
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
<?php
/**
 * Example for Endpoint get
 */
require 'vendor/autoload.php';
use Plivo\RestClient;
use Plivo\Exceptions\PlivoRestException;
$client = new RestClient("<auth_id>","<auth_token>");

try {
    $response = $client->endpoints->get(
        '39452475478853'
    );
    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
22
23
24
package com.plivo.api.samples.endpoint;

import java.io.IOException;
import com.plivo.api.Plivo;
import com.plivo.api.exceptions.PlivoRestException;
import com.plivo.api.models.endpoint.Endpoint;
import com.plivo.api.models.endpoint.Endpoint;

/**
* Example for Endpoint get
*/
class EndpointGet {
    public static void main(String [] args) {
        Plivo.init("<auth_id>","<auth_token>");
        try {
            Endpoint response = Endpoint.getter("39452475478853")
                .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
25
26
27
28
29
/**
 * Example for Endpoint Get
 */
using System;
using System.Collections.Generic;
using Plivo;
using Plivo.Exception;

namespace PlivoExamples
{
    internal class Program
    {
        public static void Main(string[] args)
        {
            var api = new PlivoApi("<auth_id>","<auth_token>");
            try
            {
                var response = api.Endpoint.Get(
                    endpointId:"18385812687105"
                );
                Console.WriteLine(response);
            }
            catch (PlivoRestException e)
            {
                Console.WriteLine("Exception: " + e.Message);
            }
        }
    }
}
1
2
curl -i --user AUTH_ID:AUTH_TOKEN \
    https://api.plivo.com/v1/Account/{auth_id}/Endpoint/21784177241578/
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
// Example for Endpoint get
package main

import (
	"fmt"

	"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
	}
	response, err := client.Endpoints.Get(
		"39452475478853",
	)
	if err != nil {
		fmt.Print("Error", err.Error())
		return
	}
	fmt.Printf("Response: %#v\n", response)
}