Agents
Get an agent
GET
/
agents
/
{id}
Get an agent
curl --request GET \
--url https://shortext.ny-corp.io/api/v2.0/agents/{id} \
--header 'Authorization: Bearer <token>'<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://shortext.ny-corp.io/api/v2.0/agents/{id}",
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/agents/{id}', 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/agents/{id}"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text){
"success": true,
"code": 1000,
"message": "Request success.",
"body": {
"id": "AGI-XXXXX",
"name": "Support",
"active": true,
"use_ai": true,
"inactive_message": "<string>",
"instructions": "<string>",
"channels": [
{
"type": "whatsapp",
"id": "532867649916076",
"name": "+237 6 99 99 99 99 (Acme)",
"enabled": true,
"agent": {
"id": "AGI-XXXXX",
"name": "<string>"
},
"settings": {
"client_type": "server",
"inbound_url": "<string>",
"reply_mode": "async",
"sync_timeout": 123,
"webhook_url": "<string>"
},
"created_at": "2023-11-07T05:31:56Z"
}
],
"created_at": "2023-11-07T05:31:56Z",
"updated_at": "2023-11-07T05:31:56Z"
},
"token": "<string>",
"trace_id": "<string>"
}Authorizations
Company API key, sent as Authorization: Bearer <key>. Create it in the dashboard (Developer > API Keys) with the permissions the integration needs.
Path Parameters
Example:
"AGI-XXXXX"
Response
200 - application/json
Always HTTP 200: the outcome is in success and code (absolute value of the response code).
⌘I
Get an agent
curl --request GET \
--url https://shortext.ny-corp.io/api/v2.0/agents/{id} \
--header 'Authorization: Bearer <token>'<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://shortext.ny-corp.io/api/v2.0/agents/{id}",
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/agents/{id}', 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/agents/{id}"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text){
"success": true,
"code": 1000,
"message": "Request success.",
"body": {
"id": "AGI-XXXXX",
"name": "Support",
"active": true,
"use_ai": true,
"inactive_message": "<string>",
"instructions": "<string>",
"channels": [
{
"type": "whatsapp",
"id": "532867649916076",
"name": "+237 6 99 99 99 99 (Acme)",
"enabled": true,
"agent": {
"id": "AGI-XXXXX",
"name": "<string>"
},
"settings": {
"client_type": "server",
"inbound_url": "<string>",
"reply_mode": "async",
"sync_timeout": 123,
"webhook_url": "<string>"
},
"created_at": "2023-11-07T05:31:56Z"
}
],
"created_at": "2023-11-07T05:31:56Z",
"updated_at": "2023-11-07T05:31:56Z"
},
"token": "<string>",
"trace_id": "<string>"
}