This API enables fetching of bulk allocation details, based upon criteria like time duration and allocation status.
User needs to provide 'time from' as a mandatory parameter. If 'time to' is not provided, then current time is taken as a default upper limit.
http://leadassist.exotel.in/v1/tenants/<tenant_id>/greenvn
<tenant_id>
with your “Account sid”The performance of this API is subjected to the amount of data being fetched, based upon the request criteria.
The following are the request parameters:
Parameter Name | Mandatory/Optional | Value / Description |
cursor | optional |
This represents the page number from which the response will be fetched. Default Value is 0 (zero) |
page_size | optional |
This represents number of records visible in one page of the API response. Default: 50, Max: 100 |
time_from | mandatory |
This represents the selection of time from which the data will be fetched. The allowed format is: YYYY-MM-DDTHH:MM:SS (where Y stands for Years, first two M stands for Months, D stands for Day, H stands for Hours, last two Ms stand for Minutes and S stands for Seconds; T is the separator between Date & Time) e.g.2015-11-16T14:54:06 Note: H follows 24 hour format |
time_to | optional |
This represents the selection of time until which the data will be fetched. If not passed in the request, then the system will pick the default value which is the current time (the time of request hitting the server). The allowed format is: YYYY-MM-DDTHH:MM:SS (where Y stands for Years, first two M stands for Months, D stands for Day, H stands for Hours, last two Ms stand for Minutes and S stands for Seconds; T is the separator between Date & Time) e.g.2015-11-16T14:54:06 Note: H follows 24 hour format |
state | optional |
This parameter allows you to have an additional filter of allocation state. Possible values are ‘active’ or ‘deleted’. Default Value: Both states to be considered while fetching the records |
curl --location --request GET 'https://<your_api_key>:<your_api_token>@leadassist.exotel.in/v1/tenants/<account_sid>/greenvn?page_size=2&cursor=1&time_to=2021-02-01T00:00:00&time_from=2021-01-01T00:00:00&status=active'
var request = require("request"); var accountSid = "XXXXXXXXX"; var accountToken = "YYYYYYYYY"; var authKey = "ZZZZZZZZZZ"; var encoding = Buffer.from(authKey + ':' + accountToken).toString('base64') var options = { 'method': 'GET', 'url': 'https://leadassist.exotel.in/v1/tenants/'+accountSid+'/greenvn?page_size=2&cursor=1&time_to=2021-02-01T00:00:00&time_from=2021-01-01T00:00:00&status=active', 'headers': { 'Authorization': 'Basic ' + encoding } }; request(options, function (error, response) { if (error) throw new Error(error); console.log(response.body); });
<?php $curl = curl_init(); $accountSid = "XXXXXXXXXX"; $accountToken = "YYYYYYYYYY"; $authKey = "ZZZZZZZZZZ"; $encoding = base64_encode($authKey .":". $accountToken); curl_setopt_array($curl, array( CURLOPT_URL => 'https://leadassist.exotel.in/v1/tenants/'+$accountSid+'/greenvn?page_size=2&cursor=1&time_to=2021-02-01T00:00:00&time_from=2021-01-01T00:00:00&status=active', CURLOPT_RETURNTRANSFER => true, CURLOPT_ENCODING => '', CURLOPT_MAXREDIRS => 10, CURLOPT_TIMEOUT => 0, CURLOPT_FOLLOWLOCATION => true, CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1, CURLOPT_CUSTOMREQUEST => 'GET', CURLOPT_HTTPHEADER => array( 'Authorization: Basic '+ $encoding ), )); $response = curl_exec($curl); curl_close($curl); echo $response;
import requests, base64, json accountSid = "XXXXXXXXX" authToken = "YYYYYYYYY" authKey = "ZZZZZZZZZZ" encoding = base64.b64encode(authKey + ":" + authToken) url = "https://leadassist.exotel.in/v1/tenants/"+ accountSid+"/greenvn?page_size=2&cursor=1&time_to=2021-02-01T00:00:00&time_from=2021-01-01T00:00:00&status=active" payload={} headers = { 'Authorization': 'Basic '+encoding } response = requests.request("GET", url, headers=headers, data=payload) print(response.text)
package main import ( b64 "encoding/base64" "fmt" "io/ioutil" "net/http" ) func main() { // Please provide accountSid, authToken from your Exotel account accountSid := "XXXXXXXXX" authToken := "YYYYYYYY" authKey := "ZZZZZZZZZZ" // Encoding the accountSid and authToken, used in Authorization header encoding := b64.StdEncoding.EncodeToString([]byte(authKey + ":" + authToken)) url := "https://leadassist.exotel.in/v1/tenants/" + accountSid + "/greenvn?page_size=2&cursor=1&time_to=2021-02-01T00:00:00&time_from=2021-01-01T00:00:00&status=active" method := "GET" client := &http.Client{} req, err := http.NewRequest(method, url, nil) if err != nil { fmt.Println(err) return } req.Header.Add("Authorization", "Basic "+encoding) res, err := client.Do(req) if err != nil { fmt.Println(err) return } defer res.Body.Close() body, err := ioutil.ReadAll(res.Body) if err != nil { fmt.Println(err) return } fmt.Println(string(body)) }
{ "success": true, "status": 200, "data": [ { "state": "deleted", "bparty_numbers": [ "+917926461935" ], "connection_id": "two", "greenvn_id": "572d81c0-bb22-41c9-81cc-3a6c52838a90", "aparty_pins": [], "usage": "twoway", "bparty_pins": [], "aparty_numbers": [ "+919328136488" ], "greenvn": "+912248931209", "dt_created": "2020-10-18 06:13:18" } ], "previous": "https://leadassist.exotel.in/v1/tenants/exotelt/greenvn?time_from=2020-01-01T00:00:00&time_to=2021-02-02T08:13:04&cursor=0&page_size=1", "next": "https://leadassist.exotel.in/v1/tenants/exotelt/greenvn?time_from=2020-01-01T00:00:00&time_to=2021-02-02T08:13:04&cursor=2&page_size=1" }