Introducción
Este API contiene la lógica de negocio que se encarga de alimentar el sistema de Atención Profesional de Cyberfuel S.A. Los usuarios de consumo no deberán ser de uso compartido y deberá mantenerse una segmentación en su uso, único y exclusivo para el fin que fueron brindados.
Este API contiene la lógica de negocio que se encarga de alimentar el sistema de Atención Profesional de Cyberfuel S.A.
Los usuarios de consumo no deberán ser de uso compartido y deberá mantenerse una segmentación en su uso, único y exclusivo para el fin que fueron brindados.
El acceso no autorizado a este API es prohibido.
Autenticación de Solicitudes
Para autenticar sus solicitudes, incluya los siguientes headers con las credenciales asignadas al proyecto o desarrollador: X-User-Consumo y X-User-Secret.
Todos los endpoints autenticados están marcados con una insignia de requiere autenticación en la documentación.
Si requiere acceso desde otro proyecto distinto al API de Atención Profesional, favor solicitar un nuevo acceso vía correo electrónico al mail: dnunez@cyberfuel.com
Broadcast
Enviar mensaje publico
requires authentication
Publica un mensaje en un canal publico.
Example request:
$client = new \GuzzleHttp\Client();
$url = 'https://calidad.api.atencionprofesional.com/api/broadcast/public-message';
$response = $client->post(
$url,
[
'headers' => [
'X-User-Consumo' => 'string required Identificador del cliente de consumo (middleware auth.api_client).',
'X-User-Secret' => 'string required Secreto del cliente de consumo.',
'Authorization' => 'string required Bearer token (auth:sanctum).',
'Content-Type' => 'application/json',
],
'json' => [
'chatId' => '"chat-123"',
'message' => '"Hola a todos"',
'channel' => '"general"',
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));const url = new URL(
"https://calidad.api.atencionprofesional.com/api/broadcast/public-message"
);
const headers = {
"X-User-Consumo": "string required Identificador del cliente de consumo (middleware auth.api_client).",
"X-User-Secret": "string required Secreto del cliente de consumo.",
"Authorization": "string required Bearer token (auth:sanctum).",
"Content-Type": "application/json",
"Accept": "application/json",
};
let body = {
"chatId": "\"chat-123\"",
"message": "\"Hola a todos\"",
"channel": "\"general\""
};
fetch(url, {
method: "POST",
headers,
body: JSON.stringify(body),
}).then(response => response.json());Example response (200):
{
"status": "success",
"message": "Public message sent",
"data": {
"channel": "publicchat.general",
"event": "MessageSent",
"payload": {
"chatId": "chat-123",
"message": "Hola a todos",
"user": "John Doe"
}
}
}
Example response (422):
{
"message": "The message field is required."
}
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
Enviar notificacion privada a usuario
requires authentication
Example request:
$client = new \GuzzleHttp\Client();
$url = 'https://calidad.api.atencionprofesional.com/api/broadcast/private-notification';
$response = $client->post(
$url,
[
'headers' => [
'X-User-Consumo' => 'string required Identificador del cliente de consumo (middleware auth.api_client).',
'X-User-Secret' => 'string required Secreto del cliente de consumo.',
'Authorization' => 'string required Bearer token (auth:sanctum).',
'Content-Type' => 'application/json',
],
'json' => [
'chatId' => '"chat-123"',
'user_id' => 7,
'title' => '"Aviso"',
'message' => '"Tienes un nuevo mensaje"',
'type' => '"info"',
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));const url = new URL(
"https://calidad.api.atencionprofesional.com/api/broadcast/private-notification"
);
const headers = {
"X-User-Consumo": "string required Identificador del cliente de consumo (middleware auth.api_client).",
"X-User-Secret": "string required Secreto del cliente de consumo.",
"Authorization": "string required Bearer token (auth:sanctum).",
"Content-Type": "application/json",
"Accept": "application/json",
};
let body = {
"chatId": "\"chat-123\"",
"user_id": 7,
"title": "\"Aviso\"",
"message": "\"Tienes un nuevo mensaje\"",
"type": "\"info\""
};
fetch(url, {
method: "POST",
headers,
body: JSON.stringify(body),
}).then(response => response.json());Example response (200):
{
"status": "success",
"message": "Private notification sent",
"data": {
"channel": "privateuser.7",
"event": "UserNotification",
"payload": {
"title": "Aviso",
"message": "Tienes un nuevo mensaje"
}
}
}
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
Obtener canales y eventos disponibles
requires authentication
Lista canales/eventos ejemplo para broadcast.
Example request:
$client = new \GuzzleHttp\Client();
$url = 'https://calidad.api.atencionprofesional.com/api/broadcast/channels-info';
$response = $client->get(
$url,
[
'headers' => [
'X-User-Consumo' => 'string required Identificador del cliente de consumo (middleware auth.api_client).',
'X-User-Secret' => 'string required Secreto del cliente de consumo.',
'Authorization' => 'string required Bearer token (auth:sanctum).',
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));const url = new URL(
"https://calidad.api.atencionprofesional.com/api/broadcast/channels-info"
);
const headers = {
"X-User-Consumo": "string required Identificador del cliente de consumo (middleware auth.api_client).",
"X-User-Secret": "string required Secreto del cliente de consumo.",
"Authorization": "string required Bearer token (auth:sanctum).",
"Accept": "application/json",
};
fetch(url, {
method: "GET",
headers,
}).then(response => response.json());Example response (200):
{
"channels": {
"public": [
"publicchat.general",
"publicchat.support",
"public.notifications"
],
"private": [
"privateuser.{userId}",
"privateclient.{clientId}"
],
"presence": [
"presencechat.{roomId}",
"presencesupport.{sessionId}"
]
},
"events": [
"MessageSent",
"UserNotification",
"ClientMessage",
"UserStatusChanged"
]
}
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
Enviar mensaje a canal de presencia (usuarios)
requires authentication
Example request:
$client = new \GuzzleHttp\Client();
$url = 'https://calidad.api.atencionprofesional.com/api/broadcast/sendPresenceChannel';
$response = $client->post(
$url,
[
'headers' => [
'X-User-Consumo' => 'string required Identificador del cliente de consumo (middleware auth.api_client).',
'X-User-Secret' => 'string required Secreto del cliente de consumo.',
'Authorization' => 'string required Bearer token (auth:sanctum).',
'Content-Type' => 'application/json',
],
'json' => [
'chatId' => '"chat-123"',
'message' => '"Hola a la sala"',
'room_id' => '"room-1"',
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));const url = new URL(
"https://calidad.api.atencionprofesional.com/api/broadcast/sendPresenceChannel"
);
const headers = {
"X-User-Consumo": "string required Identificador del cliente de consumo (middleware auth.api_client).",
"X-User-Secret": "string required Secreto del cliente de consumo.",
"Authorization": "string required Bearer token (auth:sanctum).",
"Content-Type": "application/json",
"Accept": "application/json",
};
let body = {
"chatId": "\"chat-123\"",
"message": "\"Hola a la sala\"",
"room_id": "\"room-1\""
};
fetch(url, {
method: "POST",
headers,
body: JSON.stringify(body),
}).then(response => response.json());Example response (200):
{
"status": "success",
"message": "Mensaje enviado"
}
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
Indicador de escribiendo en canal de presencia (usuarios)
requires authentication
Example request:
$client = new \GuzzleHttp\Client();
$url = 'https://calidad.api.atencionprofesional.com/api/broadcast/userPresenceChannelTyping';
$response = $client->post(
$url,
[
'headers' => [
'X-User-Consumo' => 'string required Identificador del cliente de consumo (middleware auth.api_client).',
'X-User-Secret' => 'string required Secreto del cliente de consumo.',
'Authorization' => 'string required Bearer token (auth:sanctum).',
'Content-Type' => 'application/json',
],
'json' => [
'room_id' => '"room-1"',
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));const url = new URL(
"https://calidad.api.atencionprofesional.com/api/broadcast/userPresenceChannelTyping"
);
const headers = {
"X-User-Consumo": "string required Identificador del cliente de consumo (middleware auth.api_client).",
"X-User-Secret": "string required Secreto del cliente de consumo.",
"Authorization": "string required Bearer token (auth:sanctum).",
"Content-Type": "application/json",
"Accept": "application/json",
};
let body = {
"room_id": "\"room-1\""
};
fetch(url, {
method: "POST",
headers,
body: JSON.stringify(body),
}).then(response => response.json());Example response (200):
{
"status": "success"
}
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
Enviar mensaje publico a clientes
requires authentication
Example request:
$client = new \GuzzleHttp\Client();
$url = 'https://calidad.api.atencionprofesional.com/api/broadcast/publicCustomer-message';
$response = $client->post(
$url,
[
'headers' => [
'X-User-Consumo' => 'string required Identificador del cliente de consumo (middleware auth.api_client).',
'X-User-Secret' => 'string required Secreto del cliente de consumo.',
'Authorization' => 'string required Bearer token (auth:sanctum).',
'Content-Type' => 'application/json',
],
'json' => [
'chatId' => '"chat-123"',
'customer' => '"cust-55"',
'message' => '"Hola cliente"',
'channel' => '"public.customer"',
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));const url = new URL(
"https://calidad.api.atencionprofesional.com/api/broadcast/publicCustomer-message"
);
const headers = {
"X-User-Consumo": "string required Identificador del cliente de consumo (middleware auth.api_client).",
"X-User-Secret": "string required Secreto del cliente de consumo.",
"Authorization": "string required Bearer token (auth:sanctum).",
"Content-Type": "application/json",
"Accept": "application/json",
};
let body = {
"chatId": "\"chat-123\"",
"customer": "\"cust-55\"",
"message": "\"Hola cliente\"",
"channel": "\"public.customer\""
};
fetch(url, {
method: "POST",
headers,
body: JSON.stringify(body),
}).then(response => response.json());Example response (200):
{
"status": "success",
"message": "Public message sent",
"data": {
"channel": "public.customer",
"event": "MessageSent",
"payload": {
"customer": "cust-55",
"message": "Hola cliente"
}
}
}
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
Enviar notificacion privada a cliente
requires authentication
Example request:
$client = new \GuzzleHttp\Client();
$url = 'https://calidad.api.atencionprofesional.com/api/broadcast/privateCustomer-notification';
$response = $client->post(
$url,
[
'headers' => [
'X-User-Consumo' => 'string required Identificador del cliente de consumo (middleware auth.api_client).',
'X-User-Secret' => 'string required Secreto del cliente de consumo.',
'Authorization' => 'string required Bearer token (auth:sanctum).',
'Content-Type' => 'application/json',
],
'json' => [
'chatId' => '"chat-123"',
'customer_id' => 9,
'user_id' => 7,
'title' => '"Aviso"',
'message' => '"Tienes un nuevo mensaje"',
'type' => '"info"',
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));const url = new URL(
"https://calidad.api.atencionprofesional.com/api/broadcast/privateCustomer-notification"
);
const headers = {
"X-User-Consumo": "string required Identificador del cliente de consumo (middleware auth.api_client).",
"X-User-Secret": "string required Secreto del cliente de consumo.",
"Authorization": "string required Bearer token (auth:sanctum).",
"Content-Type": "application/json",
"Accept": "application/json",
};
let body = {
"chatId": "\"chat-123\"",
"customer_id": 9,
"user_id": 7,
"title": "\"Aviso\"",
"message": "\"Tienes un nuevo mensaje\"",
"type": "\"info\""
};
fetch(url, {
method: "POST",
headers,
body: JSON.stringify(body),
}).then(response => response.json());Example response (200):
{
"status": "success",
"message": "Private notification sent",
"data": {
"channel": "client.9.7",
"event": "UserNotification",
"payload": {
"title": "Aviso",
"message": "Tienes un nuevo mensaje"
}
}
}
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
Enviar mensaje a canal de presencia de cliente
requires authentication
Example request:
$client = new \GuzzleHttp\Client();
$url = 'https://calidad.api.atencionprofesional.com/api/broadcast/sendCustomerPresenceChannel';
$response = $client->post(
$url,
[
'headers' => [
'X-User-Consumo' => 'string required Identificador del cliente de consumo (middleware auth.api_client).',
'X-User-Secret' => 'string required Secreto del cliente de consumo.',
'Authorization' => 'string required Bearer token (auth:sanctum).',
'Content-Type' => 'application/json',
],
'json' => [
'chatId' => '"chat-123"',
'customerId' => 9,
'message' => '"Hola cliente"',
'room_id' => '"room-1"',
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));const url = new URL(
"https://calidad.api.atencionprofesional.com/api/broadcast/sendCustomerPresenceChannel"
);
const headers = {
"X-User-Consumo": "string required Identificador del cliente de consumo (middleware auth.api_client).",
"X-User-Secret": "string required Secreto del cliente de consumo.",
"Authorization": "string required Bearer token (auth:sanctum).",
"Content-Type": "application/json",
"Accept": "application/json",
};
let body = {
"chatId": "\"chat-123\"",
"customerId": 9,
"message": "\"Hola cliente\"",
"room_id": "\"room-1\""
};
fetch(url, {
method: "POST",
headers,
body: JSON.stringify(body),
}).then(response => response.json());Example response (200):
{
"status": "success",
"message": "Mensaje enviado"
}
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
Indicador de escribiendo en canal de cliente
requires authentication
Example request:
$client = new \GuzzleHttp\Client();
$url = 'https://calidad.api.atencionprofesional.com/api/broadcast/userPresenceCustomerChannelTyping';
$response = $client->post(
$url,
[
'headers' => [
'X-User-Consumo' => 'string required Identificador del cliente de consumo (middleware auth.api_client).',
'X-User-Secret' => 'string required Secreto del cliente de consumo.',
'Authorization' => 'string required Bearer token (auth:sanctum).',
'Content-Type' => 'application/json',
],
'json' => [
'customerId' => 9,
'room_id' => '"room-1"',
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));const url = new URL(
"https://calidad.api.atencionprofesional.com/api/broadcast/userPresenceCustomerChannelTyping"
);
const headers = {
"X-User-Consumo": "string required Identificador del cliente de consumo (middleware auth.api_client).",
"X-User-Secret": "string required Secreto del cliente de consumo.",
"Authorization": "string required Bearer token (auth:sanctum).",
"Content-Type": "application/json",
"Accept": "application/json",
};
let body = {
"customerId": 9,
"room_id": "\"room-1\""
};
fetch(url, {
method: "POST",
headers,
body: JSON.stringify(body),
}).then(response => response.json());Example response (200):
{
"status": "success"
}
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
Enviar mensaje a canal de presencia WAP
requires authentication
Example request:
$client = new \GuzzleHttp\Client();
$url = 'https://calidad.api.atencionprofesional.com/api/broadcast/sendPresenceWAPChannel';
$response = $client->post(
$url,
[
'headers' => [
'X-User-Consumo' => 'string required Identificador del cliente de consumo (middleware auth.api_client).',
'X-User-Secret' => 'string required Secreto del cliente de consumo.',
'Authorization' => 'string required Bearer token (auth:sanctum).',
'Content-Type' => 'application/json',
],
'json' => [
'chatId' => '"chat-123"',
'message' => '"Mensaje WAP"',
'room_id' => '"room-1"',
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));const url = new URL(
"https://calidad.api.atencionprofesional.com/api/broadcast/sendPresenceWAPChannel"
);
const headers = {
"X-User-Consumo": "string required Identificador del cliente de consumo (middleware auth.api_client).",
"X-User-Secret": "string required Secreto del cliente de consumo.",
"Authorization": "string required Bearer token (auth:sanctum).",
"Content-Type": "application/json",
"Accept": "application/json",
};
let body = {
"chatId": "\"chat-123\"",
"message": "\"Mensaje WAP\"",
"room_id": "\"room-1\""
};
fetch(url, {
method: "POST",
headers,
body: JSON.stringify(body),
}).then(response => response.json());Example response (200):
{
"status": "success",
"message": "Mensaje enviado"
}
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
Chat
Listar chats
requires authentication
Devuelve los chats visibles para el usuario, con filtros y paginacion opcional.
Example request:
$client = new \GuzzleHttp\Client();
$url = 'https://calidad.api.atencionprofesional.com/api/chat/list';
$response = $client->post(
$url,
[
'headers' => [
'X-User-Consumo' => 'string required Identificador del cliente de consumo (middleware auth.api_client).',
'X-User-Secret' => 'string required Secreto del cliente de consumo.',
'Authorization' => 'string required Bearer token de autenticacion (auth:sanctum).',
'Content-Type' => 'application/json',
],
'json' => [
'paginate' => '"N"',
'quantity_x_page' => 10,
'filters' => [
'name' => 'Cliente A',
],
'id_bitacora_log' => 736014,
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));const url = new URL(
"https://calidad.api.atencionprofesional.com/api/chat/list"
);
const headers = {
"X-User-Consumo": "string required Identificador del cliente de consumo (middleware auth.api_client).",
"X-User-Secret": "string required Secreto del cliente de consumo.",
"Authorization": "string required Bearer token de autenticacion (auth:sanctum).",
"Content-Type": "application/json",
"Accept": "application/json",
};
let body = {
"paginate": "\"N\"",
"quantity_x_page": 10,
"filters": {
"name": "Cliente A"
},
"id_bitacora_log": 736014
};
fetch(url, {
method: "POST",
headers,
body: JSON.stringify(body),
}).then(response => response.json());Example response (200):
{
"data": {
"data": [
{
"id_chat": "chat-123",
"name": "Cliente A",
"last_message": "Hola",
"unread": 2
}
]
},
"status": "success",
"message": "Operacion exitosa",
"code": 200,
"id_bitacora_log": 736014
}
Example response (422):
{
"data": {
"errors": {
"paginate": [
"El campo paginate debe ser \"S\" o \"N\"."
]
}
},
"status": "error",
"message": "Validacion fallida.",
"code": 422,
"id_bitacora_log": 736014
}
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
Listar usuarios de chat
requires authentication
Devuelve usuarios disponibles para chat con filtros y paginacion opcional.
Example request:
$client = new \GuzzleHttp\Client();
$url = 'https://calidad.api.atencionprofesional.com/api/chat/listChatUsers';
$response = $client->post(
$url,
[
'headers' => [
'X-User-Consumo' => 'string required Identificador del cliente de consumo (middleware auth.api_client).',
'X-User-Secret' => 'string required Secreto del cliente de consumo.',
'Authorization' => 'string required Bearer token de autenticacion (auth:sanctum).',
'Content-Type' => 'application/json',
],
'json' => [
'paginate' => '"N"',
'quantity_x_page' => 10,
'filters' => [
'name' => 'Agente',
],
'id_bitacora_log' => 736014,
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));const url = new URL(
"https://calidad.api.atencionprofesional.com/api/chat/listChatUsers"
);
const headers = {
"X-User-Consumo": "string required Identificador del cliente de consumo (middleware auth.api_client).",
"X-User-Secret": "string required Secreto del cliente de consumo.",
"Authorization": "string required Bearer token de autenticacion (auth:sanctum).",
"Content-Type": "application/json",
"Accept": "application/json",
};
let body = {
"paginate": "\"N\"",
"quantity_x_page": 10,
"filters": {
"name": "Agente"
},
"id_bitacora_log": 736014
};
fetch(url, {
method: "POST",
headers,
body: JSON.stringify(body),
}).then(response => response.json());Example response (200):
{
"data": {
"data": [
{
"id": 7,
"name": "Agente 1",
"email": "agente1@empresa.com"
}
]
},
"status": "success",
"message": "Operacion exitosa",
"code": 200,
"id_bitacora_log": 736014
}
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
Obtener mensajes de un chat
requires authentication
Lista los mensajes del chat indicado.
Example request:
$client = new \GuzzleHttp\Client();
$url = 'https://calidad.api.atencionprofesional.com/api/chat/getChatMessages';
$response = $client->post(
$url,
[
'headers' => [
'X-User-Consumo' => 'string required Identificador del cliente de consumo (middleware auth.api_client).',
'X-User-Secret' => 'string required Secreto del cliente de consumo.',
'Authorization' => 'string required Bearer token de autenticacion (auth:sanctum).',
'Content-Type' => 'application/json',
],
'json' => [
'id_chat' => '"chat-123"',
'id_bitacora_log' => 736014,
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));const url = new URL(
"https://calidad.api.atencionprofesional.com/api/chat/getChatMessages"
);
const headers = {
"X-User-Consumo": "string required Identificador del cliente de consumo (middleware auth.api_client).",
"X-User-Secret": "string required Secreto del cliente de consumo.",
"Authorization": "string required Bearer token de autenticacion (auth:sanctum).",
"Content-Type": "application/json",
"Accept": "application/json",
};
let body = {
"id_chat": "\"chat-123\"",
"id_bitacora_log": 736014
};
fetch(url, {
method: "POST",
headers,
body: JSON.stringify(body),
}).then(response => response.json());Example response (200):
{
"data": {
"messages": [
{
"id_message": "msg-1",
"text": "Hola",
"sender_id": 7
}
]
},
"status": "success",
"message": "Operacion exitosa",
"code": 200,
"id_bitacora_log": 736014
}
Example response (422):
{
"data": {
"errors": {
"id_chat": [
"El campo id_chat es obligatorio."
]
}
},
"status": "error",
"message": "Validacion fallida.",
"code": 422,
"id_bitacora_log": 736014
}
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
Obtener usuarios de un chat
requires authentication
Devuelve los usuarios participantes de un chat.
Example request:
$client = new \GuzzleHttp\Client();
$url = 'https://calidad.api.atencionprofesional.com/api/chat/getChatUsers';
$response = $client->post(
$url,
[
'headers' => [
'X-User-Consumo' => 'string required Identificador del cliente de consumo (middleware auth.api_client).',
'X-User-Secret' => 'string required Secreto del cliente de consumo.',
'Authorization' => 'string required Bearer token de autenticacion (auth:sanctum).',
'Content-Type' => 'application/json',
],
'json' => [
'id_chat' => '"chat-123"',
'id_bitacora_log' => 736014,
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));const url = new URL(
"https://calidad.api.atencionprofesional.com/api/chat/getChatUsers"
);
const headers = {
"X-User-Consumo": "string required Identificador del cliente de consumo (middleware auth.api_client).",
"X-User-Secret": "string required Secreto del cliente de consumo.",
"Authorization": "string required Bearer token de autenticacion (auth:sanctum).",
"Content-Type": "application/json",
"Accept": "application/json",
};
let body = {
"id_chat": "\"chat-123\"",
"id_bitacora_log": 736014
};
fetch(url, {
method: "POST",
headers,
body: JSON.stringify(body),
}).then(response => response.json());Example response (200):
{
"data": {
"users": [
{
"id": 7,
"name": "Agente 1"
}
]
},
"status": "success",
"message": "Operacion exitosa",
"code": 200,
"id_bitacora_log": 736014
}
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
Enviar mensaje
requires authentication
Envia un mensaje dentro de un chat.
Example request:
$client = new \GuzzleHttp\Client();
$url = 'https://calidad.api.atencionprofesional.com/api/chat/sendChatMessage';
$response = $client->post(
$url,
[
'headers' => [
'X-User-Consumo' => 'string required Identificador del cliente de consumo (middleware auth.api_client).',
'X-User-Secret' => 'string required Secreto del cliente de consumo.',
'Authorization' => 'string required Bearer token de autenticacion (auth:sanctum).',
'Content-Type' => 'application/json',
],
'json' => [
'id_chat' => '"chat-123"',
'message' => '"Hola, ¿en que puedo ayudarte?"',
'id_bitacora_log' => 736014,
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));const url = new URL(
"https://calidad.api.atencionprofesional.com/api/chat/sendChatMessage"
);
const headers = {
"X-User-Consumo": "string required Identificador del cliente de consumo (middleware auth.api_client).",
"X-User-Secret": "string required Secreto del cliente de consumo.",
"Authorization": "string required Bearer token de autenticacion (auth:sanctum).",
"Content-Type": "application/json",
"Accept": "application/json",
};
let body = {
"id_chat": "\"chat-123\"",
"message": "\"Hola, ¿en que puedo ayudarte?\"",
"id_bitacora_log": 736014
};
fetch(url, {
method: "POST",
headers,
body: JSON.stringify(body),
}).then(response => response.json());Example response (200):
{
"data": {
"id_message": "msg-2",
"id_chat": "chat-123",
"message": "Hola, ¿en que puedo ayudarte?",
"sender_id": 7
},
"status": "ok",
"message": "Mensaje enviado.",
"code": 200,
"id_bitacora_log": 736014
}
Example response (422):
{
"data": {
"errors": {
"id_chat": [
"El id_chat no se encuentra registrado."
]
}
},
"status": "error",
"message": "Validacion fallida.",
"code": 422,
"id_bitacora_log": 736014
}
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
Marcar mensajes como leidos
requires authentication
Marca un mensaje (o mensajes) de un chat como leidos.
Example request:
$client = new \GuzzleHttp\Client();
$url = 'https://calidad.api.atencionprofesional.com/api/chat/markAsReadMessage';
$response = $client->post(
$url,
[
'headers' => [
'X-User-Consumo' => 'string required Identificador del cliente de consumo (middleware auth.api_client).',
'X-User-Secret' => 'string required Secreto del cliente de consumo.',
'Authorization' => 'string required Bearer token de autenticacion (auth:sanctum).',
'Content-Type' => 'application/json',
],
'json' => [
'id_message' => '"msg-2"',
'id_chat' => '"chat-123"',
'id_bitacora_log' => 736014,
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));const url = new URL(
"https://calidad.api.atencionprofesional.com/api/chat/markAsReadMessage"
);
const headers = {
"X-User-Consumo": "string required Identificador del cliente de consumo (middleware auth.api_client).",
"X-User-Secret": "string required Secreto del cliente de consumo.",
"Authorization": "string required Bearer token de autenticacion (auth:sanctum).",
"Content-Type": "application/json",
"Accept": "application/json",
};
let body = {
"id_message": "\"msg-2\"",
"id_chat": "\"chat-123\"",
"id_bitacora_log": 736014
};
fetch(url, {
method: "POST",
headers,
body: JSON.stringify(body),
}).then(response => response.json());Example response (200):
{
"data": {
"id_message": "msg-2",
"id_chat": "chat-123",
"status": "read"
},
"status": "ok",
"message": "Mensaje marcado como leido.",
"code": 200,
"id_bitacora_log": 736014
}
Example response (422):
{
"data": {
"errors": {
"id_message": [
"El id_message no se encuentra registrado."
]
}
},
"status": "error",
"message": "Validacion fallida.",
"code": 422,
"id_bitacora_log": 736014
}
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
Endpoints sin agrupar
POST api/correo/getConfigCorreos
requires authentication
Example request:
$client = new \GuzzleHttp\Client();
$url = 'https://calidad.api.atencionprofesional.com/api/correo/getConfigCorreos';
$response = $client->post($url);
$body = $response->getBody();
print_r(json_decode((string) $body));const url = new URL(
"https://calidad.api.atencionprofesional.com/api/correo/getConfigCorreos"
);
fetch(url, {
method: "POST",
}).then(response => response.json());Example response (404):
Show headers
cache-control: no-cache, private
content-type: application/json
vary: Origin
{
"error": "Not Found",
"code": 404
}
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
Display a listing of the resource.
requires authentication
Example request:
$client = new \GuzzleHttp\Client();
$url = 'https://calidad.api.atencionprofesional.com/api/deptos/index';
$response = $client->post(
$url,
[
'headers' => [
'Content-Type' => 'application/json',
],
'json' => [
'page' => 'N',
'quantity_x_page' => 13,
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));const url = new URL(
"https://calidad.api.atencionprofesional.com/api/deptos/index"
);
const headers = {
"Content-Type": "application/json",
"Accept": "application/json",
};
let body = {
"page": "N",
"quantity_x_page": 13
};
fetch(url, {
method: "POST",
headers,
body: JSON.stringify(body),
}).then(response => response.json());Example response (404):
Show headers
cache-control: no-cache, private
content-type: application/json
vary: Origin
{
"error": "Not Found",
"code": 404
}
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
GET api/deptos/show/{id}
requires authentication
Example request:
$client = new \GuzzleHttp\Client();
$url = 'https://calidad.api.atencionprofesional.com/api/deptos/show/dignissimos';
$response = $client->get($url);
$body = $response->getBody();
print_r(json_decode((string) $body));const url = new URL(
"https://calidad.api.atencionprofesional.com/api/deptos/show/dignissimos"
);
fetch(url, {
method: "GET",
}).then(response => response.json());Example response (404):
Show headers
cache-control: no-cache, private
content-type: application/json
vary: Origin
{
"error": "Not Found",
"code": 404
}
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
Display a listing of the resource.
requires authentication
Example request:
$client = new \GuzzleHttp\Client();
$url = 'https://calidad.api.atencionprofesional.com/api/company/index';
$response = $client->post(
$url,
[
'headers' => [
'Content-Type' => 'application/json',
],
'json' => [
'page' => 'N',
'quantity_x_page' => 7,
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));const url = new URL(
"https://calidad.api.atencionprofesional.com/api/company/index"
);
const headers = {
"Content-Type": "application/json",
"Accept": "application/json",
};
let body = {
"page": "N",
"quantity_x_page": 7
};
fetch(url, {
method: "POST",
headers,
body: JSON.stringify(body),
}).then(response => response.json());Example response (404):
Show headers
cache-control: no-cache, private
content-type: application/json
vary: Origin
{
"error": "Not Found",
"code": 404
}
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
Display the specified resource.
requires authentication
Example request:
$client = new \GuzzleHttp\Client();
$url = 'https://calidad.api.atencionprofesional.com/api/company/show/veritatis';
$response = $client->get($url);
$body = $response->getBody();
print_r(json_decode((string) $body));const url = new URL(
"https://calidad.api.atencionprofesional.com/api/company/show/veritatis"
);
fetch(url, {
method: "GET",
}).then(response => response.json());Example response (404):
Show headers
cache-control: no-cache, private
content-type: application/json
vary: Origin
{
"error": "Not Found",
"code": 404
}
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
Remove the specified resource from storage.
requires authentication
Example request:
$client = new \GuzzleHttp\Client();
$url = 'https://calidad.api.atencionprofesional.com/api/company/delete/aut';
$response = $client->delete($url);
$body = $response->getBody();
print_r(json_decode((string) $body));const url = new URL(
"https://calidad.api.atencionprofesional.com/api/company/delete/aut"
);
fetch(url, {
method: "DELETE",
}).then(response => response.json());Example response (404):
Show headers
cache-control: no-cache, private
content-type: application/json
vary: Origin
{
"error": "Not Found",
"code": 404
}
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
Display a listing of the resource.
requires authentication
Example request:
$client = new \GuzzleHttp\Client();
$url = 'https://calidad.api.atencionprofesional.com/api/plan/index';
$response = $client->post(
$url,
[
'headers' => [
'Content-Type' => 'application/json',
],
'json' => [
'page' => 'S',
'quantity_x_page' => 6,
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));const url = new URL(
"https://calidad.api.atencionprofesional.com/api/plan/index"
);
const headers = {
"Content-Type": "application/json",
"Accept": "application/json",
};
let body = {
"page": "S",
"quantity_x_page": 6
};
fetch(url, {
method: "POST",
headers,
body: JSON.stringify(body),
}).then(response => response.json());Example response (404):
Show headers
cache-control: no-cache, private
content-type: application/json
vary: Origin
{
"error": "Not Found",
"code": 404
}
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
Guest
Registrar invitado
requires authentication
Crea un usuario invitado y devuelve su token.
Example request:
$client = new \GuzzleHttp\Client();
$url = 'https://calidad.api.atencionprofesional.com/api/guest/store';
$response = $client->post(
$url,
[
'headers' => [
'X-User-Consumo' => 'string required Identificador del cliente de consumo (middleware auth.api_client).',
'X-User-Secret' => 'string required Secreto del cliente de consumo.',
'Content-Type' => 'application/json',
],
'json' => [
'name' => '"Cliente WAP"',
'email' => '"cliente@correo.com"',
'phone' => '"50688888888"',
'id_bitacora_log' => 736014,
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));const url = new URL(
"https://calidad.api.atencionprofesional.com/api/guest/store"
);
const headers = {
"X-User-Consumo": "string required Identificador del cliente de consumo (middleware auth.api_client).",
"X-User-Secret": "string required Secreto del cliente de consumo.",
"Content-Type": "application/json",
"Accept": "application/json",
};
let body = {
"name": "\"Cliente WAP\"",
"email": "\"cliente@correo.com\"",
"phone": "\"50688888888\"",
"id_bitacora_log": 736014
};
fetch(url, {
method: "POST",
headers,
body: JSON.stringify(body),
}).then(response => response.json());Example response (200):
{
"data": {
"usuario": {
"id": 12,
"name": "Cliente WAP",
"email": "cliente@correo.com",
"phone": "50688888888",
"token": "guest-token-123"
},
"token": "guest-token-123"
},
"status": "ok",
"message": "Usuario invitado registrado",
"code": 200,
"id_bitacora_log": 736014
}
Example response (422):
{
"message": "The name field is required."
}
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
Obtener token de chat por telefono
requires authentication
Retorna el token del invitado usando su numero de telefono.
Example request:
$client = new \GuzzleHttp\Client();
$url = 'https://calidad.api.atencionprofesional.com/api/guest/get_token_by_phone/"50688888888"';
$response = $client->get(
$url,
[
'headers' => [
'X-User-Consumo' => 'string required Identificador del cliente de consumo (middleware auth.api_client).',
'X-User-Secret' => 'string required Secreto del cliente de consumo.',
'Authorization' => 'string required Bearer token (auth:sanctum).',
'Content-Type' => 'application/json',
],
'json' => [
'id_bitacora_log' => 736014,
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));const url = new URL(
"https://calidad.api.atencionprofesional.com/api/guest/get_token_by_phone/"50688888888""
);
const headers = {
"X-User-Consumo": "string required Identificador del cliente de consumo (middleware auth.api_client).",
"X-User-Secret": "string required Secreto del cliente de consumo.",
"Authorization": "string required Bearer token (auth:sanctum).",
"Content-Type": "application/json",
"Accept": "application/json",
};
let body = {
"id_bitacora_log": 736014
};
fetch(url, {
method: "GET",
headers,
body: JSON.stringify(body),
}).then(response => response.json());Example response (200):
{
"data": {
"token": "guest-token-123"
},
"status": "ok",
"message": "Consulta Token Invitado",
"code": 200,
"id_bitacora_log": 736014
}
Example response (400):
{
"status": "error",
"message": "Usuario no encontrado",
"code": 400,
"id_bitacora_log": 736014
}
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
Meta WhatsApp
Enviar mensaje WAP
requires authentication
Envía texto o media a traves de WhatsApp (Meta). Requiere autenticacion.
Example request:
$client = new \GuzzleHttp\Client();
$url = 'https://calidad.api.atencionprofesional.com/api/meta/sendMessagesWAP';
$response = $client->post(
$url,
[
'headers' => [
'X-User-Consumo' => 'string required Identificador del cliente de consumo (middleware auth.api_client).',
'X-User-Secret' => 'string required Secreto del cliente de consumo.',
'Authorization' => 'string required Bearer token (auth:sanctum).',
'Content-Type' => 'application/json',
],
'json' => [
'whatsapp_channel' => '"12"',
'to' => '"50688888888"',
'message' => '"Hola desde Meta"',
'tokenGuest' => '"guest-token"',
'file' => '"data:image/png;base64,iVBORw0KGgoAAA..."',
'id_bitacora_log' => 736014,
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));const url = new URL(
"https://calidad.api.atencionprofesional.com/api/meta/sendMessagesWAP"
);
const headers = {
"X-User-Consumo": "string required Identificador del cliente de consumo (middleware auth.api_client).",
"X-User-Secret": "string required Secreto del cliente de consumo.",
"Authorization": "string required Bearer token (auth:sanctum).",
"Content-Type": "application/json",
"Accept": "application/json",
};
let body = {
"whatsapp_channel": "\"12\"",
"to": "\"50688888888\"",
"message": "\"Hola desde Meta\"",
"tokenGuest": "\"guest-token\"",
"file": "\"data:image\/png;base64,iVBORw0KGgoAAA...\"",
"id_bitacora_log": 736014
};
fetch(url, {
method: "POST",
headers,
body: JSON.stringify(body),
}).then(response => response.json());Example response (200):
{
"data": {},
"status": "ok",
"message": "Mensaje Meta Enviado",
"code": 200,
"id_bitacora_log": 736014
}
Example response (401):
{
"message": "Unauthenticated."
}
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
Listar canales WhatsApp (Meta)
requires authentication
Devuelve los canales whatsappfb activos.
Example request:
$client = new \GuzzleHttp\Client();
$url = 'https://calidad.api.atencionprofesional.com/api/meta/getChannelSettingsList';
$response = $client->get(
$url,
[
'headers' => [
'X-User-Consumo' => 'string required Identificador del cliente de consumo (middleware auth.api_client).',
'X-User-Secret' => 'string required Secreto del cliente de consumo.',
'Authorization' => 'string required Bearer token (auth:sanctum).',
'Content-Type' => 'application/json',
],
'json' => [
'id_bitacora_log' => 736014,
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));const url = new URL(
"https://calidad.api.atencionprofesional.com/api/meta/getChannelSettingsList"
);
const headers = {
"X-User-Consumo": "string required Identificador del cliente de consumo (middleware auth.api_client).",
"X-User-Secret": "string required Secreto del cliente de consumo.",
"Authorization": "string required Bearer token (auth:sanctum).",
"Content-Type": "application/json",
"Accept": "application/json",
};
let body = {
"id_bitacora_log": 736014
};
fetch(url, {
method: "GET",
headers,
body: JSON.stringify(body),
}).then(response => response.json());Example response (200):
{
"data": [
{
"id_channel": 1,
"name": "Canal WAP",
"uuid": "abc-123",
"company": 3,
"type": "whatsappfb",
"channel_status": 1
}
],
"status": "ok",
"message": "Mensaje Meta Enviado",
"code": 200,
"id_bitacora_log": 736014
}
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
Webhook de mensajes WAP (Meta)
Recibe eventos entrantes de WhatsApp (Meta). Publico sin auth.
Example request:
$client = new \GuzzleHttp\Client();
$url = 'https://calidad.api.atencionprofesional.com/api/meta/readMessagesWAP';
$response = $client->post($url);
$body = $response->getBody();
print_r(json_decode((string) $body));const url = new URL(
"https://calidad.api.atencionprofesional.com/api/meta/readMessagesWAP"
);
fetch(url, {
method: "POST",
}).then(response => response.json());Example response (200):
{
"data": {
"guest": {},
"file": null
},
"status": "ok",
"message": "Mensaje Meta Recibido",
"code": 200,
"id_bitacora_log": 736014
}
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
Obtener archivo WAP
Devuelve un archivo multimedia recibido de Meta.
Example request:
$client = new \GuzzleHttp\Client();
$url = 'https://calidad.api.atencionprofesional.com/api/meta/getMediaFile';
$response = $client->get(
$url,
[
'query' => [
'filename' => '"photo_12345.jpg"',
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));const url = new URL(
"https://calidad.api.atencionprofesional.com/api/meta/getMediaFile"
);
const params = {
"filename": ""photo_12345.jpg"",
};
Object.keys(params)
.forEach(key => url.searchParams.append(key, params[key]));
fetch(url, {
method: "GET",
}).then(response => response.json());Example response (200):
binary
Example response (400):
{
"status": "error",
"message": "Archivo no encontrado"
}
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
SuperAdmin Canales
Listar canales
requires authentication
Devuelve los canales de una empresa con filtros y paginacion opcional.
Example request:
$client = new \GuzzleHttp\Client();
$url = 'https://calidad.api.atencionprofesional.com/api/admin/channels/list';
$response = $client->post(
$url,
[
'headers' => [
'X-User-Consumo' => 'string required Identificador del cliente de consumo (middleware auth.api_client).',
'X-User-Secret' => 'string required Secreto del cliente de consumo.',
'Content-Type' => 'application/json',
],
'json' => [
'id_company' => 3,
'paginate' => '"S"',
'page' => 1,
'quantity_x_page' => 10,
'filters' => [
'name' => 'Canal',
'type' => 'telegram',
'uuid' => 'abc-123',
'app_id' => 'whatsapp-app',
],
'id_bitacora_log' => 736014,
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));const url = new URL(
"https://calidad.api.atencionprofesional.com/api/admin/channels/list"
);
const headers = {
"X-User-Consumo": "string required Identificador del cliente de consumo (middleware auth.api_client).",
"X-User-Secret": "string required Secreto del cliente de consumo.",
"Content-Type": "application/json",
"Accept": "application/json",
};
let body = {
"id_company": 3,
"paginate": "\"S\"",
"page": 1,
"quantity_x_page": 10,
"filters": {
"name": "Canal",
"type": "telegram",
"uuid": "abc-123",
"app_id": "whatsapp-app"
},
"id_bitacora_log": 736014
};
fetch(url, {
method: "POST",
headers,
body: JSON.stringify(body),
}).then(response => response.json());Example response (200, Listado paginado):
{
"data": {
"current_page": 1,
"data": [
{
"id_channel": 9,
"company": 3,
"name": "WhatsApp Principal",
"app": "whatsapp-business",
"uuid": "c169c38d-a790-4a6f-8da0-6f5e3c2f9c0a",
"type": "whatsapp",
"token": "****",
"channel_status": 1
}
],
"from": 1,
"last_page": 1,
"per_page": 10,
"to": 1,
"total": 1
},
"status": "ok",
"message": "Canales listados correctamente.",
"code": 200,
"id_bitacora_log": 736014
}
Example response (200, Listado sin paginar):
{
"data": [
{
"id_channel": 9,
"company": 3,
"name": "WhatsApp Principal",
"app": "whatsapp-business",
"uuid": "c169c38d-a790-4a6f-8da0-6f5e3c2f9c0a",
"type": "whatsapp",
"token": "****",
"channel_status": 1
}
],
"status": "ok",
"message": "Canales listados correctamente.",
"code": 200,
"id_bitacora_log": 736014
}
Example response (422):
{
"data": {
"errors": {
"id_company": [
"El id de la empresa es obligatorio."
]
}
},
"status": "error",
"message": "Errores de validacion.",
"code": 422,
"id_bitacora_log": 736014
}
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
Crear canal
requires authentication
Crea un canal para una empresa.
Example request:
$client = new \GuzzleHttp\Client();
$url = 'https://calidad.api.atencionprofesional.com/api/admin/channels/store';
$response = $client->post(
$url,
[
'headers' => [
'X-User-Consumo' => 'string required Identificador del cliente de consumo (middleware auth.api_client).',
'X-User-Secret' => 'string required Secreto del cliente de consumo.',
'Content-Type' => 'application/json',
],
'json' => [
'id_company' => 3,
'name' => '"WhatsApp Principal"',
'app' => '"whatsapp-business"',
'type' => '"whatsapp"',
'token' => '"EAA..."',
'id_bitacora_log' => 736014,
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));const url = new URL(
"https://calidad.api.atencionprofesional.com/api/admin/channels/store"
);
const headers = {
"X-User-Consumo": "string required Identificador del cliente de consumo (middleware auth.api_client).",
"X-User-Secret": "string required Secreto del cliente de consumo.",
"Content-Type": "application/json",
"Accept": "application/json",
};
let body = {
"id_company": 3,
"name": "\"WhatsApp Principal\"",
"app": "\"whatsapp-business\"",
"type": "\"whatsapp\"",
"token": "\"EAA...\"",
"id_bitacora_log": 736014
};
fetch(url, {
method: "POST",
headers,
body: JSON.stringify(body),
}).then(response => response.json());Example response (200):
{
"data": {
"id_channel": 9,
"company": 3,
"name": "WhatsApp Principal",
"app": "whatsapp-business",
"uuid": "c169c38d-a790-4a6f-8da0-6f5e3c2f9c0a",
"type": "whatsapp",
"token": "****",
"channel_status": 1
},
"status": "ok",
"message": "Canal actualizado correctamente.",
"code": 200,
"id_bitacora_log": 736014
}
Example response (422):
{
"data": {
"errors": {
"token": [
"El token es obligatorio salvo cuando el tipo es telegram."
]
}
},
"status": "error",
"message": "Errores de validacion.",
"code": 422,
"id_bitacora_log": 736014
}
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
Actualizar canal
requires authentication
Actualiza parcialmente un canal (nombre, app, tipo, token, secret_key, additional_app_id).
Example request:
$client = new \GuzzleHttp\Client();
$url = 'https://calidad.api.atencionprofesional.com/api/admin/channels/update';
$response = $client->patch(
$url,
[
'headers' => [
'X-User-Consumo' => 'string required Identificador del cliente de consumo (middleware auth.api_client).',
'X-User-Secret' => 'string required Secreto del cliente de consumo.',
'Content-Type' => 'application/json',
],
'json' => [
'id_channel' => 9,
'id_company' => 3,
'name' => '"WhatsApp Secundario"',
'app' => '"whatsapp-business-2"',
'type' => '"whatsapp"',
'token' => '"EAA..."',
'secret_key' => '"shh-123"',
'additional_app_id' => '"app-aux-01"',
'id_bitacora_log' => 736014,
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));const url = new URL(
"https://calidad.api.atencionprofesional.com/api/admin/channels/update"
);
const headers = {
"X-User-Consumo": "string required Identificador del cliente de consumo (middleware auth.api_client).",
"X-User-Secret": "string required Secreto del cliente de consumo.",
"Content-Type": "application/json",
"Accept": "application/json",
};
let body = {
"id_channel": 9,
"id_company": 3,
"name": "\"WhatsApp Secundario\"",
"app": "\"whatsapp-business-2\"",
"type": "\"whatsapp\"",
"token": "\"EAA...\"",
"secret_key": "\"shh-123\"",
"additional_app_id": "\"app-aux-01\"",
"id_bitacora_log": 736014
};
fetch(url, {
method: "PATCH",
headers,
body: JSON.stringify(body),
}).then(response => response.json());Example response (200, Actualizado):
{
"data": {
"id_channel": 9,
"company": 3,
"name": "WhatsApp Secundario",
"app": "whatsapp-business-2",
"type": "whatsapp",
"token": "****",
"uuid": "c169c38d-a790-4a6f-8da0-6f5e3c2f9c0a",
"secret_key": "shh-123",
"additional_app_id": "app-aux-01",
"channel_status": 1
},
"status": "ok",
"message": "Canal actualizado correctamente.",
"code": 200,
"id_bitacora_log": 736014
}
Example response (404):
{
"data": null,
"status": "error",
"message": "El canal no pertenece al cliente indicado o no existe.",
"code": 404,
"id_bitacora_log": 736014
}
Example response (422):
{
"data": {
"errors": {
"general": [
"Debe editar al menos un campo."
]
}
},
"status": "error",
"message": "Parametros invalidos.",
"code": 422,
"id_bitacora_log": 736014
}
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
Buscar canal
requires authentication
Obtiene el detalle de un canal por empresa, id y tipo.
Example request:
$client = new \GuzzleHttp\Client();
$url = 'https://calidad.api.atencionprofesional.com/api/admin/channels/show';
$response = $client->get(
$url,
[
'headers' => [
'X-User-Consumo' => 'string required Identificador del cliente de consumo (middleware auth.api_client).',
'X-User-Secret' => 'string required Secreto del cliente de consumo.',
'Content-Type' => 'application/json',
],
'json' => [
'id_company' => 3,
'id_channel' => 9,
'type_channel' => '"whatsapp"',
'id_bitacora_log' => 736014,
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));const url = new URL(
"https://calidad.api.atencionprofesional.com/api/admin/channels/show"
);
const headers = {
"X-User-Consumo": "string required Identificador del cliente de consumo (middleware auth.api_client).",
"X-User-Secret": "string required Secreto del cliente de consumo.",
"Content-Type": "application/json",
"Accept": "application/json",
};
let body = {
"id_company": 3,
"id_channel": 9,
"type_channel": "\"whatsapp\"",
"id_bitacora_log": 736014
};
fetch(url, {
method: "GET",
headers,
body: JSON.stringify(body),
}).then(response => response.json());Example response (200):
{
"data": {
"id_channel": 9,
"company": 3,
"name": "WhatsApp Principal",
"app": "whatsapp-business",
"uuid": "c169c38d-a790-4a6f-8da0-6f5e3c2f9c0a",
"type": "whatsapp",
"token": "****",
"channel_status": 1
},
"status": "ok",
"message": "",
"code": 200,
"id_bitacora_log": 736014
}
Example response (404):
{
"data": null,
"status": "error",
"message": "Canal no encontrado para los criterios enviados.",
"code": 404,
"id_bitacora_log": 736014
}
Example response (422):
{
"data": {
"errors": {
"id_channel": [
"El parametro id_channel es obligatorio."
]
}
},
"status": "error",
"message": "Errores de validacion.",
"code": 422,
"id_bitacora_log": 736014
}
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
Actualizar estado del canal
requires authentication
Activa o inactiva un canal.
Example request:
$client = new \GuzzleHttp\Client();
$url = 'https://calidad.api.atencionprofesional.com/api/admin/channels/update-status';
$response = $client->patch(
$url,
[
'headers' => [
'X-User-Consumo' => 'string required Identificador del cliente de consumo (middleware auth.api_client).',
'X-User-Secret' => 'string required Secreto del cliente de consumo.',
'Content-Type' => 'application/json',
],
'json' => [
'id_channel' => 9,
'channel_status' => 1,
'id_bitacora_log' => 736014,
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));const url = new URL(
"https://calidad.api.atencionprofesional.com/api/admin/channels/update-status"
);
const headers = {
"X-User-Consumo": "string required Identificador del cliente de consumo (middleware auth.api_client).",
"X-User-Secret": "string required Secreto del cliente de consumo.",
"Content-Type": "application/json",
"Accept": "application/json",
};
let body = {
"id_channel": 9,
"channel_status": 1,
"id_bitacora_log": 736014
};
fetch(url, {
method: "PATCH",
headers,
body: JSON.stringify(body),
}).then(response => response.json());Example response (200, Estado actualizado):
{
"data": {
"id_channel": 9,
"channel_status": 0
},
"status": "ok",
"message": "Estado de canal actualizado correctamente.",
"code": 200,
"id_bitacora_log": 736014
}
Example response (200, Sin cambios):
{
"data": {
"id_channel": 9,
"channel_status": 1
},
"status": "ok",
"message": "Sin cambios: el canal ya se encuentra en el estado solicitado.",
"code": 200,
"id_bitacora_log": 736014
}
Example response (404):
{
"data": null,
"status": "error",
"message": "El canal indicado no existe.",
"code": 404,
"id_bitacora_log": 736014
}
Example response (422):
{
"data": {
"errors": {
"channel_status": [
"El estado debe ser 0 (Inactivo) o 1 (Activo)."
]
}
},
"status": "error",
"message": "Errores de validacion.",
"code": 422,
"id_bitacora_log": 736014
}
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
SuperAdmin Clientes
Listar clientes
requires authentication
Devuelve clientes con filtros y paginacion opcional.
Example request:
$client = new \GuzzleHttp\Client();
$url = 'https://calidad.api.atencionprofesional.com/api/admin/clients/list';
$response = $client->post(
$url,
[
'headers' => [
'X-User-Consumo' => 'string required Identificador del cliente de consumo (middleware auth.api_client).',
'X-User-Secret' => 'string required Secreto del cliente de consumo.',
'Content-Type' => 'application/json',
],
'json' => [
'paginate' => '"S"',
'page' => 1,
'quantity_x_page' => 10,
'filters' => [
'name' => 'Empresa',
'email' => 'contacto@empresa.com',
'token' => 'abc',
'plan' => 'Basico',
],
'id_bitacora_log' => 736014,
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));const url = new URL(
"https://calidad.api.atencionprofesional.com/api/admin/clients/list"
);
const headers = {
"X-User-Consumo": "string required Identificador del cliente de consumo (middleware auth.api_client).",
"X-User-Secret": "string required Secreto del cliente de consumo.",
"Content-Type": "application/json",
"Accept": "application/json",
};
let body = {
"paginate": "\"S\"",
"page": 1,
"quantity_x_page": 10,
"filters": {
"name": "Empresa",
"email": "contacto@empresa.com",
"token": "abc",
"plan": "Basico"
},
"id_bitacora_log": 736014
};
fetch(url, {
method: "POST",
headers,
body: JSON.stringify(body),
}).then(response => response.json());Example response (200, Listado paginado):
{
"data": {
"current_page": 1,
"data": [
{
"id": 5,
"name": "Empresa Demo",
"email": "demo@empresa.com",
"token": "2c359f63-95b5-4a6c-a507-7f2bfa0c3c9a",
"id_plan": 1,
"balance": 0,
"pay_day": "2024-12-15 00:00:00",
"api": 0,
"messenger": 0,
"telegram": 0
}
],
"from": 1,
"last_page": 1,
"per_page": 10,
"to": 1,
"total": 1
},
"status": "success",
"message": "Operacion exitosa",
"code": 200,
"id_bitacora_log": 736014
}
Example response (200, Listado sin paginar):
{
"data": [
{
"id": 5,
"name": "Empresa Demo",
"email": "demo@empresa.com",
"token": "2c359f63-95b5-4a6c-a507-7f2bfa0c3c9a",
"id_plan": 1,
"balance": 0,
"pay_day": "2024-12-15 00:00:00",
"api": 0,
"messenger": 0,
"telegram": 0
}
],
"status": "success",
"message": "Operacion exitosa",
"code": 200,
"id_bitacora_log": 736014
}
Example response (422):
{
"data": {
"errors": {
"paginate": [
"El campo paginate debe ser \"S\" o \"N\"."
]
}
},
"status": "error",
"message": "Errores de validacion.",
"code": 422,
"id_bitacora_log": 736014
}
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
Crear cliente
requires authentication
Crea un cliente, su departamento GENERAL y el usuario administrador inicial.
Example request:
$client = new \GuzzleHttp\Client();
$url = 'https://calidad.api.atencionprofesional.com/api/admin/clients/store';
$response = $client->post(
$url,
[
'headers' => [
'X-User-Consumo' => 'string required Identificador del cliente de consumo (middleware auth.api_client).',
'X-User-Secret' => 'string required Secreto del cliente de consumo.',
'Content-Type' => 'application/json',
],
'json' => [
'name' => '"Empresa Demo"',
'email' => '"demo@empresa.com"',
'id_plan' => 2,
'balance' => '0',
'pay_day' => '"2024-12-15"',
'user_name' => '"Admin Demo"',
'user_email' => '"admin@empresa.com"',
'password' => '"Secret123"',
'id_bitacora_log' => 736014,
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));const url = new URL(
"https://calidad.api.atencionprofesional.com/api/admin/clients/store"
);
const headers = {
"X-User-Consumo": "string required Identificador del cliente de consumo (middleware auth.api_client).",
"X-User-Secret": "string required Secreto del cliente de consumo.",
"Content-Type": "application/json",
"Accept": "application/json",
};
let body = {
"name": "\"Empresa Demo\"",
"email": "\"demo@empresa.com\"",
"id_plan": 2,
"balance": "0",
"pay_day": "\"2024-12-15\"",
"user_name": "\"Admin Demo\"",
"user_email": "\"admin@empresa.com\"",
"password": "\"Secret123\"",
"id_bitacora_log": 736014
};
fetch(url, {
method: "POST",
headers,
body: JSON.stringify(body),
}).then(response => response.json());Example response (201):
{
"data": {
"company": {
"id": 10,
"name": "Empresa Demo",
"email": "demo@empresa.com",
"token": "0d2b4f5e-8c3f-4a4e-9c5d-2b5a4c1d9e6f",
"id_plan": 2,
"pay_day": "2024-12-15 00:00:00",
"balance": 0
},
"department": {
"id_department": 21,
"department_name": "GENERAL"
},
"user": {
"id": 33,
"name": "Admin Demo",
"email": "admin@empresa.com",
"type": "2",
"company": 10,
"department": 21
},
"faq": {
"id_faq": 5
}
},
"status": "ok",
"message": "Cliente creado correctamente.",
"code": 201,
"id_bitacora_log": 736014
}
Example response (409):
{
"data": {
"errors": {
"duplicate": [
"Registro duplicado. Verifique correos o token."
]
}
},
"status": "error",
"message": "Conflicto de unicidad.",
"code": 409,
"id_bitacora_log": 736014
}
Example response (422):
{
"data": {
"errors": {
"email": [
"El correo de la compania es obligatorio."
]
}
},
"status": "error",
"message": "Errores de validacion.",
"code": 422,
"id_bitacora_log": 736014
}
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
Actualizar cliente
requires authentication
Actualiza parcialmente datos del cliente (nombre, correo, balance, fecha de pago, plan, flags de acceso).
Example request:
$client = new \GuzzleHttp\Client();
$url = 'https://calidad.api.atencionprofesional.com/api/admin/clients/update';
$response = $client->patch(
$url,
[
'headers' => [
'X-User-Consumo' => 'string required Identificador del cliente de consumo (middleware auth.api_client).',
'X-User-Secret' => 'string required Secreto del cliente de consumo.',
'Content-Type' => 'application/json',
],
'json' => [
'id' => 10,
'name' => '"Empresa Demo 2"',
'email' => '"demo2@empresa.com"',
'balance' => '150.75',
'pay_day' => '"2024-12-20"',
'id_plan' => 3,
'api' => 1,
'messenger' => 0,
'telegram' => 1,
'id_bitacora_log' => 736014,
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));const url = new URL(
"https://calidad.api.atencionprofesional.com/api/admin/clients/update"
);
const headers = {
"X-User-Consumo": "string required Identificador del cliente de consumo (middleware auth.api_client).",
"X-User-Secret": "string required Secreto del cliente de consumo.",
"Content-Type": "application/json",
"Accept": "application/json",
};
let body = {
"id": 10,
"name": "\"Empresa Demo 2\"",
"email": "\"demo2@empresa.com\"",
"balance": "150.75",
"pay_day": "\"2024-12-20\"",
"id_plan": 3,
"api": 1,
"messenger": 0,
"telegram": 1,
"id_bitacora_log": 736014
};
fetch(url, {
method: "PATCH",
headers,
body: JSON.stringify(body),
}).then(response => response.json());Example response (200, Actualizado):
{
"data": {
"id": 10,
"name": "Empresa Demo 2",
"email": "demo2@empresa.com",
"balance": 150.75,
"pay_day": "2024-12-20 00:00:00",
"id_plan": 3,
"api": 1,
"messenger": 0,
"telegram": 1
},
"status": "ok",
"message": "Cliente actualizado correctamente.",
"code": 200,
"id_bitacora_log": 736014
}
Example response (200, Sin cambios):
{
"data": {
"id": 10,
"name": "Empresa Demo",
"email": "demo@empresa.com",
"balance": 0,
"pay_day": "2024-12-15 00:00:00",
"id_plan": 2,
"api": 0,
"messenger": 0,
"telegram": 0
},
"status": "ok",
"message": "No hubo cambios; los valores ya estaban aplicados.",
"code": 200,
"id_bitacora_log": 736014
}
Example response (404):
{
"data": [],
"status": "error",
"message": "El cliente indicado no existe.",
"code": 404,
"id_bitacora_log": 736014
}
Example response (422):
{
"data": {
"errors": {
"id": [
"El id del cliente es obligatorio."
]
}
},
"status": "error",
"message": "Errores de validacion.",
"code": 422,
"id_bitacora_log": 736014
}
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
Buscar cliente
requires authentication
Obtiene el detalle de un cliente por su identificador.
Example request:
$client = new \GuzzleHttp\Client();
$url = 'https://calidad.api.atencionprofesional.com/api/admin/clients/search';
$response = $client->post(
$url,
[
'headers' => [
'X-User-Consumo' => 'string required Identificador del cliente de consumo (middleware auth.api_client).',
'X-User-Secret' => 'string required Secreto del cliente de consumo.',
'Content-Type' => 'application/json',
],
'json' => [
'id_company' => 10,
'id_bitacora_log' => 736014,
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));const url = new URL(
"https://calidad.api.atencionprofesional.com/api/admin/clients/search"
);
const headers = {
"X-User-Consumo": "string required Identificador del cliente de consumo (middleware auth.api_client).",
"X-User-Secret": "string required Secreto del cliente de consumo.",
"Content-Type": "application/json",
"Accept": "application/json",
};
let body = {
"id_company": 10,
"id_bitacora_log": 736014
};
fetch(url, {
method: "POST",
headers,
body: JSON.stringify(body),
}).then(response => response.json());Example response (200):
{
"data": {
"id_client": 10,
"name_client": "Empresa Demo",
"email": "demo@empresa.com",
"balance": 0,
"billing_day": "2024-12-15",
"id_plan": 2,
"access_api": false,
"access_messenger": false,
"access_telegram": false
},
"status": "ok",
"message": "",
"code": 200,
"id_bitacora_log": 736014
}
Example response (404):
{
"data": [],
"status": "error",
"message": "Cliente no encontrado",
"code": 404,
"id_bitacora_log": 736014
}
Example response (422):
{
"data": {
"errors": {
"id_company": [
"El ID del cliente es obligatorio."
]
}
},
"status": "error",
"message": "Errores de validacion.",
"code": 422,
"id_bitacora_log": 736014
}
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
SuperAdmin Departamentos
Listar departamentos
requires authentication
Devuelve los departamentos con filtros y paginacion opcional.
Example request:
$client = new \GuzzleHttp\Client();
$url = 'https://calidad.api.atencionprofesional.com/api/admin/departments/list';
$response = $client->post(
$url,
[
'headers' => [
'X-User-Consumo' => 'string required Identificador del cliente de consumo (middleware auth.api_client).',
'X-User-Secret' => 'string required Secreto del cliente de consumo.',
'Content-Type' => 'application/json',
],
'json' => [
'paginate' => '"S"',
'page' => 1,
'quantity_x_page' => 10,
'filters' => [
'name' => 'Soporte',
'id_company' => 3,
'hour' => '"08:00"',
],
'id_bitacora_log' => 736014,
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));const url = new URL(
"https://calidad.api.atencionprofesional.com/api/admin/departments/list"
);
const headers = {
"X-User-Consumo": "string required Identificador del cliente de consumo (middleware auth.api_client).",
"X-User-Secret": "string required Secreto del cliente de consumo.",
"Content-Type": "application/json",
"Accept": "application/json",
};
let body = {
"paginate": "\"S\"",
"page": 1,
"quantity_x_page": 10,
"filters": {
"name": "Soporte",
"id_company": 3,
"hour": "\"08:00\""
},
"id_bitacora_log": 736014
};
fetch(url, {
method: "POST",
headers,
body: JSON.stringify(body),
}).then(response => response.json());Example response (200, Listado paginado):
{
"data": {
"current_page": 1,
"data": [
{
"id_department": 7,
"uuid": "c169c38d-a790-4a6f-8da0-6f5e3c2f9c0a",
"company": 3,
"department_name": "Soporte",
"hour": ""
}
],
"from": 1,
"last_page": 1,
"per_page": 10,
"to": 1,
"total": 1
},
"status": "success",
"message": "Operacion exitosa",
"code": 200,
"id_bitacora_log": 736014
}
Example response (200, Listado sin paginar):
{
"data": [
{
"id_department": 7,
"uuid": "c169c38d-a790-4a6f-8da0-6f5e3c2f9c0a",
"company": 3,
"department_name": "Soporte",
"hour": ""
}
],
"status": "success",
"message": "Operacion exitosa",
"code": 200,
"id_bitacora_log": 736014
}
Example response (422):
{
"data": {
"errors": {
"quantity_x_page": [
"quantity_x_page es obligatorio cuando paginate es \"S\"."
]
}
},
"status": "error",
"message": "Errores de validacion.",
"code": 422,
"id_bitacora_log": 736014
}
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
Crear departamento
requires authentication
Crea un departamento para la empresa indicada.
Example request:
$client = new \GuzzleHttp\Client();
$url = 'https://calidad.api.atencionprofesional.com/api/admin/departments/store';
$response = $client->post(
$url,
[
'headers' => [
'X-User-Consumo' => 'string required Identificador del cliente de consumo (middleware auth.api_client).',
'X-User-Secret' => 'string required Secreto del cliente de consumo.',
'Content-Type' => 'application/json',
],
'json' => [
'company' => 3,
'department_name' => '"Soporte Tecnico"',
'hour' => [
'lunes_apertura' => '08:00',
'lunes_cierre' => '17:00',
'defecto' => 'Fuera de horario',
'email' => 'soporte@empresa.com',
],
'id_bitacora_log' => 736014,
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));const url = new URL(
"https://calidad.api.atencionprofesional.com/api/admin/departments/store"
);
const headers = {
"X-User-Consumo": "string required Identificador del cliente de consumo (middleware auth.api_client).",
"X-User-Secret": "string required Secreto del cliente de consumo.",
"Content-Type": "application/json",
"Accept": "application/json",
};
let body = {
"company": 3,
"department_name": "\"Soporte Tecnico\"",
"hour": {
"lunes_apertura": "08:00",
"lunes_cierre": "17:00",
"defecto": "Fuera de horario",
"email": "soporte@empresa.com"
},
"id_bitacora_log": 736014
};
fetch(url, {
method: "POST",
headers,
body: JSON.stringify(body),
}).then(response => response.json());Example response (201):
{
"data": {
"id_department": 12,
"uuid": "3c4c8c0a-32e3-4d14-9a2a-6c4d8b8e4a50",
"company": 3,
"department_name": "Soporte Tecnico",
"hour": {
"lunes_apertura": "08:00",
"lunes_cierre": "17:00",
"defecto": "Fuera de horario",
"email": "soporte@empresa.com"
}
},
"status": "ok",
"message": "Departamento creado correctamente.",
"code": 201,
"id_bitacora_log": 736014
}
Example response (409):
{
"data": [],
"status": "error",
"message": "Ya existe un departamento con ese nombre para esta compania.",
"code": 409,
"id_bitacora_log": 736014
}
Example response (422):
{
"data": {
"errors": {
"department_name": [
"El nombre del departamento es obligatorio."
]
}
},
"status": "error",
"message": "Validacion fallida.",
"code": 422,
"id_bitacora_log": 736014
}
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
Actualizar departamento
requires authentication
Permite cambiar el nombre y/o el horario de un departamento existente.
Example request:
$client = new \GuzzleHttp\Client();
$url = 'https://calidad.api.atencionprofesional.com/api/admin/departments/update';
$response = $client->patch(
$url,
[
'headers' => [
'X-User-Consumo' => 'string required Identificador del cliente de consumo (middleware auth.api_client).',
'X-User-Secret' => 'string required Secreto del cliente de consumo.',
'Content-Type' => 'application/json',
],
'json' => [
'id_department' => 7,
'department_name' => '"Soporte Nivel 2"',
'hour' => [
'lunes_apertura' => '09:00',
'lunes_cierre' => '18:00',
'martes_apertura' => ':03:45',
'miercoles_apertura' => ':12|22):00',
'jueves_apertura' => ':07:29',
'viernes_apertura' => ':00|22):51',
'sabado_apertura' => '21:10',
'domingo_apertura' => ':19:12',
'martes_cierre' => ':14:28',
'miercoles_cierre' => '22:47',
'jueves_cierre' => ':04|22):09',
'viernes_cierre' => ':16|21):40',
'sabado_cierre' => ':03|20):50',
'domingo_cierre' => ':19|23):11',
'defecto' => 'uwdudlevfzphaihifbweza',
'email' => 'okuneva.cleve@example.org',
],
'id_bitacora_log' => 736014,
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));const url = new URL(
"https://calidad.api.atencionprofesional.com/api/admin/departments/update"
);
const headers = {
"X-User-Consumo": "string required Identificador del cliente de consumo (middleware auth.api_client).",
"X-User-Secret": "string required Secreto del cliente de consumo.",
"Content-Type": "application/json",
"Accept": "application/json",
};
let body = {
"id_department": 7,
"department_name": "\"Soporte Nivel 2\"",
"hour": {
"lunes_apertura": "09:00",
"lunes_cierre": "18:00",
"martes_apertura": ":03:45",
"miercoles_apertura": ":12|22):00",
"jueves_apertura": ":07:29",
"viernes_apertura": ":00|22):51",
"sabado_apertura": "21:10",
"domingo_apertura": ":19:12",
"martes_cierre": ":14:28",
"miercoles_cierre": "22:47",
"jueves_cierre": ":04|22):09",
"viernes_cierre": ":16|21):40",
"sabado_cierre": ":03|20):50",
"domingo_cierre": ":19|23):11",
"defecto": "uwdudlevfzphaihifbweza",
"email": "okuneva.cleve@example.org"
},
"id_bitacora_log": 736014
};
fetch(url, {
method: "PATCH",
headers,
body: JSON.stringify(body),
}).then(response => response.json());Example response (200):
{
"data": {
"id_department": 7,
"company": 3,
"department_name": "Soporte Nivel 2",
"hour": {
"lunes_apertura": "09:00",
"lunes_cierre": "18:00"
}
},
"status": "ok",
"message": "Departamento actualizado correctamente.",
"code": 200,
"id_bitacora_log": 736014
}
Example response (404):
{
"data": null,
"status": "error",
"message": "El departamento indicado no existe.",
"code": 404,
"id_bitacora_log": 736014
}
Example response (409):
{
"data": null,
"status": "error",
"message": "Ya existe un departamento con ese nombre en la empresa.",
"code": 409,
"id_bitacora_log": 736014
}
Example response (422, Sin campos a actualizar):
{
"data": {
"errors": {
"payload": [
"Debe enviar al menos un atributo a actualizar (department_name u hour)."
]
}
},
"status": "error",
"message": "Validacion de negocio.",
"code": 422,
"id_bitacora_log": 736014
}
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
Actualizar estado del departamento
requires authentication
Activa o inactiva un departamento.
Example request:
$client = new \GuzzleHttp\Client();
$url = 'https://calidad.api.atencionprofesional.com/api/admin/departments/update-status';
$response = $client->patch(
$url,
[
'headers' => [
'X-User-Consumo' => 'string required Identificador del cliente de consumo (middleware auth.api_client).',
'X-User-Secret' => 'string required Secreto del cliente de consumo.',
'Content-Type' => 'application/json',
],
'json' => [
'id_department' => 7,
'status' => 1,
'id_bitacora_log' => 736014,
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));const url = new URL(
"https://calidad.api.atencionprofesional.com/api/admin/departments/update-status"
);
const headers = {
"X-User-Consumo": "string required Identificador del cliente de consumo (middleware auth.api_client).",
"X-User-Secret": "string required Secreto del cliente de consumo.",
"Content-Type": "application/json",
"Accept": "application/json",
};
let body = {
"id_department": 7,
"status": 1,
"id_bitacora_log": 736014
};
fetch(url, {
method: "PATCH",
headers,
body: JSON.stringify(body),
}).then(response => response.json());Example response (200, Estado actualizado):
{
"data": {
"id_department": 7,
"status": 0
},
"status": "ok",
"message": "Estado del departamento actualizado correctamente.",
"code": 200,
"id_bitacora_log": 736014
}
Example response (200, Sin cambios):
{
"data": {
"id_department": 7,
"status": 1
},
"status": "ok",
"message": "El estado enviado es igual al actual. No se realizo ningun cambio.",
"code": 200,
"id_bitacora_log": 736014
}
Example response (404):
{
"data": [],
"status": "error",
"message": "Departamento no encontrado.",
"code": 404,
"id_bitacora_log": 736014
}
Example response (422):
{
"data": {
"errors": {
"status": [
"El estado debe ser 0 (Inactivo) o 1 (Activo)."
]
}
},
"status": "error",
"message": "Validacion fallida.",
"code": 422,
"id_bitacora_log": 736014
}
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
Buscar departamento
requires authentication
Obtiene la informacion de un departamento por su identificador.
Example request:
$client = new \GuzzleHttp\Client();
$url = 'https://calidad.api.atencionprofesional.com/api/admin/departments/search';
$response = $client->post(
$url,
[
'headers' => [
'X-User-Consumo' => 'string required Identificador del cliente de consumo (middleware auth.api_client).',
'X-User-Secret' => 'string required Secreto del cliente de consumo.',
'Content-Type' => 'application/json',
],
'json' => [
'id_department' => 7,
'id_bitacora_log' => 736014,
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));const url = new URL(
"https://calidad.api.atencionprofesional.com/api/admin/departments/search"
);
const headers = {
"X-User-Consumo": "string required Identificador del cliente de consumo (middleware auth.api_client).",
"X-User-Secret": "string required Secreto del cliente de consumo.",
"Content-Type": "application/json",
"Accept": "application/json",
};
let body = {
"id_department": 7,
"id_bitacora_log": 736014
};
fetch(url, {
method: "POST",
headers,
body: JSON.stringify(body),
}).then(response => response.json());Example response (200):
{
"data": {
"id_department": 7,
"department_name": "Soporte",
"company": 3,
"hour": "{\"lunes_apertura\":\"08:00\",\"lunes_cierre\":\"17:00\"}"
},
"status": "ok",
"message": "",
"code": 200,
"id_bitacora_log": 736014
}
Example response (404):
{
"data": [],
"status": "error",
"message": "Departamento no encontrado.",
"code": 404,
"id_bitacora_log": 736014
}
Example response (422):
{
"data": {
"errors": {
"id_department": [
"El campo id_department es obligatorio."
]
}
},
"status": "error",
"message": "Errores de validacion.",
"code": 422,
"id_bitacora_log": 736014
}
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
SuperAdmin FAQs
Listar FAQs
requires authentication
Devuelve las FAQs con filtros y paginacion opcional.
Example request:
$client = new \GuzzleHttp\Client();
$url = 'https://calidad.api.atencionprofesional.com/api/admin/faqs/list';
$response = $client->post(
$url,
[
'headers' => [
'X-User-Consumo' => 'string required Identificador del cliente de consumo (middleware auth.api_client).',
'X-User-Secret' => 'string required Secreto del cliente de consumo.',
'Content-Type' => 'application/json',
],
'json' => [
'paginate' => '"S"',
'page' => 1,
'quantity_x_page' => 10,
'filters' => [
'replay' => 'Hola',
'company' => 3,
'department' => 'Ventas',
],
'id_bitacora_log' => 736014,
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));const url = new URL(
"https://calidad.api.atencionprofesional.com/api/admin/faqs/list"
);
const headers = {
"X-User-Consumo": "string required Identificador del cliente de consumo (middleware auth.api_client).",
"X-User-Secret": "string required Secreto del cliente de consumo.",
"Content-Type": "application/json",
"Accept": "application/json",
};
let body = {
"paginate": "\"S\"",
"page": 1,
"quantity_x_page": 10,
"filters": {
"replay": "Hola",
"company": 3,
"department": "Ventas"
},
"id_bitacora_log": 736014
};
fetch(url, {
method: "POST",
headers,
body: JSON.stringify(body),
}).then(response => response.json());Example response (200, Listado paginado):
{
"data": {
"current_page": 1,
"data": [
{
"id_faq": 5,
"replay": "Hola, esta es la respuesta.",
"company": 3,
"departament": "[\"0\",\"7\"]",
"status": 1
}
],
"from": 1,
"last_page": 1,
"per_page": 10,
"to": 1,
"total": 1
},
"status": "success",
"message": "Operacion exitosa",
"code": 200,
"id_bitacora_log": 736014
}
Example response (200, Listado sin paginar):
{
"data": {
"data": [
{
"id_faq": 5,
"replay": "Hola, esta es la respuesta.",
"company": 3,
"departament": "[\"0\",\"7\"]",
"status": 1
}
]
},
"status": "success",
"message": "Operacion exitosa",
"code": 200,
"id_bitacora_log": 736014
}
Example response (422):
{
"data": {
"errors": {
"paginate": [
"El campo paginate debe ser \"S\" o \"N\"."
]
}
},
"status": "error",
"message": "Validacion fallida.",
"code": 422,
"id_bitacora_log": 736014
}
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
Crear FAQ
requires authentication
Crea una FAQ para una empresa y departamentos.
Example request:
$client = new \GuzzleHttp\Client();
$url = 'https://calidad.api.atencionprofesional.com/api/admin/faqs/store';
$response = $client->post(
$url,
[
'headers' => [
'X-User-Consumo' => 'string required Identificador del cliente de consumo (middleware auth.api_client).',
'X-User-Secret' => 'string required Secreto del cliente de consumo.',
'Content-Type' => 'application/json',
],
'json' => [
'company' => 3,
'replay' => '"Hola, ¿en que puedo ayudarte?"',
'departament' => [
'0',
'7',
],
'id_bitacora_log' => 736014,
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));const url = new URL(
"https://calidad.api.atencionprofesional.com/api/admin/faqs/store"
);
const headers = {
"X-User-Consumo": "string required Identificador del cliente de consumo (middleware auth.api_client).",
"X-User-Secret": "string required Secreto del cliente de consumo.",
"Content-Type": "application/json",
"Accept": "application/json",
};
let body = {
"company": 3,
"replay": "\"Hola, ¿en que puedo ayudarte?\"",
"departament": [
"0",
"7"
],
"id_bitacora_log": 736014
};
fetch(url, {
method: "POST",
headers,
body: JSON.stringify(body),
}).then(response => response.json());Example response (201):
{
"data": {
"id_faq": 5,
"company": 3,
"replay": "Hola, ¿en que puedo ayudarte?",
"departament": [
"0",
"7"
],
"status": 1
},
"status": "ok",
"message": "FAQ creada exitosamente.",
"code": 201,
"id_bitacora_log": 736014
}
Example response (422):
{
"data": {
"errors": {
"departament": [
"El campo departament es obligatorio."
]
}
},
"status": "error",
"message": "Validacion fallida.",
"code": 422,
"id_bitacora_log": 736014
}
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
Actualizar FAQ
requires authentication
Actualiza la respuesta y/o los departamentos de una FAQ.
Example request:
$client = new \GuzzleHttp\Client();
$url = 'https://calidad.api.atencionprofesional.com/api/admin/faqs/update';
$response = $client->patch(
$url,
[
'headers' => [
'X-User-Consumo' => 'string required Identificador del cliente de consumo (middleware auth.api_client).',
'X-User-Secret' => 'string required Secreto del cliente de consumo.',
'Content-Type' => 'application/json',
],
'json' => [
'id_faq' => 5,
'replay' => '"Respuesta actualizada"',
'department' => [
'0',
'8',
],
'id_bitacora_log' => 736014,
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));const url = new URL(
"https://calidad.api.atencionprofesional.com/api/admin/faqs/update"
);
const headers = {
"X-User-Consumo": "string required Identificador del cliente de consumo (middleware auth.api_client).",
"X-User-Secret": "string required Secreto del cliente de consumo.",
"Content-Type": "application/json",
"Accept": "application/json",
};
let body = {
"id_faq": 5,
"replay": "\"Respuesta actualizada\"",
"department": [
"0",
"8"
],
"id_bitacora_log": 736014
};
fetch(url, {
method: "PATCH",
headers,
body: JSON.stringify(body),
}).then(response => response.json());Example response (200):
{
"data": {
"id_faq": 5,
"replay": "Respuesta actualizada",
"department": [
"0",
"8"
]
},
"status": "ok",
"message": "FAQ actualizado correctamente.",
"code": 200,
"id_bitacora_log": 736014
}
Example response (404):
{
"data": [],
"status": "error",
"message": "FAQ no encontrado.",
"code": 404,
"id_bitacora_log": 736014
}
Example response (422, Sin campos a actualizar):
{
"data": {
"errors": {
"payload": [
"Debes proporcionar al menos un atributo a actualizar: replay o department."
]
}
},
"status": "error",
"message": "Validacion fallida.",
"code": 422,
"id_bitacora_log": 736014
}
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
Actualizar estado de FAQ
requires authentication
Activa o inactiva una FAQ.
Example request:
$client = new \GuzzleHttp\Client();
$url = 'https://calidad.api.atencionprofesional.com/api/admin/faqs/update-status';
$response = $client->patch(
$url,
[
'headers' => [
'X-User-Consumo' => 'string required Identificador del cliente de consumo (middleware auth.api_client).',
'X-User-Secret' => 'string required Secreto del cliente de consumo.',
'Content-Type' => 'application/json',
],
'json' => [
'id_faq' => 5,
'status' => 0,
'id_bitacora_log' => 736014,
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));const url = new URL(
"https://calidad.api.atencionprofesional.com/api/admin/faqs/update-status"
);
const headers = {
"X-User-Consumo": "string required Identificador del cliente de consumo (middleware auth.api_client).",
"X-User-Secret": "string required Secreto del cliente de consumo.",
"Content-Type": "application/json",
"Accept": "application/json",
};
let body = {
"id_faq": 5,
"status": 0,
"id_bitacora_log": 736014
};
fetch(url, {
method: "PATCH",
headers,
body: JSON.stringify(body),
}).then(response => response.json());Example response (200, Estado actualizado):
{
"data": {
"id_faq": 5,
"status": 0
},
"status": "ok",
"message": "Estado de la FAQ actualizado correctamente.",
"code": 200,
"id_bitacora_log": 736014
}
Example response (200, Sin cambios):
{
"data": {
"id_faq": 5,
"status": 1,
"note": "El estado solicitado coincide con el actual. No se realizaron cambios."
},
"status": "ok",
"message": "Solicitud idempotente: sin cambios.",
"code": 200,
"id_bitacora_log": 736014
}
Example response (404):
{
"data": {
"id_faq": 5
},
"status": "error",
"message": "FAQ no encontrada.",
"code": 404,
"id_bitacora_log": 736014
}
Example response (422):
{
"data": {
"errors": {
"status": [
"El estado debe ser 0 (Inactivo) o 1 (Activo)."
]
}
},
"status": "error",
"message": "Validacion fallida.",
"code": 422,
"id_bitacora_log": 736014
}
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
Buscar FAQ
requires authentication
Obtiene una FAQ por su identificador.
Example request:
$client = new \GuzzleHttp\Client();
$url = 'https://calidad.api.atencionprofesional.com/api/admin/faqs/search';
$response = $client->post(
$url,
[
'headers' => [
'X-User-Consumo' => 'string required Identificador del cliente de consumo (middleware auth.api_client).',
'X-User-Secret' => 'string required Secreto del cliente de consumo.',
'Content-Type' => 'application/json',
],
'json' => [
'id_faq' => 5,
'id_bitacora_log' => 736014,
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));const url = new URL(
"https://calidad.api.atencionprofesional.com/api/admin/faqs/search"
);
const headers = {
"X-User-Consumo": "string required Identificador del cliente de consumo (middleware auth.api_client).",
"X-User-Secret": "string required Secreto del cliente de consumo.",
"Content-Type": "application/json",
"Accept": "application/json",
};
let body = {
"id_faq": 5,
"id_bitacora_log": 736014
};
fetch(url, {
method: "POST",
headers,
body: JSON.stringify(body),
}).then(response => response.json());Example response (200):
{
"data": {
"id_faq": 5,
"replay": "Hola, esta es la respuesta.",
"id_company": 3,
"department": "[\"0\",\"7\"]"
},
"status": "ok",
"message": "FAQ encontrado.",
"code": 200,
"id_bitacora_log": 736014
}
Example response (404):
{
"data": [],
"status": "error",
"message": "FAQ no encontrado.",
"code": 404,
"id_bitacora_log": 736014
}
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
SuperAdmin Planes
Listar planes
requires authentication
Devuelve planes con filtros y paginacion opcional.
Example request:
$client = new \GuzzleHttp\Client();
$url = 'https://calidad.api.atencionprofesional.com/api/admin/plans/list';
$response = $client->post(
$url,
[
'headers' => [
'X-User-Consumo' => 'string required Identificador del cliente de consumo (middleware auth.api_client).',
'X-User-Secret' => 'string required Secreto del cliente de consumo.',
'Content-Type' => 'application/json',
],
'json' => [
'paginate' => '"S"',
'page' => 1,
'quantity_x_page' => 10,
'filters' => [
'name' => 'Basico',
],
'id_bitacora_log' => 736014,
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));const url = new URL(
"https://calidad.api.atencionprofesional.com/api/admin/plans/list"
);
const headers = {
"X-User-Consumo": "string required Identificador del cliente de consumo (middleware auth.api_client).",
"X-User-Secret": "string required Secreto del cliente de consumo.",
"Content-Type": "application/json",
"Accept": "application/json",
};
let body = {
"paginate": "\"S\"",
"page": 1,
"quantity_x_page": 10,
"filters": {
"name": "Basico"
},
"id_bitacora_log": 736014
};
fetch(url, {
method: "POST",
headers,
body: JSON.stringify(body),
}).then(response => response.json());Example response (200, Listado paginado):
{
"data": {
"current_page": 1,
"data": [
{
"id_plan": 3,
"plan_name": "Basico",
"total_DAU": 1000,
"price_additional_DAU": 0.05,
"no_DAU": 500,
"plan_price": 49.9,
"price_chatbot": 0,
"price_api": 0,
"price_messenger": 0,
"price_telegram": 0,
"price_whatsapp": 10,
"price_agent": 15,
"max_users": 20
}
],
"from": 1,
"last_page": 1,
"per_page": 10,
"to": 1,
"total": 1
},
"status": "ok",
"message": "",
"code": 200,
"id_bitacora_log": 736014
}
Example response (200, Listado sin paginar):
{
"data": [
{
"id_plan": 3,
"plan_name": "Basico",
"total_DAU": 1000,
"price_additional_DAU": 0.05,
"no_DAU": 500,
"plan_price": 49.9,
"price_chatbot": 0,
"price_api": 0,
"price_messenger": 0,
"price_telegram": 0,
"price_whatsapp": 10,
"price_agent": 15,
"max_users": 20
}
],
"status": "ok",
"message": "",
"code": 200,
"id_bitacora_log": 736014
}
Example response (422):
{
"data": {
"errors": {
"paginate": [
"El campo paginate debe ser \"S\" o \"N\"."
]
}
},
"status": "error",
"message": "Validacion fallida.",
"code": 422,
"id_bitacora_log": 736014
}
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
Crear plan
requires authentication
Crea un plan con sus precios y limites.
Example request:
$client = new \GuzzleHttp\Client();
$url = 'https://calidad.api.atencionprofesional.com/api/admin/plans/store';
$response = $client->post(
$url,
[
'headers' => [
'X-User-Consumo' => 'string required Identificador del cliente de consumo (middleware auth.api_client).',
'X-User-Secret' => 'string required Secreto del cliente de consumo.',
'Content-Type' => 'application/json',
],
'json' => [
'name' => '"Basico"',
'total_dau' => '1000',
'price_additional_dau' => '0.05',
'no_dau' => '500',
'plan_price' => '49.9',
'price_api' => 0,
'price_messenger' => 0,
'price_telegram' => 0,
'max_users' => 20,
'price_chatbot' => 0,
'price_whatsapp' => 10,
'price_agent' => 15,
'id_bitacora_log' => 736014,
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));const url = new URL(
"https://calidad.api.atencionprofesional.com/api/admin/plans/store"
);
const headers = {
"X-User-Consumo": "string required Identificador del cliente de consumo (middleware auth.api_client).",
"X-User-Secret": "string required Secreto del cliente de consumo.",
"Content-Type": "application/json",
"Accept": "application/json",
};
let body = {
"name": "\"Basico\"",
"total_dau": "1000",
"price_additional_dau": "0.05",
"no_dau": "500",
"plan_price": "49.9",
"price_api": 0,
"price_messenger": 0,
"price_telegram": 0,
"max_users": 20,
"price_chatbot": 0,
"price_whatsapp": 10,
"price_agent": 15,
"id_bitacora_log": 736014
};
fetch(url, {
method: "POST",
headers,
body: JSON.stringify(body),
}).then(response => response.json());Example response (201):
{
"data": {
"id_plan": 4,
"plan_name": "Basico",
"total_dau": 1000,
"price_additional_dau": 0.05,
"no_dau": 500,
"plan_price": 49.9,
"price_chatbot": 0,
"price_api": 0,
"price_messenger": 0,
"price_telegram": 0,
"price_whatsapp": 10,
"price_agent": 15,
"max_users": 20
},
"status": "ok",
"message": "Plan creado correctamente",
"code": 201,
"id_bitacora_log": 736014
}
Example response (422):
{
"data": {
"errors": {
"name": [
"El nombre del plan es obligatorio."
]
}
},
"status": "error",
"message": "Errores de validacion.",
"code": 422,
"id_bitacora_log": 736014
}
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
Actualizar estado del plan
requires authentication
Activa o inactiva un plan.
Example request:
$client = new \GuzzleHttp\Client();
$url = 'https://calidad.api.atencionprofesional.com/api/admin/plans/update-status';
$response = $client->patch(
$url,
[
'headers' => [
'X-User-Consumo' => 'string required Identificador del cliente de consumo (middleware auth.api_client).',
'X-User-Secret' => 'string required Secreto del cliente de consumo.',
'Content-Type' => 'application/json',
],
'json' => [
'id_plan' => 4,
'state' => 1,
'id_bitacora_log' => 736014,
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));const url = new URL(
"https://calidad.api.atencionprofesional.com/api/admin/plans/update-status"
);
const headers = {
"X-User-Consumo": "string required Identificador del cliente de consumo (middleware auth.api_client).",
"X-User-Secret": "string required Secreto del cliente de consumo.",
"Content-Type": "application/json",
"Accept": "application/json",
};
let body = {
"id_plan": 4,
"state": 1,
"id_bitacora_log": 736014
};
fetch(url, {
method: "PATCH",
headers,
body: JSON.stringify(body),
}).then(response => response.json());Example response (200, Estado actualizado):
{
"data": {
"id_plan": 4,
"state": 0
},
"status": "ok",
"message": "Estado de plan actualizado correctamente.",
"code": 200,
"id_bitacora_log": 736014
}
Example response (200, Sin cambios):
{
"data": {
"id_plan": 4,
"state": 1
},
"status": "ok",
"message": "Sin cambios: el plan ya tenia el estado solicitado.",
"code": 200,
"id_bitacora_log": 736014
}
Example response (500):
{
"data": [],
"status": "error",
"message": "Ocurrio un error al actualizar el estado del plan.",
"code": 500,
"id_bitacora_log": 736014
}
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
SuperAdmin Usuarios
Crear usuario
requires authentication
Crea un usuario asociado a empresa y departamento.
Example request:
$client = new \GuzzleHttp\Client();
$url = 'https://calidad.api.atencionprofesional.com/api/users/store';
$response = $client->post(
$url,
[
'headers' => [
'X-User-Consumo' => 'string required Identificador del cliente de consumo (middleware auth.api_client).',
'X-User-Secret' => 'string required Secreto del cliente de consumo.',
'Content-Type' => 'multipart/form-data',
],
'multipart' => [
[
'name' => 'name',
'contents' => '"Juan Perez"'
],
[
'name' => 'code',
'contents' => '"USR-001"'
],
[
'name' => 'email',
'contents' => '"juan@empresa.com"'
],
[
'name' => 'phone',
'contents' => '"+50688888888"'
],
[
'name' => 'type',
'contents' => '"2"'
],
[
'name' => 'password',
'contents' => '"Secret123"'
],
[
'name' => 'password_confirmation',
'contents' => '"Secret123"'
],
[
'name' => 'company',
'contents' => '3'
],
[
'name' => 'department',
'contents' => '7'
],
[
'name' => 'state',
'contents' => '1'
],
[
'name' => 'id_bitacora_log',
'contents' => '736014'
],
[
'name' => 'pic',
'contents' => fopen('/tmp/php45gftn1t50m69Fogaj3', 'r')
],
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));const url = new URL(
"https://calidad.api.atencionprofesional.com/api/users/store"
);
const headers = {
"X-User-Consumo": "string required Identificador del cliente de consumo (middleware auth.api_client).",
"X-User-Secret": "string required Secreto del cliente de consumo.",
"Content-Type": "multipart/form-data",
"Accept": "application/json",
};
const body = new FormData();
body.append('name', '"Juan Perez"');
body.append('code', '"USR-001"');
body.append('email', '"juan@empresa.com"');
body.append('phone', '"+50688888888"');
body.append('type', '"2"');
body.append('password', '"Secret123"');
body.append('password_confirmation', '"Secret123"');
body.append('company', '3');
body.append('department', '7');
body.append('state', '1');
body.append('id_bitacora_log', '736014');
body.append('pic', document.querySelector('input[name="pic"]').files[0]);
fetch(url, {
method: "POST",
headers,
body,
}).then(response => response.json());Example response (201):
{
"data": {
"id": 15,
"name": "Juan Perez",
"email": "juan@empresa.com",
"company": 3,
"department": 7,
"type": "2",
"state": 1
},
"status": "ok",
"message": "Usuario creado correctamente.",
"code": 201,
"id_bitacora_log": 736014
}
Example response (422):
{
"data": {
"errors": {
"email": [
"El correo indicado ya esta registrado."
]
}
},
"status": "error",
"message": "Validacion fallida.",
"code": 422,
"id_bitacora_log": 736014
}
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
Listar usuarios
requires authentication
Devuelve usuarios con filtros y paginacion opcional.
Example request:
$client = new \GuzzleHttp\Client();
$url = 'https://calidad.api.atencionprofesional.com/api/users/list';
$response = $client->post(
$url,
[
'headers' => [
'X-User-Consumo' => 'string required Identificador del cliente de consumo (middleware auth.api_client).',
'X-User-Secret' => 'string required Secreto del cliente de consumo.',
'Content-Type' => 'application/json',
],
'json' => [
'paginate' => '"S"',
'page' => 1,
'quantity_x_page' => 20,
'filters' => [
'name' => 'Juan',
'email' => 'juan@empresa.com',
'id_company' => 3,
'company_name' => 'Empresa',
'type_user' => '2',
'phone' => '+50688888888',
],
'id_bitacora_log' => 736014,
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));const url = new URL(
"https://calidad.api.atencionprofesional.com/api/users/list"
);
const headers = {
"X-User-Consumo": "string required Identificador del cliente de consumo (middleware auth.api_client).",
"X-User-Secret": "string required Secreto del cliente de consumo.",
"Content-Type": "application/json",
"Accept": "application/json",
};
let body = {
"paginate": "\"S\"",
"page": 1,
"quantity_x_page": 20,
"filters": {
"name": "Juan",
"email": "juan@empresa.com",
"id_company": 3,
"company_name": "Empresa",
"type_user": "2",
"phone": "+50688888888"
},
"id_bitacora_log": 736014
};
fetch(url, {
method: "POST",
headers,
body: JSON.stringify(body),
}).then(response => response.json());Example response (200, Listado paginado):
{
"data": {
"current_page": 1,
"data": [
{
"id": 15,
"name": "Juan Perez",
"email": "juan@empresa.com",
"company": 3,
"department": 7,
"type": "2",
"state": 1
}
],
"from": 1,
"last_page": 1,
"per_page": 20,
"to": 1,
"total": 1
},
"status": "success",
"message": "Operacion exitosa",
"code": 200,
"id_bitacora_log": 736014
}
Example response (422):
{
"data": {
"errors": {
"paginate": [
"El campo paginate debe ser \"S\" o \"N\"."
]
}
},
"status": "error",
"message": "Validacion fallida.",
"code": 422,
"id_bitacora_log": 736014
}
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
Buscar usuario
requires authentication
Obtiene el detalle de un usuario por su id.
Example request:
$client = new \GuzzleHttp\Client();
$url = 'https://calidad.api.atencionprofesional.com/api/users/show/15';
$response = $client->get(
$url,
[
'headers' => [
'X-User-Consumo' => 'string required Identificador del cliente de consumo (middleware auth.api_client).',
'X-User-Secret' => 'string required Secreto del cliente de consumo.',
'Content-Type' => 'application/json',
],
'json' => [
'id_user' => 36,
'id_bitacora_log' => 736014,
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));const url = new URL(
"https://calidad.api.atencionprofesional.com/api/users/show/15"
);
const headers = {
"X-User-Consumo": "string required Identificador del cliente de consumo (middleware auth.api_client).",
"X-User-Secret": "string required Secreto del cliente de consumo.",
"Content-Type": "application/json",
"Accept": "application/json",
};
let body = {
"id_user": 36,
"id_bitacora_log": 736014
};
fetch(url, {
method: "GET",
headers,
body: JSON.stringify(body),
}).then(response => response.json());Example response (200):
{
"data": {
"id_user": 15,
"name": "Juan Perez",
"email": "juan@empresa.com",
"company": 3,
"department": 7,
"type": "2",
"state": 1
},
"status": "ok",
"message": "",
"code": 200,
"id_bitacora_log": 736014
}
Example response (404):
{
"data": [],
"status": "error",
"message": "El usuario indicado no existe.",
"code": 404,
"id_bitacora_log": 736014
}
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
Actualizar usuario
requires authentication
Actualiza parcialmente datos del usuario (nombre, correo, telefono, password, tipo, estado, empresa/departamento).
Example request:
$client = new \GuzzleHttp\Client();
$url = 'https://calidad.api.atencionprofesional.com/api/users/update/15';
$response = $client->patch(
$url,
[
'headers' => [
'X-User-Consumo' => 'string required Identificador del cliente de consumo (middleware auth.api_client).',
'X-User-Secret' => 'string required Secreto del cliente de consumo.',
'Content-Type' => 'application/json',
],
'json' => [
'id' => 14,
'code' => '"USR-002"',
'name' => '"Juan P. Actualizado"',
'email' => '"juan.actualizado@empresa.com"',
'phone' => '"+50677777777"',
'password' => '"Secret456"',
'password_confirmation' => '"Secret456"',
'type' => '"2"',
'online' => 1,
'state' => true,
'company' => 3,
'department' => 7,
'id_bitacora_log' => 736014,
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));const url = new URL(
"https://calidad.api.atencionprofesional.com/api/users/update/15"
);
const headers = {
"X-User-Consumo": "string required Identificador del cliente de consumo (middleware auth.api_client).",
"X-User-Secret": "string required Secreto del cliente de consumo.",
"Content-Type": "application/json",
"Accept": "application/json",
};
let body = {
"id": 14,
"code": "\"USR-002\"",
"name": "\"Juan P. Actualizado\"",
"email": "\"juan.actualizado@empresa.com\"",
"phone": "\"+50677777777\"",
"password": "\"Secret456\"",
"password_confirmation": "\"Secret456\"",
"type": "\"2\"",
"online": 1,
"state": true,
"company": 3,
"department": 7,
"id_bitacora_log": 736014
};
fetch(url, {
method: "PATCH",
headers,
body: JSON.stringify(body),
}).then(response => response.json());Example response (200):
{
"data": {
"id": 15,
"name": "Juan P. Actualizado",
"email": "juan.actualizado@empresa.com",
"company": 3,
"department": 7,
"type": "2",
"state": 1
},
"status": "ok",
"message": "Usuario actualizado correctamente.",
"code": 200,
"id_bitacora_log": 736014
}
Example response (404):
{
"data": [],
"status": "error",
"message": "El usuario indicado no existe.",
"code": 404,
"id_bitacora_log": 736014
}
Example response (422):
{
"data": {
"errors": {
"department": [
"El campo department es obligatorio cuando se envia company."
]
}
},
"status": "error",
"message": "Validacion fallida.",
"code": 422,
"id_bitacora_log": 736014
}
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
Analizar usuarios por empresa
requires authentication
Retorna metricas/resumen de usuarios de la empresa del usuario autenticado.
Example request:
$client = new \GuzzleHttp\Client();
$url = 'https://calidad.api.atencionprofesional.com/api/users/analizeUsersCompany';
$response = $client->get(
$url,
[
'headers' => [
'X-User-Consumo' => 'string required Identificador del cliente de consumo (middleware auth.api_client).',
'X-User-Secret' => 'string required Secreto del cliente de consumo.',
'Content-Type' => 'application/json',
],
'json' => [
'id_bitacora_log' => 736014,
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));const url = new URL(
"https://calidad.api.atencionprofesional.com/api/users/analizeUsersCompany"
);
const headers = {
"X-User-Consumo": "string required Identificador del cliente de consumo (middleware auth.api_client).",
"X-User-Secret": "string required Secreto del cliente de consumo.",
"Content-Type": "application/json",
"Accept": "application/json",
};
let body = {
"id_bitacora_log": 736014
};
fetch(url, {
method: "GET",
headers,
body: JSON.stringify(body),
}).then(response => response.json());Example response (200):
{
"data": {
"total": 10,
"activos": 9,
"inactivos": 1
},
"status": "ok",
"message": "",
"code": 200,
"id_bitacora_log": 736014
}
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
Actualizar estado de usuario
requires authentication
Activa o inactiva un usuario.
Example request:
$client = new \GuzzleHttp\Client();
$url = 'https://calidad.api.atencionprofesional.com/api/users/status/15';
$response = $client->patch(
$url,
[
'headers' => [
'X-User-Consumo' => 'string required Identificador del cliente de consumo (middleware auth.api_client).',
'X-User-Secret' => 'string required Secreto del cliente de consumo.',
'Content-Type' => 'application/json',
],
'json' => [
'id_user' => 15,
'status' => 0,
'id_bitacora_log' => 736014,
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));const url = new URL(
"https://calidad.api.atencionprofesional.com/api/users/status/15"
);
const headers = {
"X-User-Consumo": "string required Identificador del cliente de consumo (middleware auth.api_client).",
"X-User-Secret": "string required Secreto del cliente de consumo.",
"Content-Type": "application/json",
"Accept": "application/json",
};
let body = {
"id_user": 15,
"status": 0,
"id_bitacora_log": 736014
};
fetch(url, {
method: "PATCH",
headers,
body: JSON.stringify(body),
}).then(response => response.json());Example response (200, Estado actualizado):
{
"data": {
"id_user": 15,
"status": 0
},
"status": "ok",
"message": "Estado actualizado correctamente.",
"code": 200,
"id_bitacora_log": 736014
}
Example response (200, Sin cambios):
{
"data": {
"id_user": 15,
"status": 1
},
"status": "ok",
"message": "Sin cambios: el usuario ya estaba en ese estado.",
"code": 200,
"id_bitacora_log": 736014
}
Example response (404):
{
"data": [],
"status": "error",
"message": "El usuario especificado no existe.",
"code": 404,
"id_bitacora_log": 736014
}
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
Subir foto de usuario
requires authentication
Sube/actualiza la foto del usuario a partir de un data URL base64.
Example request:
$client = new \GuzzleHttp\Client();
$url = 'https://calidad.api.atencionprofesional.com/api/users/uploadUserPic/15';
$response = $client->patch(
$url,
[
'headers' => [
'X-User-Consumo' => 'string required Identificador del cliente de consumo (middleware auth.api_client).',
'X-User-Secret' => 'string required Secreto del cliente de consumo.',
'Content-Type' => 'application/json',
],
'json' => [
'id' => 44,
'pic' => '"data:image/png;base64,iVBORw0KGgoAAA..."',
'id_bitacora_log' => 736014,
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));const url = new URL(
"https://calidad.api.atencionprofesional.com/api/users/uploadUserPic/15"
);
const headers = {
"X-User-Consumo": "string required Identificador del cliente de consumo (middleware auth.api_client).",
"X-User-Secret": "string required Secreto del cliente de consumo.",
"Content-Type": "application/json",
"Accept": "application/json",
};
let body = {
"id": 44,
"pic": "\"data:image\/png;base64,iVBORw0KGgoAAA...\"",
"id_bitacora_log": 736014
};
fetch(url, {
method: "PATCH",
headers,
body: JSON.stringify(body),
}).then(response => response.json());Example response (200):
{
"data": {
"id": 15,
"pic_url": "https://app.test/storage/users/15.png"
},
"status": "ok",
"message": "Imagen cargada correctamente.",
"code": 200,
"id_bitacora_log": 736014
}
Example response (422):
{
"data": {
"errors": {
"pic": [
"Debe enviar la imagen en base64 en el campo pic."
]
}
},
"status": "error",
"message": "Validacion fallida.",
"code": 422,
"id_bitacora_log": 736014
}
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
Ver foto de usuario
requires authentication
Devuelve la foto del usuario en modo binario, url o meta.
Example request:
$client = new \GuzzleHttp\Client();
$url = 'https://calidad.api.atencionprofesional.com/api/users/showUserPic/15';
$response = $client->get(
$url,
[
'headers' => [
'X-User-Consumo' => 'string required Identificador del cliente de consumo (middleware auth.api_client).',
'X-User-Secret' => 'string required Secreto del cliente de consumo.',
'Content-Type' => 'application/json',
],
'query' => [
'mode' => '"url"',
],
'json' => [
'id' => 11,
'mode' => 'url',
'id_bitacora_log' => 736014,
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));const url = new URL(
"https://calidad.api.atencionprofesional.com/api/users/showUserPic/15"
);
const params = {
"mode": ""url"",
};
Object.keys(params)
.forEach(key => url.searchParams.append(key, params[key]));
const headers = {
"X-User-Consumo": "string required Identificador del cliente de consumo (middleware auth.api_client).",
"X-User-Secret": "string required Secreto del cliente de consumo.",
"Content-Type": "application/json",
"Accept": "application/json",
};
let body = {
"id": 11,
"mode": "url",
"id_bitacora_log": 736014
};
fetch(url, {
method: "GET",
headers,
body: JSON.stringify(body),
}).then(response => response.json());Example response (200):
{
"data": {
"id": 15,
"pic_url": "https://app.test/storage/users/15.png"
},
"status": "ok",
"message": "",
"code": 200,
"id_bitacora_log": 736014
}
Example response (404):
{
"data": [],
"status": "error",
"message": "El usuario indicado no existe.",
"code": 404,
"id_bitacora_log": 736014
}
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
Eliminar foto de usuario
requires authentication
Borra la foto asociada al usuario.
Example request:
$client = new \GuzzleHttp\Client();
$url = 'https://calidad.api.atencionprofesional.com/api/users/deleteUserPic/15';
$response = $client->delete(
$url,
[
'headers' => [
'X-User-Consumo' => 'string required Identificador del cliente de consumo (middleware auth.api_client).',
'X-User-Secret' => 'string required Secreto del cliente de consumo.',
'Content-Type' => 'application/json',
],
'json' => [
'id' => 79,
'force' => true,
'id_bitacora_log' => 736014,
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));const url = new URL(
"https://calidad.api.atencionprofesional.com/api/users/deleteUserPic/15"
);
const headers = {
"X-User-Consumo": "string required Identificador del cliente de consumo (middleware auth.api_client).",
"X-User-Secret": "string required Secreto del cliente de consumo.",
"Content-Type": "application/json",
"Accept": "application/json",
};
let body = {
"id": 79,
"force": true,
"id_bitacora_log": 736014
};
fetch(url, {
method: "DELETE",
headers,
body: JSON.stringify(body),
}).then(response => response.json());Example response (200):
{
"data": {
"id": 15
},
"status": "ok",
"message": "Foto eliminada correctamente.",
"code": 200,
"id_bitacora_log": 736014
}
Example response (404):
{
"data": [],
"status": "error",
"message": "El usuario indicado no existe.",
"code": 404,
"id_bitacora_log": 736014
}
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
Login
requires authentication
Autentica un usuario con correo y contrasena.
Example request:
$client = new \GuzzleHttp\Client();
$url = 'https://calidad.api.atencionprofesional.com/api/auth/login';
$response = $client->post(
$url,
[
'headers' => [
'X-User-Consumo' => 'string required Identificador del cliente de consumo (middleware auth.api_client).',
'X-User-Secret' => 'string required Secreto del cliente de consumo.',
'Content-Type' => 'application/json',
],
'json' => [
'email' => '"juan@empresa.com"',
'password' => '"Secret123"',
'id_bitacora_log' => 736014,
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));const url = new URL(
"https://calidad.api.atencionprofesional.com/api/auth/login"
);
const headers = {
"X-User-Consumo": "string required Identificador del cliente de consumo (middleware auth.api_client).",
"X-User-Secret": "string required Secreto del cliente de consumo.",
"Content-Type": "application/json",
"Accept": "application/json",
};
let body = {
"email": "\"juan@empresa.com\"",
"password": "\"Secret123\"",
"id_bitacora_log": 736014
};
fetch(url, {
method: "POST",
headers,
body: JSON.stringify(body),
}).then(response => response.json());Example response (200):
{
"data": {
"token": "eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9...",
"user": {
"id": 15,
"name": "Juan Perez",
"email": "juan@empresa.com"
}
},
"status": "ok",
"message": "Login exitoso.",
"code": 200,
"id_bitacora_log": 736014
}
Example response (401):
{
"data": [],
"status": "error",
"message": "Credenciales invalidas.",
"code": 401,
"id_bitacora_log": 736014
}
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
Login con PIN
requires authentication
Autentica con correo, pin y device_id.
Example request:
$client = new \GuzzleHttp\Client();
$url = 'https://calidad.api.atencionprofesional.com/api/auth/login/pin';
$response = $client->post(
$url,
[
'headers' => [
'X-User-Consumo' => 'string required Identificador del cliente de consumo (middleware auth.api_client).',
'X-User-Secret' => 'string required Secreto del cliente de consumo.',
'Content-Type' => 'application/json',
],
'json' => [
'email' => '"juan@empresa.com"',
'pin' => '"123456"',
'device_id' => 99,
'id_bitacora_log' => 736014,
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));const url = new URL(
"https://calidad.api.atencionprofesional.com/api/auth/login/pin"
);
const headers = {
"X-User-Consumo": "string required Identificador del cliente de consumo (middleware auth.api_client).",
"X-User-Secret": "string required Secreto del cliente de consumo.",
"Content-Type": "application/json",
"Accept": "application/json",
};
let body = {
"email": "\"juan@empresa.com\"",
"pin": "\"123456\"",
"device_id": 99,
"id_bitacora_log": 736014
};
fetch(url, {
method: "POST",
headers,
body: JSON.stringify(body),
}).then(response => response.json());Example response (200):
{
"data": {
"token": "eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9...",
"user": {
"id": 15,
"name": "Juan Perez"
}
},
"status": "ok",
"message": "Login exitoso.",
"code": 200,
"id_bitacora_log": 736014
}
Example response (401):
{
"data": [],
"status": "error",
"message": "Credenciales invalidas.",
"code": 401,
"id_bitacora_log": 736014
}
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
Solicitar reset de password
requires authentication
Envia correo con el enlace de restablecimiento.
Example request:
$client = new \GuzzleHttp\Client();
$url = 'https://calidad.api.atencionprofesional.com/api/auth/password/forgot';
$response = $client->post(
$url,
[
'headers' => [
'X-User-Consumo' => 'string required Identificador del cliente de consumo (middleware auth.api_client).',
'X-User-Secret' => 'string required Secreto del cliente de consumo.',
'Content-Type' => 'application/json',
],
'json' => [
'email' => '"juan@empresa.com"',
'domain' => 'nxgjcplqttfhhi',
'id_bitacora_log' => 736014,
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));const url = new URL(
"https://calidad.api.atencionprofesional.com/api/auth/password/forgot"
);
const headers = {
"X-User-Consumo": "string required Identificador del cliente de consumo (middleware auth.api_client).",
"X-User-Secret": "string required Secreto del cliente de consumo.",
"Content-Type": "application/json",
"Accept": "application/json",
};
let body = {
"email": "\"juan@empresa.com\"",
"domain": "nxgjcplqttfhhi",
"id_bitacora_log": 736014
};
fetch(url, {
method: "POST",
headers,
body: JSON.stringify(body),
}).then(response => response.json());Example response (200):
{
"data": [],
"status": "ok",
"message": "Correo de recuperacion enviado.",
"code": 200,
"id_bitacora_log": 736014
}
Example response (404):
{
"data": [],
"status": "error",
"message": "El correo no esta registrado.",
"code": 404,
"id_bitacora_log": 736014
}
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
Reset de password
requires authentication
Restablece la contrasena con token de recuperacion.
Example request:
$client = new \GuzzleHttp\Client();
$url = 'https://calidad.api.atencionprofesional.com/api/auth/password/reset';
$response = $client->post(
$url,
[
'headers' => [
'X-User-Consumo' => 'string required Identificador del cliente de consumo (middleware auth.api_client).',
'X-User-Secret' => 'string required Secreto del cliente de consumo.',
'Content-Type' => 'application/json',
],
'json' => [
'id' => 'yknji',
'token' => '"abc123"',
'password' => '"Nueva123"',
'password_confirmation' => '"Nueva123"',
'email' => '"juan@empresa.com"',
'id_bitacora_log' => 736014,
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));const url = new URL(
"https://calidad.api.atencionprofesional.com/api/auth/password/reset"
);
const headers = {
"X-User-Consumo": "string required Identificador del cliente de consumo (middleware auth.api_client).",
"X-User-Secret": "string required Secreto del cliente de consumo.",
"Content-Type": "application/json",
"Accept": "application/json",
};
let body = {
"id": "yknji",
"token": "\"abc123\"",
"password": "\"Nueva123\"",
"password_confirmation": "\"Nueva123\"",
"email": "\"juan@empresa.com\"",
"id_bitacora_log": 736014
};
fetch(url, {
method: "POST",
headers,
body: JSON.stringify(body),
}).then(response => response.json());Example response (200):
{
"data": [],
"status": "ok",
"message": "Contrasena restablecida correctamente.",
"code": 200,
"id_bitacora_log": 736014
}
Example response (422):
{
"data": {
"errors": {
"token": [
"Token invalido."
]
}
},
"status": "error",
"message": "Validacion fallida.",
"code": 422,
"id_bitacora_log": 736014
}
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
Datos del usuario autenticado
requires authentication
Devuelve la informacion del usuario autenticado (y opcionalmente la URL de foto).
Example request:
$client = new \GuzzleHttp\Client();
$url = 'https://calidad.api.atencionprofesional.com/api/auth/getRequestUserData';
$response = $client->get(
$url,
[
'headers' => [
'X-User-Consumo' => 'string required Identificador del cliente de consumo (middleware auth.api_client).',
'X-User-Secret' => 'string required Secreto del cliente de consumo.',
'Content-Type' => 'application/json',
],
'query' => [
'include' => '"pic_url"',
],
'json' => [
'include' => 'pic_url',
'id_bitacora_log' => 736014,
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));const url = new URL(
"https://calidad.api.atencionprofesional.com/api/auth/getRequestUserData"
);
const params = {
"include": ""pic_url"",
};
Object.keys(params)
.forEach(key => url.searchParams.append(key, params[key]));
const headers = {
"X-User-Consumo": "string required Identificador del cliente de consumo (middleware auth.api_client).",
"X-User-Secret": "string required Secreto del cliente de consumo.",
"Content-Type": "application/json",
"Accept": "application/json",
};
let body = {
"include": "pic_url",
"id_bitacora_log": 736014
};
fetch(url, {
method: "GET",
headers,
body: JSON.stringify(body),
}).then(response => response.json());Example response (200):
{
"data": {
"id": 15,
"name": "Juan Perez",
"email": "juan@empresa.com",
"pic_url": "https://app.test/storage/users/15.png"
},
"status": "ok",
"message": "",
"code": 200,
"id_bitacora_log": 736014
}
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
Refrescar token
requires authentication
Genera un nuevo token para el usuario autenticado.
Example request:
$client = new \GuzzleHttp\Client();
$url = 'https://calidad.api.atencionprofesional.com/api/auth/refreshUserToken';
$response = $client->get(
$url,
[
'headers' => [
'X-User-Consumo' => 'string required Identificador del cliente de consumo (middleware auth.api_client).',
'X-User-Secret' => 'string required Secreto del cliente de consumo.',
'Content-Type' => 'application/json',
],
'json' => [
'id_bitacora_log' => 736014,
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));const url = new URL(
"https://calidad.api.atencionprofesional.com/api/auth/refreshUserToken"
);
const headers = {
"X-User-Consumo": "string required Identificador del cliente de consumo (middleware auth.api_client).",
"X-User-Secret": "string required Secreto del cliente de consumo.",
"Content-Type": "application/json",
"Accept": "application/json",
};
let body = {
"id_bitacora_log": 736014
};
fetch(url, {
method: "GET",
headers,
body: JSON.stringify(body),
}).then(response => response.json());Example response (200):
{
"data": {
"token": "eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9..."
},
"status": "ok",
"message": "Token refrescado.",
"code": 200,
"id_bitacora_log": 736014
}
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
Logout
requires authentication
Revoca el token del usuario autenticado.
Example request:
$client = new \GuzzleHttp\Client();
$url = 'https://calidad.api.atencionprofesional.com/api/auth/logout';
$response = $client->delete(
$url,
[
'headers' => [
'X-User-Consumo' => 'string required Identificador del cliente de consumo (middleware auth.api_client).',
'X-User-Secret' => 'string required Secreto del cliente de consumo.',
'Content-Type' => 'application/json',
],
'json' => [
'id_bitacora_log' => 736014,
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));const url = new URL(
"https://calidad.api.atencionprofesional.com/api/auth/logout"
);
const headers = {
"X-User-Consumo": "string required Identificador del cliente de consumo (middleware auth.api_client).",
"X-User-Secret": "string required Secreto del cliente de consumo.",
"Content-Type": "application/json",
"Accept": "application/json",
};
let body = {
"id_bitacora_log": 736014
};
fetch(url, {
method: "DELETE",
headers,
body: JSON.stringify(body),
}).then(response => response.json());Example response (200):
{
"data": [],
"status": "ok",
"message": "Logout exitoso.",
"code": 200,
"id_bitacora_log": 736014
}
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
Telegram
Enviar mensaje por Telegram
requires authentication
Envia un mensaje a un chat de Telegram usando el bot configurado.
Example request:
$client = new \GuzzleHttp\Client();
$url = 'https://calidad.api.atencionprofesional.com/api/telegram/sendTelegramMessage';
$response = $client->post(
$url,
[
'headers' => [
'X-User-Consumo' => 'string required Identificador del cliente de consumo (middleware auth.api_client).',
'X-User-Secret' => 'string required Secreto del cliente de consumo.',
'Authorization' => 'string required Bearer token (auth:sanctum).',
'Content-Type' => 'application/json',
],
'json' => [
'bot_token' => '"12345:ABC"',
'id_chat' => '"123456789"',
'message' => '"Hola desde la API"',
'id_user' => 7,
'name_user' => '"Agente 1"',
'id_bitacora_log' => 736014,
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));const url = new URL(
"https://calidad.api.atencionprofesional.com/api/telegram/sendTelegramMessage"
);
const headers = {
"X-User-Consumo": "string required Identificador del cliente de consumo (middleware auth.api_client).",
"X-User-Secret": "string required Secreto del cliente de consumo.",
"Authorization": "string required Bearer token (auth:sanctum).",
"Content-Type": "application/json",
"Accept": "application/json",
};
let body = {
"bot_token": "\"12345:ABC\"",
"id_chat": "\"123456789\"",
"message": "\"Hola desde la API\"",
"id_user": 7,
"name_user": "\"Agente 1\"",
"id_bitacora_log": 736014
};
fetch(url, {
method: "POST",
headers,
body: JSON.stringify(body),
}).then(response => response.json());Example response (200):
{
"status": "ok",
"message": "Mensaje enviado",
"data": {
"id_chat": "123456789",
"message": "Hola desde la API"
},
"code": 200,
"id_bitacora_log": 736014
}
Example response (422):
{
"data": {
"errors": {
"id_chat": [
"El campo id_chat es obligatorio."
]
}
},
"status": "error",
"message": "Validacion fallida.",
"code": 422,
"id_bitacora_log": 736014
}
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
Leer mensajes pendientes de Telegram
requires authentication
Obtiene mensajes pendientes del bot.
Example request:
$client = new \GuzzleHttp\Client();
$url = 'https://calidad.api.atencionprofesional.com/api/telegram/readTelegramMessages';
$response = $client->post(
$url,
[
'headers' => [
'X-User-Consumo' => 'string required Identificador del cliente de consumo (middleware auth.api_client).',
'X-User-Secret' => 'string required Secreto del cliente de consumo.',
'Authorization' => 'string required Bearer token (auth:sanctum).',
'Content-Type' => 'application/json',
],
'json' => [
'bot_token' => '"12345:ABC"',
'id_bitacora_log' => 736014,
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));const url = new URL(
"https://calidad.api.atencionprofesional.com/api/telegram/readTelegramMessages"
);
const headers = {
"X-User-Consumo": "string required Identificador del cliente de consumo (middleware auth.api_client).",
"X-User-Secret": "string required Secreto del cliente de consumo.",
"Authorization": "string required Bearer token (auth:sanctum).",
"Content-Type": "application/json",
"Accept": "application/json",
};
let body = {
"bot_token": "\"12345:ABC\"",
"id_bitacora_log": 736014
};
fetch(url, {
method: "POST",
headers,
body: JSON.stringify(body),
}).then(response => response.json());Example response (200):
{
"status": "ok",
"message": "Mensajes leidos",
"data": [
{
"id_chat": "123456789",
"message": "Hola"
}
],
"code": 200,
"id_bitacora_log": 736014
}
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
Configurar webhook de Telegram
requires authentication
Registra el webhook del bot apuntando al endpoint de recepcion.
Example request:
$client = new \GuzzleHttp\Client();
$url = 'https://calidad.api.atencionprofesional.com/api/telegram/setWebhook';
$response = $client->post(
$url,
[
'headers' => [
'X-User-Consumo' => 'string required Identificador del cliente de consumo (middleware auth.api_client).',
'X-User-Secret' => 'string required Secreto del cliente de consumo.',
'Authorization' => 'string required Bearer token (auth:sanctum).',
'Content-Type' => 'application/json',
],
'json' => [
'bot_token' => '"12345:ABC"',
'company' => '3',
'name' => '"Bot soporte"',
'id_bitacora_log' => 736014,
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));const url = new URL(
"https://calidad.api.atencionprofesional.com/api/telegram/setWebhook"
);
const headers = {
"X-User-Consumo": "string required Identificador del cliente de consumo (middleware auth.api_client).",
"X-User-Secret": "string required Secreto del cliente de consumo.",
"Authorization": "string required Bearer token (auth:sanctum).",
"Content-Type": "application/json",
"Accept": "application/json",
};
let body = {
"bot_token": "\"12345:ABC\"",
"company": "3",
"name": "\"Bot soporte\"",
"id_bitacora_log": 736014
};
fetch(url, {
method: "POST",
headers,
body: JSON.stringify(body),
}).then(response => response.json());Example response (200):
{
"status": "ok",
"message": "Webhook configurado",
"code": 200,
"id_bitacora_log": 736014
}
Example response (422):
{
"data": {
"errors": {
"bot_token": [
"El campo bot_token es requerido."
]
}
},
"status": "error",
"message": "Validacion fallida.",
"code": 422,
"id_bitacora_log": 736014
}
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
Webhook de recepcion de Telegram
Punto de entrada publico que recibe actualizaciones desde Telegram.
Example request:
$client = new \GuzzleHttp\Client();
$url = 'https://calidad.api.atencionprofesional.com/api/telegram/receive/"bot-123"';
$response = $client->post($url);
$body = $response->getBody();
print_r(json_decode((string) $body));const url = new URL(
"https://calidad.api.atencionprofesional.com/api/telegram/receive/"bot-123""
);
fetch(url, {
method: "POST",
}).then(response => response.json());Example response (200):
{
"status": "ok"
}
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
Obtener archivo multimedia de Telegram
Devuelve el archivo almacenado de Telegram.
Example request:
$client = new \GuzzleHttp\Client();
$url = 'https://calidad.api.atencionprofesional.com/api/telegram/getMediaFile';
$response = $client->get(
$url,
[
'headers' => [
'Content-Type' => 'application/json',
],
'query' => [
'filename' => '"photo_12345.jpg"',
],
'json' => [
'filename' => 'pariatur',
'id_bitacora_log' => 736014,
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));const url = new URL(
"https://calidad.api.atencionprofesional.com/api/telegram/getMediaFile"
);
const params = {
"filename": ""photo_12345.jpg"",
};
Object.keys(params)
.forEach(key => url.searchParams.append(key, params[key]));
const headers = {
"Content-Type": "application/json",
"Accept": "application/json",
};
let body = {
"filename": "pariatur",
"id_bitacora_log": 736014
};
fetch(url, {
method: "GET",
headers,
body: JSON.stringify(body),
}).then(response => response.json());Example response (200):
{
"status": "ok",
"message": "",
"code": 200,
"id_bitacora_log": 736014
}
Example response (422):
{
"data": {
"errors": {
"filename": [
"El campo filename es requerido."
]
}
},
"status": "error",
"message": "Validacion fallida.",
"code": 422,
"id_bitacora_log": 736014
}
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.