User Dialogs
Pobranie informacji o wszystkich połączeniach użytkownika w danej chwili.
GET /user/{user}/dialogs
URL Parameters
Nazwa | Rodzaj | Przykład | Opis |
---|---|---|---|
user | <STRING> |
user1 | Identyfikator lub nazwa Użytkownika |
Response Body
{
"data": <LIST<DialogInfo>>
}
Nazwa | Rodzaj | Opis | Zasób |
---|---|---|---|
data | <LIST<DialogInfo>> |
Lista informacji o dialogach. | DialogInfo |
Response Code
Status | Opis |
---|---|
202 | Żądanie przyjęte do realizacji |
403 | Nie można wykonać takiej akcji |
404 | Nie znaleziono zasobu |
Example
curl -X GET \
$CONPEEK_URL/user/user1/dialogs \
-H 'Authorization: '$CONPEEK_KEY \
-H 'Content-Type: application/json'
import requests
import os
from urllib import parse
url = parse.urljoin(os.environ["CONPEEK_URL"], "/user/%(username)s/dialogs" % {
"username": "user1"
})
headers = {
'Content-Type': "application/json",
'Authorization': os.environ["CONPEEK_KEY"]
}
response = requests.request("GET", url, headers=headers)
print(response.text)
<?php
$curl = curl_init();
$username = "user1";
curl_setopt_array($curl, array(
CURLOPT_URL => getenv("CONPEEK_URL")."/user/$username/dialogs",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => array(
"Authorization: ".getenv("CONPEEK_KEY"),
"Content-Type: application/json"
),
));
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
Response
200 OK
{
"data": [{
"dialog_uuid": "6d59cb01-eeac-432a-b0aa-bfa4f26785ecl",
"display_name": "Jan",
"display_number": "48123123789",
"peer_presentation_name": null,
"peer_presentation_number": null,
"dialog_type": "TENANT_USER",
"direction": "OUTBOUND",
"state": "talking",
"answered": "true",
"on_hold": "false",
"start_time": "2018-09-01 10:00:03",
"answer_time": "2018-09-01 10:00:05",
"serve_time": "2018-09-01 10:00:05",
"ring_time": "2018-09-01 10:00:04",
"alert_time": "2018-09-01 10:00:04",
"media": ["audio"],
"contact_id": "45",
"contact_data": {
"firstname": "XYZ",
"surname": "BB",
"id": "45"
},
"crm_id": "5f2d216ef03d640e9102c508",
"contact_verification_level_code": null,
"contact_verification_level_display": null
}]
}