Get Details of an Allocation
The details of an allocation can be retrieved using this method.
GET https://leadassist.exotel.in/v1/tenants/<your_sid>/greenvn/<greenvn_id>
Replace <your_sid> with your tenant ID and <greenvn_id> with the same received in the allocation request.
Example Request
- cURL
- Python
- Node.js
- PHP
- Go
curl -X GET https://leadassist.exotel.in/v1/tenants/<your_sid>/greenvn/<greenvn_id>
import requests
response = requests.get(
'https://leadassist.exotel.in/v1/tenants/<your_sid>/greenvn/<greenvn_id>',
auth=('<username>', '<password>')
)
print(response.json())
const username = '<username>';
const password = '<password>';
const tenantSid = '<your_sid>';
const greenvnId = '<greenvn_id>';
const url = `https://leadassist.exotel.in/v1/tenants/${tenantSid}/greenvn/${greenvnId}`;
const response = await fetch(url, {
headers: {
'Authorization': 'Basic ' + Buffer.from(`${username}:${password}`).toString('base64'),
},
});
const data = await response.json();
console.log(data);
<?php
$curl = curl_init();
curl_setopt_array($curl, array(
CURLOPT_URL => "https://leadassist.exotel.in/v1/tenants/<your_sid>/greenvn/<greenvn_id>",
CURLOPT_RETURNTRANSFER => true,
));
$response = curl_exec($curl);
curl_close($curl);
echo $response;
?>
package main
import (
"fmt"
"io/ioutil"
"net/http"
)
func main() {
url := "https://leadassist.exotel.in/v1/tenants/<your_sid>/greenvn/<greenvn_id>"
req, _ := http.NewRequest("GET", url, nil)
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := ioutil.ReadAll(res.Body)
fmt.Println(string(body))
}
HTTP Response
- On success, the HTTP response status code will be 200.
- The HTTP response body will contain a JSON similar to the one below.
Example Response
{
"success": true,
"status": 200,
"data": {
"connection_id": "abcd12345",
"aparty_numbers": [
"+000000000000"
],
"bparty_numbers": [
"+919876543210"
],
"usage": "oneway|twoway",
"state": "active|vault",
"green_vn": "+918012345678",
"greenvn_id": "123456"
}
}
The parameters in the above request are the same as described in the response of the allocation request.