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.

Response

HTTP Status Code: 200

Plivo will respond with the below JSON when the endpoint is not registered on a SIP client.

{
	"alias": "zumba",
	"api_id": "39015de8-4fb3-11e4-a2d1-22000ac5040c",
	"application": "/v1/Account/MAXXXXXXXXXXXXXXXXXX/Application/379619814477342321/",
	"endpoint_id": "39452475478853",
	"password": "8bc0002a467b8276aaaf47e92bc46b9f",
	"resource_uri": "/v1/Account/MAXXXXXXXXXXXXXXXXXX/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 will return the below response

{
	"alias": "callme",
	"application": "/v1/Account/MAXXXXXXXXXXXXXXXXXX/Application/33406267401237901/",
	"endpoint_id": "32866729519064",
	"resource_uri": "/v1/Account/MAXXXXXXXXXXXXXXXXXX/Endpoint/32866729519064/",
	"sip_contact": "sip:callme140703093224@122.172.71.207:57563;ob",
	"sip_expires": "2014-07-21 19:26:08",
	"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()
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("YOUR_AUTH_ID", "YOUR_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';
    
    // As the auth_id and auth_token are unspecified, Plivo will fetch them from the PLIVO_AUTH_ID and PLIVO_AUTH_TOKEN environment variables.
    var client = new plivo.Client();
    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("YOUR_AUTH_ID", "YOUR_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();
        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("YOUR_AUTH_ID", "YOUR_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
// Example for Endpoint get
package main

import "fmt"
import "github.com/plivo/plivo-go"
 
func main() {
	client, err := plivo.NewClient("", "", &plivo.ClientOptions{})
	if err != nil {
		panic(err)
	}
	response, err := client.Endpoints.Get(
		"39452475478853",
	)
	if err != nil {
		panic(err)
	}
	fmt.Printf("Response: %#v\n", response)
}