Latest Legacy

Retrieve a session

Retrieves a session.

API Endpoint

GET https://api.plivo.com/v1/Account/{auth_id}/Verify/Session/{session_uuid}/

Arguments

No arguments need to be passed.

Returns

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

Response

{
    "api_id": "abf7fc2b-fac5-471c-9592-74ed6834b5e6",
    "session_uuid": "60ea68db-b123-46d9-9eb2-1201d516dbbd",
    "app_uuid": "ec66515e-86f6-4507-8620-31c039538d7a",
    "recipient": "919380013443",
    "channel": "voice",
    "status": "Expired",
    "count": 3,
    "attempt_details": [
        {
            "channel": "voice",
            "attempt_uuid": "90cc6cde-db80-4d14-9716-3aaa2b403377",
            "status": "answer",
            "time": "2023-06-01T08:52:39.363253Z"
        },
        {
            "channel": "sms",
            "attempt_uuid": "acbffc94-283b-42b3-8a96-65cbc18a9624",
            "status": "delivered",
            "time": "2023-06-01T08:52:59.484375Z"
        },
        {
            "channel": "voice",
            "attempt_uuid": "04a81620-c4ab-45d6-847d-cc3ae6fec121",
            "status": "early media",
            "time": "2023-06-01T08:53:25.577153Z"
        }
    ],
    "charges": {
        "total_charge": "0.113",
        "validation_charge": "0.0000",
        "attempt_charges": [
            {
                "attempt_uuid": "90cc6cde-db80-4d14-9716-3aaa2b403377",
                "channel": "voice",
                "charge": "0.03300"
            },
            {
                "attempt_uuid": "acbffc94-283b-42b3-8a96-65cbc18a9624",
                "channel": "sms",
                "charge": "0.08000"
            },
            {
                "attempt_uuid": "04a81620-c4ab-45d6-847d-cc3ae6fec121",
                "channel": "voice",
                "charge": "0.00000"
            }
        ]
    },
    "created_at": "2023-06-01T08:52:39.363253Z",
    "updated_at": "2023-06-01T08:53:25.577153Z"
}

Example Request

1
2
3
4
5
6
7
8
9
import sys
sys.path.append("../plivo-python")
import plivo

client = plivo.RestClient()

response = client.verify_session.get('<session uuid>')

print(response)
1
2
3
4
5
6
let plivo = require('plivo')
let client = new plivo.Client('<auth_id>', '<auth_token>');
client.verify_session.get('<session_uuid>').then(function(response) {
let formattedResponse = JSON.stringify(response, null, 2);
console.log(formattedResponse);
});
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
<?php
require '/usr/src/app/vendor/autoload.php';
use Plivo\RestClient;
use Plivo\Exceptions\PlivoResponseException;

// ENVIRONMENT
$client = new RestClient("<auth_id>", "<auth_token>");

// Get a particular session detail
try {
$response = $client->verifySessions->get('<session_uuid>');
print_r($response);
}
catch (Exception $ex) {
print_r($ex);
}
?>
1
2
curl -i --user auth_id:auth_token \
    https://api.plivo.com/v1/Account/{auth_id}/Verify/Session/{session_uuid}/
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
package main

import (
"fmt"
"encoding/json"

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

func main() {
client, err := plivo.NewClient("<auth_id>", "<auth_token>", &plivo.ClientOptions{})
if err != nil {
fmt.Printf("Error:\n", err)
}
//Get the details of a session
response_get, err := client.VerifySession.Get(response.SessionUUID)
if err != nil {
fmt.Print("Error", err.Error())
return
}
res1, _ := json.Marshal(response_get)
fmt.Printf("Response: \n\n %#v \n", string(res1))
}