Hosted sessions
List hosted sessions
Most recent first, 50 per page.
GET
/
hosted-sessions
List hosted sessions
curl --request GET \
--url https://shortext.ny-corp.io/api/v2.0/hosted-sessions \
--header 'Authorization: Bearer <token>'<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://shortext.ny-corp.io/api/v2.0/hosted-sessions",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://shortext.ny-corp.io/api/v2.0/hosted-sessions', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://shortext.ny-corp.io/api/v2.0/hosted-sessions"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text){
"success": true,
"code": 1000,
"message": "Request success.",
"body": {
"current_page": 1,
"data": [
{
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"purpose": "whatsapp",
"status": "pending",
"url": "<string>",
"context": {},
"result": {},
"error": "<string>",
"return_url": "<string>",
"locale": "<string>",
"expires_at": "2023-11-07T05:31:56Z",
"opened_at": "2023-11-07T05:31:56Z",
"finished_at": "2023-11-07T05:31:56Z",
"created_at": "2023-11-07T05:31:56Z"
}
],
"per_page": 50,
"total": 120,
"last_page": 3,
"from": 123,
"to": 123,
"first_page_url": "<string>",
"last_page_url": "<string>",
"next_page_url": "<string>",
"prev_page_url": "<string>",
"path": "<string>"
},
"token": "<string>",
"trace_id": "<string>"
}Autorisations
Réponse
200 - application/json
Always HTTP 200: the outcome is in success and code (absolute value of the response code).
⌘I
List hosted sessions
curl --request GET \
--url https://shortext.ny-corp.io/api/v2.0/hosted-sessions \
--header 'Authorization: Bearer <token>'<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://shortext.ny-corp.io/api/v2.0/hosted-sessions",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://shortext.ny-corp.io/api/v2.0/hosted-sessions', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://shortext.ny-corp.io/api/v2.0/hosted-sessions"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text){
"success": true,
"code": 1000,
"message": "Request success.",
"body": {
"current_page": 1,
"data": [
{
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"purpose": "whatsapp",
"status": "pending",
"url": "<string>",
"context": {},
"result": {},
"error": "<string>",
"return_url": "<string>",
"locale": "<string>",
"expires_at": "2023-11-07T05:31:56Z",
"opened_at": "2023-11-07T05:31:56Z",
"finished_at": "2023-11-07T05:31:56Z",
"created_at": "2023-11-07T05:31:56Z"
}
],
"per_page": 50,
"total": 120,
"last_page": 3,
"from": 123,
"to": 123,
"first_page_url": "<string>",
"last_page_url": "<string>",
"next_page_url": "<string>",
"prev_page_url": "<string>",
"path": "<string>"
},
"token": "<string>",
"trace_id": "<string>"
}