Generates a WebRTC login token.
curl --request POST \
--url https://api.leadping.ai/telephony/login \
--header 'Content-Type: application/json' \
--data '
{
"device": {
"id": "<string>",
"name": "<string>"
}
}
'import requests
url = "https://api.leadping.ai/telephony/login"
payload = { "device": {
"id": "<string>",
"name": "<string>"
} }
headers = {"Content-Type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.text)using RestSharp;
var options = new RestClientOptions("https://api.leadping.ai/telephony/login");
var client = new RestClient(options);
var request = new RestRequest("");
request.AddJsonBody("{\n \"device\": {\n \"id\": \"<string>\",\n \"name\": \"<string>\"\n }\n}", false);
var response = await client.PostAsync(request);
Console.WriteLine("{0}", response.Content);HttpResponse<String> response = Unirest.post("https://api.leadping.ai/telephony/login")
.header("Content-Type", "application/json")
.body("{\n \"device\": {\n \"id\": \"<string>\",\n \"name\": \"<string>\"\n }\n}")
.asString();const options = {
method: 'POST',
headers: {'Content-Type': 'application/json'},
body: JSON.stringify({device: {id: '<string>', name: '<string>'}})
};
fetch('https://api.leadping.ai/telephony/login', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.leadping.ai/telephony/login"
payload := strings.NewReader("{\n \"device\": {\n \"id\": \"<string>\",\n \"name\": \"<string>\"\n }\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.leadping.ai/telephony/login",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'device' => [
'id' => '<string>',
'name' => '<string>'
]
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}{
"username": "<string>",
"password": "<string>",
"expiresAt": "2023-11-07T05:31:56Z",
"callbackToken": "<string>"
}{
"type": "<string>",
"title": "<string>",
"status": "<string>",
"detail": "<string>",
"instance": "<string>"
}{
"type": "<string>",
"title": "<string>",
"status": "<string>",
"detail": "<string>",
"instance": "<string>"
}Telephony
Generates a WebRTC login token.
Generates a Leadping WebRTC login token so authenticated agents can connect to telephony services and place or receive browser-based calls.
POST
/
telephony
/
login
Generates a WebRTC login token.
curl --request POST \
--url https://api.leadping.ai/telephony/login \
--header 'Content-Type: application/json' \
--data '
{
"device": {
"id": "<string>",
"name": "<string>"
}
}
'import requests
url = "https://api.leadping.ai/telephony/login"
payload = { "device": {
"id": "<string>",
"name": "<string>"
} }
headers = {"Content-Type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.text)using RestSharp;
var options = new RestClientOptions("https://api.leadping.ai/telephony/login");
var client = new RestClient(options);
var request = new RestRequest("");
request.AddJsonBody("{\n \"device\": {\n \"id\": \"<string>\",\n \"name\": \"<string>\"\n }\n}", false);
var response = await client.PostAsync(request);
Console.WriteLine("{0}", response.Content);HttpResponse<String> response = Unirest.post("https://api.leadping.ai/telephony/login")
.header("Content-Type", "application/json")
.body("{\n \"device\": {\n \"id\": \"<string>\",\n \"name\": \"<string>\"\n }\n}")
.asString();const options = {
method: 'POST',
headers: {'Content-Type': 'application/json'},
body: JSON.stringify({device: {id: '<string>', name: '<string>'}})
};
fetch('https://api.leadping.ai/telephony/login', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.leadping.ai/telephony/login"
payload := strings.NewReader("{\n \"device\": {\n \"id\": \"<string>\",\n \"name\": \"<string>\"\n }\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.leadping.ai/telephony/login",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'device' => [
'id' => '<string>',
'name' => '<string>'
]
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}{
"username": "<string>",
"password": "<string>",
"expiresAt": "2023-11-07T05:31:56Z",
"callbackToken": "<string>"
}{
"type": "<string>",
"title": "<string>",
"status": "<string>",
"detail": "<string>",
"instance": "<string>"
}{
"type": "<string>",
"title": "<string>",
"status": "<string>",
"detail": "<string>",
"instance": "<string>"
}Body
application/jsonapplication/*+json
The telephony login request containing connection details.
Request model for telephony login token generation.
The ID and name for this device.
Show child attributes
Show child attributes
Response
Login token was successfully generated.
Response model for telephony login token generation.
⌘I

