Introduction
API REST para aplicación móvil con sincronización offline/online, autenticación Sanctum y gestión de usuarios.
Esta API está diseñada para aplicaciones móviles que requieren funcionalidad offline/online con sincronización automática.
<aside>
<strong>Características principales:</strong>
<ul>
<li>Autenticación con Laravel Sanctum (Bearer tokens)</li>
<li>Sincronización bidireccional de datos</li>
<li>Gestión completa de usuarios y sesiones</li>
<li>Soporte para modo offline</li>
<li>Resolución de conflictos de datos</li>
</ul>
</aside>
Puedes probar los endpoints directamente desde esta documentación. Para endpoints protegidos, primero haz login en `/api/auth/login` y usa el token recibido.
Authenticating requests
To authenticate requests, include an Authorization header with the value "Bearer Bearer {your-token-here}".
All authenticated endpoints are marked with a requires authentication badge in the documentation below.
Para obtener un token, haz POST a /api/auth/login con tus credenciales. El token tiene una duración de 24 horas.
Autenticación
APIs para registro, login y gestión de autenticación de usuarios
Registrar nuevo usuario
Crea una nueva cuenta de usuario con autenticación Sanctum.
Example request:
curl --request POST \
"http://localhost/api/auth/register" \
--header "Content-Type: application/json" \
--header "Accept: application/json" \
--header "X-Requested-With: XMLHttpRequest" \
--data "{
\"name\": \"Juan Pérez\",
\"email\": \"juan@example.com\",
\"password\": \"Password123!\",
\"password_confirmation\": \"consequatur\",
\"phone_number\": \"+52 555 123 4567\",
\"device_id\": \"abc123def456\",
\"device_name\": \"Samsung Galaxy S21\",
\"device_type\": \"android\",
\"app_version\": \"1.0.0\",
\"is_offline_capable\": true,
\"preferences\": {
\"theme\": \"dark\",
\"language\": \"bzvrb\",
\"notifications\": true,
\"auto_sync\": true,
\"sync_frequency\": \"realtime\"
},
\"accept_terms\": true,
\"accept_privacy\": true,
\"timezone\": \"America\\/Punta_Arenas\",
\"referral_code\": \"znkygloigmkwxphlv\"
}"
const url = new URL(
"http://localhost/api/auth/register"
);
const headers = {
"Content-Type": "application/json",
"Accept": "application/json",
"X-Requested-With": "XMLHttpRequest",
};
let body = {
"name": "Juan Pérez",
"email": "juan@example.com",
"password": "Password123!",
"password_confirmation": "consequatur",
"phone_number": "+52 555 123 4567",
"device_id": "abc123def456",
"device_name": "Samsung Galaxy S21",
"device_type": "android",
"app_version": "1.0.0",
"is_offline_capable": true,
"preferences": {
"theme": "dark",
"language": "bzvrb",
"notifications": true,
"auto_sync": true,
"sync_frequency": "realtime"
},
"accept_terms": true,
"accept_privacy": true,
"timezone": "America\/Punta_Arenas",
"referral_code": "znkygloigmkwxphlv"
};
fetch(url, {
method: "POST",
headers,
body: JSON.stringify(body),
}).then(response => response.json());$client = new \GuzzleHttp\Client();
$url = 'http://localhost/api/auth/register';
$response = $client->post(
$url,
[
'headers' => [
'Content-Type' => 'application/json',
'Accept' => 'application/json',
'X-Requested-With' => 'XMLHttpRequest',
],
'json' => [
'name' => 'Juan Pérez',
'email' => 'juan@example.com',
'password' => 'Password123!',
'password_confirmation' => 'consequatur',
'phone_number' => '+52 555 123 4567',
'device_id' => 'abc123def456',
'device_name' => 'Samsung Galaxy S21',
'device_type' => 'android',
'app_version' => '1.0.0',
'is_offline_capable' => true,
'preferences' => [
'theme' => 'dark',
'language' => 'bzvrb',
'notifications' => true,
'auto_sync' => true,
'sync_frequency' => 'realtime',
],
'accept_terms' => true,
'accept_privacy' => true,
'timezone' => 'America/Punta_Arenas',
'referral_code' => 'znkygloigmkwxphlv',
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));Example response (201):
{
"success": true,
"message": "Usuario registrado exitosamente",
"data": {
"user": {
"id": 1,
"name": "Juan Pérez",
"email": "juan@example.com",
"status": "active"
},
"token": "1|abcdefghijklmnop",
"offline_token": "xyz789",
"session_id": 1,
"expires_at": "2024-02-15T10:00:00.000000Z"
}
}
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.
Iniciar sesión
Autentica un usuario y retorna un token de acceso.
Example request:
curl --request POST \
"http://localhost/api/auth/login" \
--header "Content-Type: application/json" \
--header "Accept: application/json" \
--header "X-Requested-With: XMLHttpRequest" \
--data "{
\"email\": \"juan@example.com\",
\"password\": \"Password123!\",
\"device_id\": \"abc123def456\",
\"device_name\": \"Samsung Galaxy S21\",
\"device_type\": \"android\",
\"app_version\": \"1.0.0\",
\"revoke_other_tokens\": false,
\"is_offline_capable\": false,
\"remember_me\": true,
\"timezone\": \"Europe\\/Moscow\",
\"language\": \"rbyic\"
}"
const url = new URL(
"http://localhost/api/auth/login"
);
const headers = {
"Content-Type": "application/json",
"Accept": "application/json",
"X-Requested-With": "XMLHttpRequest",
};
let body = {
"email": "juan@example.com",
"password": "Password123!",
"device_id": "abc123def456",
"device_name": "Samsung Galaxy S21",
"device_type": "android",
"app_version": "1.0.0",
"revoke_other_tokens": false,
"is_offline_capable": false,
"remember_me": true,
"timezone": "Europe\/Moscow",
"language": "rbyic"
};
fetch(url, {
method: "POST",
headers,
body: JSON.stringify(body),
}).then(response => response.json());$client = new \GuzzleHttp\Client();
$url = 'http://localhost/api/auth/login';
$response = $client->post(
$url,
[
'headers' => [
'Content-Type' => 'application/json',
'Accept' => 'application/json',
'X-Requested-With' => 'XMLHttpRequest',
],
'json' => [
'email' => 'juan@example.com',
'password' => 'Password123!',
'device_id' => 'abc123def456',
'device_name' => 'Samsung Galaxy S21',
'device_type' => 'android',
'app_version' => '1.0.0',
'revoke_other_tokens' => false,
'is_offline_capable' => false,
'remember_me' => true,
'timezone' => 'Europe/Moscow',
'language' => 'rbyic',
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));Example response (200):
{
"success": true,
"message": "Inicio de sesión exitoso",
"data": {
"user": {
"id": 1,
"name": "Juan Pérez",
"email": "juan@example.com"
},
"token": "1|abcdefghijklmnop",
"offline_token": "xyz789",
"session_id": 1,
"expires_at": "2024-02-15T10:00:00.000000Z"
}
}
Example response (422):
{
"success": false,
"message": "Credenciales incorrectas"
}
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 recuperación de contraseña POST /api/auth/forgot-password
Example request:
curl --request POST \
"http://localhost/api/auth/forgot-password" \
--header "Content-Type: application/json" \
--header "Accept: application/json" \
--header "X-Requested-With: XMLHttpRequest" \
--data "{
\"email\": \"qkunze@example.com\",
\"device_id\": \"opfuudtdsufvyvddqamni\",
\"device_type\": \"android\",
\"app_version\": \"hfqcoynlazghdtqtq\",
\"language\": \"xbajw\",
\"timezone\": \"Africa\\/Kampala\"
}"
const url = new URL(
"http://localhost/api/auth/forgot-password"
);
const headers = {
"Content-Type": "application/json",
"Accept": "application/json",
"X-Requested-With": "XMLHttpRequest",
};
let body = {
"email": "qkunze@example.com",
"device_id": "opfuudtdsufvyvddqamni",
"device_type": "android",
"app_version": "hfqcoynlazghdtqtq",
"language": "xbajw",
"timezone": "Africa\/Kampala"
};
fetch(url, {
method: "POST",
headers,
body: JSON.stringify(body),
}).then(response => response.json());$client = new \GuzzleHttp\Client();
$url = 'http://localhost/api/auth/forgot-password';
$response = $client->post(
$url,
[
'headers' => [
'Content-Type' => 'application/json',
'Accept' => 'application/json',
'X-Requested-With' => 'XMLHttpRequest',
],
'json' => [
'email' => 'qkunze@example.com',
'device_id' => 'opfuudtdsufvyvddqamni',
'device_type' => 'android',
'app_version' => 'hfqcoynlazghdtqtq',
'language' => 'xbajw',
'timezone' => 'Africa/Kampala',
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));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.
Resetear contraseña con token POST /api/auth/reset-password
Example request:
curl --request POST \
"http://localhost/api/auth/reset-password" \
--header "Content-Type: application/json" \
--header "Accept: application/json" \
--header "X-Requested-With: XMLHttpRequest" \
--data "{
\"email\": \"qkunze@example.com\",
\"token\": \"consequatur\",
\"password\": \"[2UZ5ij-e\\/dl4\"
}"
const url = new URL(
"http://localhost/api/auth/reset-password"
);
const headers = {
"Content-Type": "application/json",
"Accept": "application/json",
"X-Requested-With": "XMLHttpRequest",
};
let body = {
"email": "qkunze@example.com",
"token": "consequatur",
"password": "[2UZ5ij-e\/dl4"
};
fetch(url, {
method: "POST",
headers,
body: JSON.stringify(body),
}).then(response => response.json());$client = new \GuzzleHttp\Client();
$url = 'http://localhost/api/auth/reset-password';
$response = $client->post(
$url,
[
'headers' => [
'Content-Type' => 'application/json',
'Accept' => 'application/json',
'X-Requested-With' => 'XMLHttpRequest',
],
'json' => [
'email' => 'qkunze@example.com',
'token' => 'consequatur',
'password' => '[2UZ5ij-e/dl4',
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));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.
Verificar email del usuario GET /api/auth/verify-email/{token}
Example request:
curl --request GET \
--get "http://localhost/api/auth/verify-email/consequatur" \
--header "Content-Type: application/json" \
--header "Accept: application/json" \
--header "X-Requested-With: XMLHttpRequest"const url = new URL(
"http://localhost/api/auth/verify-email/consequatur"
);
const headers = {
"Content-Type": "application/json",
"Accept": "application/json",
"X-Requested-With": "XMLHttpRequest",
};
fetch(url, {
method: "GET",
headers,
}).then(response => response.json());$client = new \GuzzleHttp\Client();
$url = 'http://localhost/api/auth/verify-email/consequatur';
$response = $client->get(
$url,
[
'headers' => [
'Content-Type' => 'application/json',
'Accept' => 'application/json',
'X-Requested-With' => 'XMLHttpRequest',
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));Example response (500):
Show headers
cache-control: no-cache, private
content-type: application/json
x-ratelimit-limit: 60
x-ratelimit-remaining: 59
access-control-allow-origin: *
{
"message": "Server Error"
}
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 perfil del usuario autenticado GET /api/auth/profile
Example request:
curl --request GET \
--get "http://localhost/api/auth/profile" \
--header "Content-Type: application/json" \
--header "Accept: application/json" \
--header "X-Requested-With: XMLHttpRequest"const url = new URL(
"http://localhost/api/auth/profile"
);
const headers = {
"Content-Type": "application/json",
"Accept": "application/json",
"X-Requested-With": "XMLHttpRequest",
};
fetch(url, {
method: "GET",
headers,
}).then(response => response.json());$client = new \GuzzleHttp\Client();
$url = 'http://localhost/api/auth/profile';
$response = $client->get(
$url,
[
'headers' => [
'Content-Type' => 'application/json',
'Accept' => 'application/json',
'X-Requested-With' => 'XMLHttpRequest',
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));Example response (401):
Show headers
cache-control: no-cache, private
content-type: application/json
access-control-allow-origin: *
{
"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.
Cerrar sesión
requires authentication
Cierra la sesión actual y revoca el token de acceso.
Example request:
curl --request POST \
"http://localhost/api/auth/logout" \
--header "Authorization: Bearer Bearer {your-token-here}" \
--header "X-Session-ID: string ID de la sesión activa. Example: 123" \
--header "Content-Type: application/json" \
--header "Accept: application/json" \
--header "X-Requested-With: XMLHttpRequest"const url = new URL(
"http://localhost/api/auth/logout"
);
const headers = {
"Authorization": "Bearer Bearer {your-token-here}",
"X-Session-ID": "string ID de la sesión activa. Example: 123",
"Content-Type": "application/json",
"Accept": "application/json",
"X-Requested-With": "XMLHttpRequest",
};
fetch(url, {
method: "POST",
headers,
}).then(response => response.json());$client = new \GuzzleHttp\Client();
$url = 'http://localhost/api/auth/logout';
$response = $client->post(
$url,
[
'headers' => [
'Authorization' => 'Bearer Bearer {your-token-here}',
'X-Session-ID' => 'string ID de la sesión activa. Example: 123',
'Content-Type' => 'application/json',
'Accept' => 'application/json',
'X-Requested-With' => 'XMLHttpRequest',
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));Example response (200):
{
"success": true,
"message": "Sesión cerrada exitosamente"
}
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.
Cerrar todas las sesiones del usuario POST /api/auth/logout-all
Example request:
curl --request POST \
"http://localhost/api/auth/logout-all" \
--header "Content-Type: application/json" \
--header "Accept: application/json" \
--header "X-Requested-With: XMLHttpRequest"const url = new URL(
"http://localhost/api/auth/logout-all"
);
const headers = {
"Content-Type": "application/json",
"Accept": "application/json",
"X-Requested-With": "XMLHttpRequest",
};
fetch(url, {
method: "POST",
headers,
}).then(response => response.json());$client = new \GuzzleHttp\Client();
$url = 'http://localhost/api/auth/logout-all';
$response = $client->post(
$url,
[
'headers' => [
'Content-Type' => 'application/json',
'Accept' => 'application/json',
'X-Requested-With' => 'XMLHttpRequest',
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));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.
Renovar token de autenticación POST /api/auth/refresh
Example request:
curl --request POST \
"http://localhost/api/auth/refresh" \
--header "Content-Type: application/json" \
--header "Accept: application/json" \
--header "X-Requested-With: XMLHttpRequest"const url = new URL(
"http://localhost/api/auth/refresh"
);
const headers = {
"Content-Type": "application/json",
"Accept": "application/json",
"X-Requested-With": "XMLHttpRequest",
};
fetch(url, {
method: "POST",
headers,
}).then(response => response.json());$client = new \GuzzleHttp\Client();
$url = 'http://localhost/api/auth/refresh';
$response = $client->post(
$url,
[
'headers' => [
'Content-Type' => 'application/json',
'Accept' => 'application/json',
'X-Requested-With' => 'XMLHttpRequest',
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));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.
Validar y verificar estado del token GET /api/auth/validate-token POST /api/auth/validate-token
Example request:
curl --request GET \
--get "http://localhost/api/auth/validate-token" \
--header "Content-Type: application/json" \
--header "Accept: application/json" \
--header "X-Requested-With: XMLHttpRequest"const url = new URL(
"http://localhost/api/auth/validate-token"
);
const headers = {
"Content-Type": "application/json",
"Accept": "application/json",
"X-Requested-With": "XMLHttpRequest",
};
fetch(url, {
method: "GET",
headers,
}).then(response => response.json());$client = new \GuzzleHttp\Client();
$url = 'http://localhost/api/auth/validate-token';
$response = $client->get(
$url,
[
'headers' => [
'Content-Type' => 'application/json',
'Accept' => 'application/json',
'X-Requested-With' => 'XMLHttpRequest',
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));Example response (401):
Show headers
cache-control: no-cache, private
content-type: application/json
access-control-allow-origin: *
{
"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.
DEPRECATED: Usar validateToken en su lugar GET /api/auth/check-token
Example request:
curl --request GET \
--get "http://localhost/api/auth/check-token" \
--header "Content-Type: application/json" \
--header "Accept: application/json" \
--header "X-Requested-With: XMLHttpRequest"const url = new URL(
"http://localhost/api/auth/check-token"
);
const headers = {
"Content-Type": "application/json",
"Accept": "application/json",
"X-Requested-With": "XMLHttpRequest",
};
fetch(url, {
method: "GET",
headers,
}).then(response => response.json());$client = new \GuzzleHttp\Client();
$url = 'http://localhost/api/auth/check-token';
$response = $client->get(
$url,
[
'headers' => [
'Content-Type' => 'application/json',
'Accept' => 'application/json',
'X-Requested-With' => 'XMLHttpRequest',
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));Example response (401):
Show headers
cache-control: no-cache, private
content-type: application/json
access-control-allow-origin: *
{
"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.
Usuarios
APIs para gestión de usuarios y perfiles
Listar usuarios
requires authentication
Obtiene la lista de usuarios (solo administradores).
Example request:
curl --request GET \
--get "http://localhost/api/users?page=1&per_page=15&search=juan&status=active&role=user&sort_by=created_at&sort_order=desc" \
--header "Authorization: Bearer Bearer {your-token-here}" \
--header "Content-Type: application/json" \
--header "Accept: application/json" \
--header "X-Requested-With: XMLHttpRequest" \
--data "{
\"page\": 73,
\"per_page\": 13,
\"search\": \"qeopfuudtdsufvyvddqam\",
\"status\": \"suspended\",
\"role\": \"user\",
\"sort_by\": \"name\",
\"sort_order\": \"desc\"
}"
const url = new URL(
"http://localhost/api/users"
);
const params = {
"page": "1",
"per_page": "15",
"search": "juan",
"status": "active",
"role": "user",
"sort_by": "created_at",
"sort_order": "desc",
};
Object.keys(params)
.forEach(key => url.searchParams.append(key, params[key]));
const headers = {
"Authorization": "Bearer Bearer {your-token-here}",
"Content-Type": "application/json",
"Accept": "application/json",
"X-Requested-With": "XMLHttpRequest",
};
let body = {
"page": 73,
"per_page": 13,
"search": "qeopfuudtdsufvyvddqam",
"status": "suspended",
"role": "user",
"sort_by": "name",
"sort_order": "desc"
};
fetch(url, {
method: "GET",
headers,
body: JSON.stringify(body),
}).then(response => response.json());$client = new \GuzzleHttp\Client();
$url = 'http://localhost/api/users';
$response = $client->get(
$url,
[
'headers' => [
'Authorization' => 'Bearer Bearer {your-token-here}',
'Content-Type' => 'application/json',
'Accept' => 'application/json',
'X-Requested-With' => 'XMLHttpRequest',
],
'query' => [
'page' => '1',
'per_page' => '15',
'search' => 'juan',
'status' => 'active',
'role' => 'user',
'sort_by' => 'created_at',
'sort_order' => 'desc',
],
'json' => [
'page' => 73,
'per_page' => 13,
'search' => 'qeopfuudtdsufvyvddqam',
'status' => 'suspended',
'role' => 'user',
'sort_by' => 'name',
'sort_order' => 'desc',
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));Example response (200):
{
"success": true,
"data": {
"current_page": 1,
"data": [
{
"id": 1,
"name": "Juan Pérez",
"email": "juan@example.com",
"status": "active",
"role": "user"
}
],
"total": 50
}
}
Example response (403):
{
"success": false,
"message": "Sin permisos para ver usuarios"
}
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.
Mostrar usuario específico GET /api/users/{id}
Example request:
curl --request GET \
--get "http://localhost/api/users/consequatur" \
--header "Content-Type: application/json" \
--header "Accept: application/json" \
--header "X-Requested-With: XMLHttpRequest"const url = new URL(
"http://localhost/api/users/consequatur"
);
const headers = {
"Content-Type": "application/json",
"Accept": "application/json",
"X-Requested-With": "XMLHttpRequest",
};
fetch(url, {
method: "GET",
headers,
}).then(response => response.json());$client = new \GuzzleHttp\Client();
$url = 'http://localhost/api/users/consequatur';
$response = $client->get(
$url,
[
'headers' => [
'Content-Type' => 'application/json',
'Accept' => 'application/json',
'X-Requested-With' => 'XMLHttpRequest',
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));Example response (401):
Show headers
cache-control: no-cache, private
content-type: application/json
access-control-allow-origin: *
{
"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.
Actualizar perfil del usuario PUT /api/users/{id}
Example request:
curl --request PUT \
"http://localhost/api/users/consequatur" \
--header "Content-Type: application/json" \
--header "Accept: application/json" \
--header "X-Requested-With: XMLHttpRequest" \
--data "{
\"name\": \"vmqeopfuudtdsufvyvddq\",
\"email\": \"kunde.eloisa@example.com\",
\"phone_number\": \"hfqcoynlazghdtqtq\",
\"password\": \"(!Cs\'YAKYLk4>SJIrIV\"
}"
const url = new URL(
"http://localhost/api/users/consequatur"
);
const headers = {
"Content-Type": "application/json",
"Accept": "application/json",
"X-Requested-With": "XMLHttpRequest",
};
let body = {
"name": "vmqeopfuudtdsufvyvddq",
"email": "kunde.eloisa@example.com",
"phone_number": "hfqcoynlazghdtqtq",
"password": "(!Cs'YAKYLk4>SJIrIV"
};
fetch(url, {
method: "PUT",
headers,
body: JSON.stringify(body),
}).then(response => response.json());$client = new \GuzzleHttp\Client();
$url = 'http://localhost/api/users/consequatur';
$response = $client->put(
$url,
[
'headers' => [
'Content-Type' => 'application/json',
'Accept' => 'application/json',
'X-Requested-With' => 'XMLHttpRequest',
],
'json' => [
'name' => 'vmqeopfuudtdsufvyvddq',
'email' => 'kunde.eloisa@example.com',
'phone_number' => 'hfqcoynlazghdtqtq',
'password' => '(!Cs\'YAKYLk4>SJIrIV',
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));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 usuario (soft delete) DELETE /api/users/{id}
Example request:
curl --request DELETE \
"http://localhost/api/users/consequatur" \
--header "Content-Type: application/json" \
--header "Accept: application/json" \
--header "X-Requested-With: XMLHttpRequest"const url = new URL(
"http://localhost/api/users/consequatur"
);
const headers = {
"Content-Type": "application/json",
"Accept": "application/json",
"X-Requested-With": "XMLHttpRequest",
};
fetch(url, {
method: "DELETE",
headers,
}).then(response => response.json());$client = new \GuzzleHttp\Client();
$url = 'http://localhost/api/users/consequatur';
$response = $client->delete(
$url,
[
'headers' => [
'Content-Type' => 'application/json',
'Accept' => 'application/json',
'X-Requested-With' => 'XMLHttpRequest',
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));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 preferencias del usuario PUT /api/users/{id}/preferences
Example request:
curl --request PUT \
"http://localhost/api/users/consequatur/preferences" \
--header "Content-Type: application/json" \
--header "Accept: application/json" \
--header "X-Requested-With: XMLHttpRequest" \
--data "{
\"preferences\": [],
\"merge\": false
}"
const url = new URL(
"http://localhost/api/users/consequatur/preferences"
);
const headers = {
"Content-Type": "application/json",
"Accept": "application/json",
"X-Requested-With": "XMLHttpRequest",
};
let body = {
"preferences": [],
"merge": false
};
fetch(url, {
method: "PUT",
headers,
body: JSON.stringify(body),
}).then(response => response.json());$client = new \GuzzleHttp\Client();
$url = 'http://localhost/api/users/consequatur/preferences';
$response = $client->put(
$url,
[
'headers' => [
'Content-Type' => 'application/json',
'Accept' => 'application/json',
'X-Requested-With' => 'XMLHttpRequest',
],
'json' => [
'preferences' => [],
'merge' => false,
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));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 perfil POST /api/users/{id}/profile-photo
Example request:
curl --request POST \
"http://localhost/api/users/consequatur/profile-photo" \
--header "Content-Type: multipart/form-data" \
--header "Accept: application/json" \
--header "X-Requested-With: XMLHttpRequest" \
--form "photo=@C:\Users\thejo\AppData\Local\Temp\php2D25.tmp" const url = new URL(
"http://localhost/api/users/consequatur/profile-photo"
);
const headers = {
"Content-Type": "multipart/form-data",
"Accept": "application/json",
"X-Requested-With": "XMLHttpRequest",
};
const body = new FormData();
body.append('photo', document.querySelector('input[name="photo"]').files[0]);
fetch(url, {
method: "POST",
headers,
body,
}).then(response => response.json());$client = new \GuzzleHttp\Client();
$url = 'http://localhost/api/users/consequatur/profile-photo';
$response = $client->post(
$url,
[
'headers' => [
'Content-Type' => 'multipart/form-data',
'Accept' => 'application/json',
'X-Requested-With' => 'XMLHttpRequest',
],
'multipart' => [
[
'name' => 'photo',
'contents' => fopen('C:\Users\thejo\AppData\Local\Temp\php2D25.tmp', 'r')
],
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));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 sesiones activas del usuario GET /api/users/{id}/sessions
Example request:
curl --request GET \
--get "http://localhost/api/users/consequatur/sessions" \
--header "Content-Type: application/json" \
--header "Accept: application/json" \
--header "X-Requested-With: XMLHttpRequest"const url = new URL(
"http://localhost/api/users/consequatur/sessions"
);
const headers = {
"Content-Type": "application/json",
"Accept": "application/json",
"X-Requested-With": "XMLHttpRequest",
};
fetch(url, {
method: "GET",
headers,
}).then(response => response.json());$client = new \GuzzleHttp\Client();
$url = 'http://localhost/api/users/consequatur/sessions';
$response = $client->get(
$url,
[
'headers' => [
'Content-Type' => 'application/json',
'Accept' => 'application/json',
'X-Requested-With' => 'XMLHttpRequest',
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));Example response (401):
Show headers
cache-control: no-cache, private
content-type: application/json
access-control-allow-origin: *
{
"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.
Revocar sesión específica DELETE /api/users/{id}/sessions/{sessionId}
Example request:
curl --request DELETE \
"http://localhost/api/users/consequatur/sessions/consequatur" \
--header "Content-Type: application/json" \
--header "Accept: application/json" \
--header "X-Requested-With: XMLHttpRequest"const url = new URL(
"http://localhost/api/users/consequatur/sessions/consequatur"
);
const headers = {
"Content-Type": "application/json",
"Accept": "application/json",
"X-Requested-With": "XMLHttpRequest",
};
fetch(url, {
method: "DELETE",
headers,
}).then(response => response.json());$client = new \GuzzleHttp\Client();
$url = 'http://localhost/api/users/consequatur/sessions/consequatur';
$response = $client->delete(
$url,
[
'headers' => [
'Content-Type' => 'application/json',
'Accept' => 'application/json',
'X-Requested-With' => 'XMLHttpRequest',
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));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.
Sincronización
APIs para sincronización de datos entre la aplicación móvil y el servidor
Cargar datos desde el cliente
requires authentication
Recibe datos del cliente Android para sincronizar con el servidor.
Example request:
curl --request POST \
"http://localhost/api/sync/upload" \
--header "Authorization: Bearer Bearer {your-token-here}" \
--header "Content-Type: application/json" \
--header "Accept: application/json" \
--header "X-Requested-With: XMLHttpRequest" \
--data "{
\"sync_items\": [
{
\"sync_type\": \"CREATE\",
\"table_name\": \"questionnaires\",
\"data\": {},
\"timestamp\": 1234567890
}
],
\"device_id\": \"abc123\",
\"session_id\": \"xyz789\"
}"
const url = new URL(
"http://localhost/api/sync/upload"
);
const headers = {
"Authorization": "Bearer Bearer {your-token-here}",
"Content-Type": "application/json",
"Accept": "application/json",
"X-Requested-With": "XMLHttpRequest",
};
let body = {
"sync_items": [
{
"sync_type": "CREATE",
"table_name": "questionnaires",
"data": {},
"timestamp": 1234567890
}
],
"device_id": "abc123",
"session_id": "xyz789"
};
fetch(url, {
method: "POST",
headers,
body: JSON.stringify(body),
}).then(response => response.json());$client = new \GuzzleHttp\Client();
$url = 'http://localhost/api/sync/upload';
$response = $client->post(
$url,
[
'headers' => [
'Authorization' => 'Bearer Bearer {your-token-here}',
'Content-Type' => 'application/json',
'Accept' => 'application/json',
'X-Requested-With' => 'XMLHttpRequest',
],
'json' => \Symfony\Component\VarExporter\Internal\Hydrator::hydrate(
$o = [
clone (($p = &\Symfony\Component\VarExporter\Internal\Registry::$prototypes)['stdClass'] ?? \Symfony\Component\VarExporter\Internal\Registry::p('stdClass')),
clone $p['stdClass'],
],
null,
[
'stdClass' => [
'sync_type' => [
'CREATE',
],
'table_name' => [
'questionnaires',
],
'data' => [
$o[1],
],
'timestamp' => [
1234567890,
],
],
],
[
'sync_items' => [
$o[0],
],
'device_id' => 'abc123',
'session_id' => 'xyz789',
],
[]
),
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));Example response (200):
{
"success": true,
"message": "Sincronización completada",
"data": {
"processed": 5,
"failed": 0
}
}
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 actualizaciones al cliente POST /api/sync/download
Example request:
curl --request POST \
"http://localhost/api/sync/download" \
--header "Content-Type: application/json" \
--header "Accept: application/json" \
--header "X-Requested-With: XMLHttpRequest" \
--data "{
\"last_sync\": 73,
\"device_id\": \"consequatur\",
\"tables\": [
\"notifications\"
],
\"limit\": 16
}"
const url = new URL(
"http://localhost/api/sync/download"
);
const headers = {
"Content-Type": "application/json",
"Accept": "application/json",
"X-Requested-With": "XMLHttpRequest",
};
let body = {
"last_sync": 73,
"device_id": "consequatur",
"tables": [
"notifications"
],
"limit": 16
};
fetch(url, {
method: "POST",
headers,
body: JSON.stringify(body),
}).then(response => response.json());$client = new \GuzzleHttp\Client();
$url = 'http://localhost/api/sync/download';
$response = $client->post(
$url,
[
'headers' => [
'Content-Type' => 'application/json',
'Accept' => 'application/json',
'X-Requested-With' => 'XMLHttpRequest',
],
'json' => [
'last_sync' => 73,
'device_id' => 'consequatur',
'tables' => [
'notifications',
],
'limit' => 16,
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));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 estado de sincronización GET /api/sync/status
Example request:
curl --request GET \
--get "http://localhost/api/sync/status" \
--header "Content-Type: application/json" \
--header "Accept: application/json" \
--header "X-Requested-With: XMLHttpRequest"const url = new URL(
"http://localhost/api/sync/status"
);
const headers = {
"Content-Type": "application/json",
"Accept": "application/json",
"X-Requested-With": "XMLHttpRequest",
};
fetch(url, {
method: "GET",
headers,
}).then(response => response.json());$client = new \GuzzleHttp\Client();
$url = 'http://localhost/api/sync/status';
$response = $client->get(
$url,
[
'headers' => [
'Content-Type' => 'application/json',
'Accept' => 'application/json',
'X-Requested-With' => 'XMLHttpRequest',
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));Example response (401):
Show headers
cache-control: no-cache, private
content-type: application/json
access-control-allow-origin: *
{
"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.
Gestionar cola de sincronización POST /api/sync/queue
Example request:
curl --request POST \
"http://localhost/api/sync/queue" \
--header "Content-Type: application/json" \
--header "Accept: application/json" \
--header "X-Requested-With: XMLHttpRequest" \
--data "{
\"action\": \"list\",
\"sync_type\": \"UPDATE\",
\"table_name\": \"consequatur\",
\"queue_id\": 17,
\"priority\": 2,
\"object_id\": 17
}"
const url = new URL(
"http://localhost/api/sync/queue"
);
const headers = {
"Content-Type": "application/json",
"Accept": "application/json",
"X-Requested-With": "XMLHttpRequest",
};
let body = {
"action": "list",
"sync_type": "UPDATE",
"table_name": "consequatur",
"queue_id": 17,
"priority": 2,
"object_id": 17
};
fetch(url, {
method: "POST",
headers,
body: JSON.stringify(body),
}).then(response => response.json());$client = new \GuzzleHttp\Client();
$url = 'http://localhost/api/sync/queue';
$response = $client->post(
$url,
[
'headers' => [
'Content-Type' => 'application/json',
'Accept' => 'application/json',
'X-Requested-With' => 'XMLHttpRequest',
],
'json' => [
'action' => 'list',
'sync_type' => 'UPDATE',
'table_name' => 'consequatur',
'queue_id' => 17,
'priority' => 2,
'object_id' => 17,
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));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.
Sincronización masiva (batch) POST /api/sync/bulk
Example request:
curl --request POST \
"http://localhost/api/sync/bulk" \
--header "Content-Type: application/json" \
--header "Accept: application/json" \
--header "X-Requested-With: XMLHttpRequest" \
--data "{
\"operations\": [
{
\"type\": \"download\",
\"data\": \"consequatur\"
}
],
\"device_id\": \"consequatur\"
}"
const url = new URL(
"http://localhost/api/sync/bulk"
);
const headers = {
"Content-Type": "application/json",
"Accept": "application/json",
"X-Requested-With": "XMLHttpRequest",
};
let body = {
"operations": [
{
"type": "download",
"data": "consequatur"
}
],
"device_id": "consequatur"
};
fetch(url, {
method: "POST",
headers,
body: JSON.stringify(body),
}).then(response => response.json());$client = new \GuzzleHttp\Client();
$url = 'http://localhost/api/sync/bulk';
$response = $client->post(
$url,
[
'headers' => [
'Content-Type' => 'application/json',
'Accept' => 'application/json',
'X-Requested-With' => 'XMLHttpRequest',
],
'json' => [
'operations' => [
[
'type' => 'download',
'data' => 'consequatur',
],
],
'device_id' => 'consequatur',
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));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.
Resolver conflictos de datos POST /api/sync/conflict
Example request:
curl --request POST \
"http://localhost/api/sync/conflict" \
--header "Content-Type: application/json" \
--header "Accept: application/json" \
--header "X-Requested-With: XMLHttpRequest" \
--data "{
\"conflicts\": [
{
\"sync_log_id\": 17,
\"resolution\": \"skip\"
}
]
}"
const url = new URL(
"http://localhost/api/sync/conflict"
);
const headers = {
"Content-Type": "application/json",
"Accept": "application/json",
"X-Requested-With": "XMLHttpRequest",
};
let body = {
"conflicts": [
{
"sync_log_id": 17,
"resolution": "skip"
}
]
};
fetch(url, {
method: "POST",
headers,
body: JSON.stringify(body),
}).then(response => response.json());$client = new \GuzzleHttp\Client();
$url = 'http://localhost/api/sync/conflict';
$response = $client->post(
$url,
[
'headers' => [
'Content-Type' => 'application/json',
'Accept' => 'application/json',
'X-Requested-With' => 'XMLHttpRequest',
],
'json' => [
'conflicts' => [
[
'sync_log_id' => 17,
'resolution' => 'skip',
],
],
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));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.
Endpoint específico para cuestionarios GET /api/sync/questionnaires/status
Example request:
curl --request GET \
--get "http://localhost/api/sync/questionnaires/status" \
--header "Content-Type: application/json" \
--header "Accept: application/json" \
--header "X-Requested-With: XMLHttpRequest"const url = new URL(
"http://localhost/api/sync/questionnaires/status"
);
const headers = {
"Content-Type": "application/json",
"Accept": "application/json",
"X-Requested-With": "XMLHttpRequest",
};
fetch(url, {
method: "GET",
headers,
}).then(response => response.json());$client = new \GuzzleHttp\Client();
$url = 'http://localhost/api/sync/questionnaires/status';
$response = $client->get(
$url,
[
'headers' => [
'Content-Type' => 'application/json',
'Accept' => 'application/json',
'X-Requested-With' => 'XMLHttpRequest',
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));Example response (401):
Show headers
cache-control: no-cache, private
content-type: application/json
access-control-allow-origin: *
{
"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.
General
GET api/sync/logs/{userId}
Example request:
curl --request GET \
--get "http://localhost/api/sync/logs/consequatur" \
--header "Content-Type: application/json" \
--header "Accept: application/json" \
--header "X-Requested-With: XMLHttpRequest"const url = new URL(
"http://localhost/api/sync/logs/consequatur"
);
const headers = {
"Content-Type": "application/json",
"Accept": "application/json",
"X-Requested-With": "XMLHttpRequest",
};
fetch(url, {
method: "GET",
headers,
}).then(response => response.json());$client = new \GuzzleHttp\Client();
$url = 'http://localhost/api/sync/logs/consequatur';
$response = $client->get(
$url,
[
'headers' => [
'Content-Type' => 'application/json',
'Accept' => 'application/json',
'X-Requested-With' => 'XMLHttpRequest',
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));Example response (401):
Show headers
cache-control: no-cache, private
content-type: application/json
access-control-allow-origin: *
{
"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.
DELETE api/sync/clear/{userId}
Example request:
curl --request DELETE \
"http://localhost/api/sync/clear/consequatur" \
--header "Content-Type: application/json" \
--header "Accept: application/json" \
--header "X-Requested-With: XMLHttpRequest"const url = new URL(
"http://localhost/api/sync/clear/consequatur"
);
const headers = {
"Content-Type": "application/json",
"Accept": "application/json",
"X-Requested-With": "XMLHttpRequest",
};
fetch(url, {
method: "DELETE",
headers,
}).then(response => response.json());$client = new \GuzzleHttp\Client();
$url = 'http://localhost/api/sync/clear/consequatur';
$response = $client->delete(
$url,
[
'headers' => [
'Content-Type' => 'application/json',
'Accept' => 'application/json',
'X-Requested-With' => 'XMLHttpRequest',
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));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/sync/questionnaires/debug/{userId}
Example request:
curl --request GET \
--get "http://localhost/api/sync/questionnaires/debug/consequatur" \
--header "Content-Type: application/json" \
--header "Accept: application/json" \
--header "X-Requested-With: XMLHttpRequest"const url = new URL(
"http://localhost/api/sync/questionnaires/debug/consequatur"
);
const headers = {
"Content-Type": "application/json",
"Accept": "application/json",
"X-Requested-With": "XMLHttpRequest",
};
fetch(url, {
method: "GET",
headers,
}).then(response => response.json());$client = new \GuzzleHttp\Client();
$url = 'http://localhost/api/sync/questionnaires/debug/consequatur';
$response = $client->get(
$url,
[
'headers' => [
'Content-Type' => 'application/json',
'Accept' => 'application/json',
'X-Requested-With' => 'XMLHttpRequest',
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));Example response (401):
Show headers
cache-control: no-cache, private
content-type: application/json
access-control-allow-origin: *
{
"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.
GET api/questionnaires/android/list
Example request:
curl --request GET \
--get "http://localhost/api/questionnaires/android/list" \
--header "Content-Type: application/json" \
--header "Accept: application/json" \
--header "X-Requested-With: XMLHttpRequest"const url = new URL(
"http://localhost/api/questionnaires/android/list"
);
const headers = {
"Content-Type": "application/json",
"Accept": "application/json",
"X-Requested-With": "XMLHttpRequest",
};
fetch(url, {
method: "GET",
headers,
}).then(response => response.json());$client = new \GuzzleHttp\Client();
$url = 'http://localhost/api/questionnaires/android/list';
$response = $client->get(
$url,
[
'headers' => [
'Content-Type' => 'application/json',
'Accept' => 'application/json',
'X-Requested-With' => 'XMLHttpRequest',
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));Example response (401):
Show headers
cache-control: no-cache, private
content-type: application/json
access-control-allow-origin: *
{
"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.
GET api/questionnaires/android/unsynced
Example request:
curl --request GET \
--get "http://localhost/api/questionnaires/android/unsynced" \
--header "Content-Type: application/json" \
--header "Accept: application/json" \
--header "X-Requested-With: XMLHttpRequest"const url = new URL(
"http://localhost/api/questionnaires/android/unsynced"
);
const headers = {
"Content-Type": "application/json",
"Accept": "application/json",
"X-Requested-With": "XMLHttpRequest",
};
fetch(url, {
method: "GET",
headers,
}).then(response => response.json());$client = new \GuzzleHttp\Client();
$url = 'http://localhost/api/questionnaires/android/unsynced';
$response = $client->get(
$url,
[
'headers' => [
'Content-Type' => 'application/json',
'Accept' => 'application/json',
'X-Requested-With' => 'XMLHttpRequest',
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));Example response (401):
Show headers
cache-control: no-cache, private
content-type: application/json
access-control-allow-origin: *
{
"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.
GET api/me
Example request:
curl --request GET \
--get "http://localhost/api/me" \
--header "Content-Type: application/json" \
--header "Accept: application/json" \
--header "X-Requested-With: XMLHttpRequest"const url = new URL(
"http://localhost/api/me"
);
const headers = {
"Content-Type": "application/json",
"Accept": "application/json",
"X-Requested-With": "XMLHttpRequest",
};
fetch(url, {
method: "GET",
headers,
}).then(response => response.json());$client = new \GuzzleHttp\Client();
$url = 'http://localhost/api/me';
$response = $client->get(
$url,
[
'headers' => [
'Content-Type' => 'application/json',
'Accept' => 'application/json',
'X-Requested-With' => 'XMLHttpRequest',
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));Example response (401):
Show headers
cache-control: no-cache, private
content-type: application/json
access-control-allow-origin: *
{
"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.
PUT api/me
Example request:
curl --request PUT \
"http://localhost/api/me" \
--header "Content-Type: application/json" \
--header "Accept: application/json" \
--header "X-Requested-With: XMLHttpRequest"const url = new URL(
"http://localhost/api/me"
);
const headers = {
"Content-Type": "application/json",
"Accept": "application/json",
"X-Requested-With": "XMLHttpRequest",
};
fetch(url, {
method: "PUT",
headers,
}).then(response => response.json());$client = new \GuzzleHttp\Client();
$url = 'http://localhost/api/me';
$response = $client->put(
$url,
[
'headers' => [
'Content-Type' => 'application/json',
'Accept' => 'application/json',
'X-Requested-With' => 'XMLHttpRequest',
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));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.
PUT api/me/preferences
Example request:
curl --request PUT \
"http://localhost/api/me/preferences" \
--header "Content-Type: application/json" \
--header "Accept: application/json" \
--header "X-Requested-With: XMLHttpRequest"const url = new URL(
"http://localhost/api/me/preferences"
);
const headers = {
"Content-Type": "application/json",
"Accept": "application/json",
"X-Requested-With": "XMLHttpRequest",
};
fetch(url, {
method: "PUT",
headers,
}).then(response => response.json());$client = new \GuzzleHttp\Client();
$url = 'http://localhost/api/me/preferences';
$response = $client->put(
$url,
[
'headers' => [
'Content-Type' => 'application/json',
'Accept' => 'application/json',
'X-Requested-With' => 'XMLHttpRequest',
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));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.
POST api/me/profile-photo
Example request:
curl --request POST \
"http://localhost/api/me/profile-photo" \
--header "Content-Type: application/json" \
--header "Accept: application/json" \
--header "X-Requested-With: XMLHttpRequest"const url = new URL(
"http://localhost/api/me/profile-photo"
);
const headers = {
"Content-Type": "application/json",
"Accept": "application/json",
"X-Requested-With": "XMLHttpRequest",
};
fetch(url, {
method: "POST",
headers,
}).then(response => response.json());$client = new \GuzzleHttp\Client();
$url = 'http://localhost/api/me/profile-photo';
$response = $client->post(
$url,
[
'headers' => [
'Content-Type' => 'application/json',
'Accept' => 'application/json',
'X-Requested-With' => 'XMLHttpRequest',
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));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/me/sessions
Example request:
curl --request GET \
--get "http://localhost/api/me/sessions" \
--header "Content-Type: application/json" \
--header "Accept: application/json" \
--header "X-Requested-With: XMLHttpRequest"const url = new URL(
"http://localhost/api/me/sessions"
);
const headers = {
"Content-Type": "application/json",
"Accept": "application/json",
"X-Requested-With": "XMLHttpRequest",
};
fetch(url, {
method: "GET",
headers,
}).then(response => response.json());$client = new \GuzzleHttp\Client();
$url = 'http://localhost/api/me/sessions';
$response = $client->get(
$url,
[
'headers' => [
'Content-Type' => 'application/json',
'Accept' => 'application/json',
'X-Requested-With' => 'XMLHttpRequest',
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));Example response (401):
Show headers
cache-control: no-cache, private
content-type: application/json
access-control-allow-origin: *
{
"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.
GET api/me/stats
Example request:
curl --request GET \
--get "http://localhost/api/me/stats" \
--header "Content-Type: application/json" \
--header "Accept: application/json" \
--header "X-Requested-With: XMLHttpRequest"const url = new URL(
"http://localhost/api/me/stats"
);
const headers = {
"Content-Type": "application/json",
"Accept": "application/json",
"X-Requested-With": "XMLHttpRequest",
};
fetch(url, {
method: "GET",
headers,
}).then(response => response.json());$client = new \GuzzleHttp\Client();
$url = 'http://localhost/api/me/stats';
$response = $client->get(
$url,
[
'headers' => [
'Content-Type' => 'application/json',
'Accept' => 'application/json',
'X-Requested-With' => 'XMLHttpRequest',
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));Example response (401):
Show headers
cache-control: no-cache, private
content-type: application/json
access-control-allow-origin: *
{
"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.
GET api/me/questionnaires
Example request:
curl --request GET \
--get "http://localhost/api/me/questionnaires" \
--header "Content-Type: application/json" \
--header "Accept: application/json" \
--header "X-Requested-With: XMLHttpRequest"const url = new URL(
"http://localhost/api/me/questionnaires"
);
const headers = {
"Content-Type": "application/json",
"Accept": "application/json",
"X-Requested-With": "XMLHttpRequest",
};
fetch(url, {
method: "GET",
headers,
}).then(response => response.json());$client = new \GuzzleHttp\Client();
$url = 'http://localhost/api/me/questionnaires';
$response = $client->get(
$url,
[
'headers' => [
'Content-Type' => 'application/json',
'Accept' => 'application/json',
'X-Requested-With' => 'XMLHttpRequest',
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));Example response (401):
Show headers
cache-control: no-cache, private
content-type: application/json
access-control-allow-origin: *
{
"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.
GET api/me/questionnaires/stats
Example request:
curl --request GET \
--get "http://localhost/api/me/questionnaires/stats" \
--header "Content-Type: application/json" \
--header "Accept: application/json" \
--header "X-Requested-With: XMLHttpRequest"const url = new URL(
"http://localhost/api/me/questionnaires/stats"
);
const headers = {
"Content-Type": "application/json",
"Accept": "application/json",
"X-Requested-With": "XMLHttpRequest",
};
fetch(url, {
method: "GET",
headers,
}).then(response => response.json());$client = new \GuzzleHttp\Client();
$url = 'http://localhost/api/me/questionnaires/stats';
$response = $client->get(
$url,
[
'headers' => [
'Content-Type' => 'application/json',
'Accept' => 'application/json',
'X-Requested-With' => 'XMLHttpRequest',
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));Example response (401):
Show headers
cache-control: no-cache, private
content-type: application/json
access-control-allow-origin: *
{
"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.
GET api/me/questionnaires/recent
Example request:
curl --request GET \
--get "http://localhost/api/me/questionnaires/recent" \
--header "Content-Type: application/json" \
--header "Accept: application/json" \
--header "X-Requested-With: XMLHttpRequest"const url = new URL(
"http://localhost/api/me/questionnaires/recent"
);
const headers = {
"Content-Type": "application/json",
"Accept": "application/json",
"X-Requested-With": "XMLHttpRequest",
};
fetch(url, {
method: "GET",
headers,
}).then(response => response.json());$client = new \GuzzleHttp\Client();
$url = 'http://localhost/api/me/questionnaires/recent';
$response = $client->get(
$url,
[
'headers' => [
'Content-Type' => 'application/json',
'Accept' => 'application/json',
'X-Requested-With' => 'XMLHttpRequest',
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));Example response (401):
Show headers
cache-control: no-cache, private
content-type: application/json
access-control-allow-origin: *
{
"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.
GET api/me/questionnaires/pending-sync
Example request:
curl --request GET \
--get "http://localhost/api/me/questionnaires/pending-sync" \
--header "Content-Type: application/json" \
--header "Accept: application/json" \
--header "X-Requested-With: XMLHttpRequest"const url = new URL(
"http://localhost/api/me/questionnaires/pending-sync"
);
const headers = {
"Content-Type": "application/json",
"Accept": "application/json",
"X-Requested-With": "XMLHttpRequest",
};
fetch(url, {
method: "GET",
headers,
}).then(response => response.json());$client = new \GuzzleHttp\Client();
$url = 'http://localhost/api/me/questionnaires/pending-sync';
$response = $client->get(
$url,
[
'headers' => [
'Content-Type' => 'application/json',
'Accept' => 'application/json',
'X-Requested-With' => 'XMLHttpRequest',
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));Example response (401):
Show headers
cache-control: no-cache, private
content-type: application/json
access-control-allow-origin: *
{
"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.
GET api/admin/stats
Example request:
curl --request GET \
--get "http://localhost/api/admin/stats" \
--header "Content-Type: application/json" \
--header "Accept: application/json" \
--header "X-Requested-With: XMLHttpRequest"const url = new URL(
"http://localhost/api/admin/stats"
);
const headers = {
"Content-Type": "application/json",
"Accept": "application/json",
"X-Requested-With": "XMLHttpRequest",
};
fetch(url, {
method: "GET",
headers,
}).then(response => response.json());$client = new \GuzzleHttp\Client();
$url = 'http://localhost/api/admin/stats';
$response = $client->get(
$url,
[
'headers' => [
'Content-Type' => 'application/json',
'Accept' => 'application/json',
'X-Requested-With' => 'XMLHttpRequest',
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));Example response (401):
Show headers
cache-control: no-cache, private
content-type: application/json
access-control-allow-origin: *
{
"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.
GET api/admin/questionnaires/stats
Example request:
curl --request GET \
--get "http://localhost/api/admin/questionnaires/stats" \
--header "Content-Type: application/json" \
--header "Accept: application/json" \
--header "X-Requested-With: XMLHttpRequest"const url = new URL(
"http://localhost/api/admin/questionnaires/stats"
);
const headers = {
"Content-Type": "application/json",
"Accept": "application/json",
"X-Requested-With": "XMLHttpRequest",
};
fetch(url, {
method: "GET",
headers,
}).then(response => response.json());$client = new \GuzzleHttp\Client();
$url = 'http://localhost/api/admin/questionnaires/stats';
$response = $client->get(
$url,
[
'headers' => [
'Content-Type' => 'application/json',
'Accept' => 'application/json',
'X-Requested-With' => 'XMLHttpRequest',
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));Example response (401):
Show headers
cache-control: no-cache, private
content-type: application/json
access-control-allow-origin: *
{
"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.
POST api/admin/cleanup
Example request:
curl --request POST \
"http://localhost/api/admin/cleanup" \
--header "Content-Type: application/json" \
--header "Accept: application/json" \
--header "X-Requested-With: XMLHttpRequest"const url = new URL(
"http://localhost/api/admin/cleanup"
);
const headers = {
"Content-Type": "application/json",
"Accept": "application/json",
"X-Requested-With": "XMLHttpRequest",
};
fetch(url, {
method: "POST",
headers,
}).then(response => response.json());$client = new \GuzzleHttp\Client();
$url = 'http://localhost/api/admin/cleanup';
$response = $client->post(
$url,
[
'headers' => [
'Content-Type' => 'application/json',
'Accept' => 'application/json',
'X-Requested-With' => 'XMLHttpRequest',
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));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.
POST api/admin/users/bulk-action
Example request:
curl --request POST \
"http://localhost/api/admin/users/bulk-action" \
--header "Content-Type: application/json" \
--header "Accept: application/json" \
--header "X-Requested-With: XMLHttpRequest"const url = new URL(
"http://localhost/api/admin/users/bulk-action"
);
const headers = {
"Content-Type": "application/json",
"Accept": "application/json",
"X-Requested-With": "XMLHttpRequest",
};
fetch(url, {
method: "POST",
headers,
}).then(response => response.json());$client = new \GuzzleHttp\Client();
$url = 'http://localhost/api/admin/users/bulk-action';
$response = $client->post(
$url,
[
'headers' => [
'Content-Type' => 'application/json',
'Accept' => 'application/json',
'X-Requested-With' => 'XMLHttpRequest',
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));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/notifications
Example request:
curl --request GET \
--get "http://localhost/api/notifications" \
--header "Content-Type: application/json" \
--header "Accept: application/json" \
--header "X-Requested-With: XMLHttpRequest"const url = new URL(
"http://localhost/api/notifications"
);
const headers = {
"Content-Type": "application/json",
"Accept": "application/json",
"X-Requested-With": "XMLHttpRequest",
};
fetch(url, {
method: "GET",
headers,
}).then(response => response.json());$client = new \GuzzleHttp\Client();
$url = 'http://localhost/api/notifications';
$response = $client->get(
$url,
[
'headers' => [
'Content-Type' => 'application/json',
'Accept' => 'application/json',
'X-Requested-With' => 'XMLHttpRequest',
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));Example response (401):
Show headers
cache-control: no-cache, private
content-type: application/json
access-control-allow-origin: *
{
"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.
POST api/notifications/mark-read/{id}
Example request:
curl --request POST \
"http://localhost/api/notifications/mark-read/consequatur" \
--header "Content-Type: application/json" \
--header "Accept: application/json" \
--header "X-Requested-With: XMLHttpRequest"const url = new URL(
"http://localhost/api/notifications/mark-read/consequatur"
);
const headers = {
"Content-Type": "application/json",
"Accept": "application/json",
"X-Requested-With": "XMLHttpRequest",
};
fetch(url, {
method: "POST",
headers,
}).then(response => response.json());$client = new \GuzzleHttp\Client();
$url = 'http://localhost/api/notifications/mark-read/consequatur';
$response = $client->post(
$url,
[
'headers' => [
'Content-Type' => 'application/json',
'Accept' => 'application/json',
'X-Requested-With' => 'XMLHttpRequest',
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));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/config
Example request:
curl --request GET \
--get "http://localhost/api/config" \
--header "Content-Type: application/json" \
--header "Accept: application/json" \
--header "X-Requested-With: XMLHttpRequest"const url = new URL(
"http://localhost/api/config"
);
const headers = {
"Content-Type": "application/json",
"Accept": "application/json",
"X-Requested-With": "XMLHttpRequest",
};
fetch(url, {
method: "GET",
headers,
}).then(response => response.json());$client = new \GuzzleHttp\Client();
$url = 'http://localhost/api/config';
$response = $client->get(
$url,
[
'headers' => [
'Content-Type' => 'application/json',
'Accept' => 'application/json',
'X-Requested-With' => 'XMLHttpRequest',
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));Example response (401):
Show headers
cache-control: no-cache, private
content-type: application/json
access-control-allow-origin: *
{
"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.
GET api/config/questionnaires
Example request:
curl --request GET \
--get "http://localhost/api/config/questionnaires" \
--header "Content-Type: application/json" \
--header "Accept: application/json" \
--header "X-Requested-With: XMLHttpRequest"const url = new URL(
"http://localhost/api/config/questionnaires"
);
const headers = {
"Content-Type": "application/json",
"Accept": "application/json",
"X-Requested-With": "XMLHttpRequest",
};
fetch(url, {
method: "GET",
headers,
}).then(response => response.json());$client = new \GuzzleHttp\Client();
$url = 'http://localhost/api/config/questionnaires';
$response = $client->get(
$url,
[
'headers' => [
'Content-Type' => 'application/json',
'Accept' => 'application/json',
'X-Requested-With' => 'XMLHttpRequest',
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));Example response (401):
Show headers
cache-control: no-cache, private
content-type: application/json
access-control-allow-origin: *
{
"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.
GET api/{fallbackPlaceholder}
Example request:
curl --request GET \
--get "http://localhost/api/2UZ5i" \
--header "Content-Type: application/json" \
--header "Accept: application/json" \
--header "X-Requested-With: XMLHttpRequest"const url = new URL(
"http://localhost/api/2UZ5i"
);
const headers = {
"Content-Type": "application/json",
"Accept": "application/json",
"X-Requested-With": "XMLHttpRequest",
};
fetch(url, {
method: "GET",
headers,
}).then(response => response.json());$client = new \GuzzleHttp\Client();
$url = 'http://localhost/api/2UZ5i';
$response = $client->get(
$url,
[
'headers' => [
'Content-Type' => 'application/json',
'Accept' => 'application/json',
'X-Requested-With' => 'XMLHttpRequest',
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));Example response (404):
Show headers
cache-control: no-cache, private
content-type: application/json
x-ratelimit-limit: 60
x-ratelimit-remaining: 58
access-control-allow-origin: *
{
"success": false,
"message": "Endpoint no encontrado",
"error_code": "NOT_FOUND",
"available_endpoints": {
"auth": "/api/auth/{login,register,logout}",
"users": "/api/users",
"sync": "/api/sync/{upload,download,status}",
"questionnaires": "/api/questionnaires",
"me": "/api/me",
"admin": "/api/admin"
},
"questionnaire_endpoints": {
"list": "GET /api/questionnaires",
"create": "POST /api/questionnaires",
"show": "GET /api/questionnaires/{id}",
"update": "PUT /api/questionnaires/{id}",
"delete": "DELETE /api/questionnaires/{id}",
"stats": "GET /api/questionnaires/stats/summary",
"search": "GET /api/questionnaires/search/query",
"export": "GET /api/questionnaires/export/data"
}
}
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.
CEDIS
APIs para gestionar centros de distribución (CEDIS)
Obtener CEDIS activos
Retorna únicamente los CEDIS que están marcados como activos, ordenados alfabéticamente por nombre.
Example request:
curl --request GET \
--get "http://localhost/api/cedis/active" \
--header "Content-Type: application/json" \
--header "Accept: application/json" \
--header "X-Requested-With: XMLHttpRequest"const url = new URL(
"http://localhost/api/cedis/active"
);
const headers = {
"Content-Type": "application/json",
"Accept": "application/json",
"X-Requested-With": "XMLHttpRequest",
};
fetch(url, {
method: "GET",
headers,
}).then(response => response.json());$client = new \GuzzleHttp\Client();
$url = 'http://localhost/api/cedis/active';
$response = $client->get(
$url,
[
'headers' => [
'Content-Type' => 'application/json',
'Accept' => 'application/json',
'X-Requested-With' => 'XMLHttpRequest',
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));Example response (200):
{
"success": true,
"data": [
{
"id": 1,
"nombre": "CEDIS Ciudad de México",
"codigo": "CDMX-001",
"activo": true,
"created_at": "2024-01-15T10:00:00.000000Z",
"updated_at": "2024-01-15T10:00:00.000000Z"
},
{
"id": 2,
"nombre": "CEDIS Guadalajara",
"codigo": "GDL-001",
"activo": true,
"created_at": "2024-01-15T10:00:00.000000Z",
"updated_at": "2024-01-15T10:00:00.000000Z"
}
],
"total": 2
}
Example response (500):
{
"success": false,
"message": "Error al obtener los CEDIS activos",
"error": "Database connection failed"
}
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 todos los CEDIS
Obtiene la lista completa de CEDIS con opciones de filtrado.
Example request:
curl --request GET \
--get "http://localhost/api/cedis?activo=1&search=CDMX" \
--header "Content-Type: application/json" \
--header "Accept: application/json" \
--header "X-Requested-With: XMLHttpRequest"const url = new URL(
"http://localhost/api/cedis"
);
const params = {
"activo": "1",
"search": "CDMX",
};
Object.keys(params)
.forEach(key => url.searchParams.append(key, params[key]));
const headers = {
"Content-Type": "application/json",
"Accept": "application/json",
"X-Requested-With": "XMLHttpRequest",
};
fetch(url, {
method: "GET",
headers,
}).then(response => response.json());$client = new \GuzzleHttp\Client();
$url = 'http://localhost/api/cedis';
$response = $client->get(
$url,
[
'headers' => [
'Content-Type' => 'application/json',
'Accept' => 'application/json',
'X-Requested-With' => 'XMLHttpRequest',
],
'query' => [
'activo' => '1',
'search' => 'CDMX',
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));Example response (200):
{
"success": true,
"data": [
{
"id": 1,
"nombre": "CEDIS Ciudad de México",
"codigo": "CDMX-001",
"activo": true,
"created_at": "2024-01-15T10:00:00.000000Z",
"updated_at": "2024-01-15T10:00:00.000000Z"
}
],
"total": 1
}
Example response (422):
{
"success": false,
"message": "Parámetros inválidos",
"errors": {
"activo": [
"El campo activo debe ser verdadero o falso"
]
}
}
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 un CEDIS específico
Recupera la información detallada de un CEDIS por su ID.
Example request:
curl --request GET \
--get "http://localhost/api/cedis/1" \
--header "Content-Type: application/json" \
--header "Accept: application/json" \
--header "X-Requested-With: XMLHttpRequest"const url = new URL(
"http://localhost/api/cedis/1"
);
const headers = {
"Content-Type": "application/json",
"Accept": "application/json",
"X-Requested-With": "XMLHttpRequest",
};
fetch(url, {
method: "GET",
headers,
}).then(response => response.json());$client = new \GuzzleHttp\Client();
$url = 'http://localhost/api/cedis/1';
$response = $client->get(
$url,
[
'headers' => [
'Content-Type' => 'application/json',
'Accept' => 'application/json',
'X-Requested-With' => 'XMLHttpRequest',
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));Example response (200):
{
"success": true,
"data": {
"id": 1,
"nombre": "CEDIS Ciudad de México",
"codigo": "CDMX-001",
"activo": true,
"created_at": "2024-01-15T10:00:00.000000Z",
"updated_at": "2024-01-15T10:00:00.000000Z"
}
}
Example response (404):
{
"success": false,
"message": "CEDIS 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.
Cuestionarios
APIs para gestión de cuestionarios con soporte de sincronización offline
Listar cuestionarios
requires authentication
Obtiene la lista de cuestionarios del usuario con filtros y paginación.
Example request:
curl --request GET \
--get "http://localhost/api/questionnaires?page=1&per_page=20&folio=F-001&cedis=CDMX&cuadrilla=A&sync_status=synced&date_from=2024-01-01&date_to=2024-01-31&sort_by=created_at&sort_order=desc" \
--header "Authorization: Bearer Bearer {your-token-here}" \
--header "Content-Type: application/json" \
--header "Accept: application/json" \
--header "X-Requested-With: XMLHttpRequest"const url = new URL(
"http://localhost/api/questionnaires"
);
const params = {
"page": "1",
"per_page": "20",
"folio": "F-001",
"cedis": "CDMX",
"cuadrilla": "A",
"sync_status": "synced",
"date_from": "2024-01-01",
"date_to": "2024-01-31",
"sort_by": "created_at",
"sort_order": "desc",
};
Object.keys(params)
.forEach(key => url.searchParams.append(key, params[key]));
const headers = {
"Authorization": "Bearer Bearer {your-token-here}",
"Content-Type": "application/json",
"Accept": "application/json",
"X-Requested-With": "XMLHttpRequest",
};
fetch(url, {
method: "GET",
headers,
}).then(response => response.json());$client = new \GuzzleHttp\Client();
$url = 'http://localhost/api/questionnaires';
$response = $client->get(
$url,
[
'headers' => [
'Authorization' => 'Bearer Bearer {your-token-here}',
'Content-Type' => 'application/json',
'Accept' => 'application/json',
'X-Requested-With' => 'XMLHttpRequest',
],
'query' => [
'page' => '1',
'per_page' => '20',
'folio' => 'F-001',
'cedis' => 'CDMX',
'cuadrilla' => 'A',
'sync_status' => 'synced',
'date_from' => '2024-01-01',
'date_to' => '2024-01-31',
'sort_by' => 'created_at',
'sort_order' => 'desc',
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));Example response (200):
{
"success": true,
"data": {
"questionnaires": [
{
"id": 1,
"folio": "F-001",
"cedis": "CDMX",
"sync_status": "synced"
}
],
"total": 100,
"page": 1,
"per_page": 20
}
}
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 nuevo cuestionario POST /api/questionnaires
Example request:
curl --request POST \
"http://localhost/api/questionnaires" \
--header "Content-Type: application/json" \
--header "Accept: application/json" \
--header "X-Requested-With: XMLHttpRequest"const url = new URL(
"http://localhost/api/questionnaires"
);
const headers = {
"Content-Type": "application/json",
"Accept": "application/json",
"X-Requested-With": "XMLHttpRequest",
};
fetch(url, {
method: "POST",
headers,
}).then(response => response.json());$client = new \GuzzleHttp\Client();
$url = 'http://localhost/api/questionnaires';
$response = $client->post(
$url,
[
'headers' => [
'Content-Type' => 'application/json',
'Accept' => 'application/json',
'X-Requested-With' => 'XMLHttpRequest',
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));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.
Mostrar cuestionario específico GET /api/questionnaires/{questionnaire}
Example request:
curl --request GET \
--get "http://localhost/api/questionnaires/33" \
--header "Content-Type: application/json" \
--header "Accept: application/json" \
--header "X-Requested-With: XMLHttpRequest"const url = new URL(
"http://localhost/api/questionnaires/33"
);
const headers = {
"Content-Type": "application/json",
"Accept": "application/json",
"X-Requested-With": "XMLHttpRequest",
};
fetch(url, {
method: "GET",
headers,
}).then(response => response.json());$client = new \GuzzleHttp\Client();
$url = 'http://localhost/api/questionnaires/33';
$response = $client->get(
$url,
[
'headers' => [
'Content-Type' => 'application/json',
'Accept' => 'application/json',
'X-Requested-With' => 'XMLHttpRequest',
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));Example response (401):
Show headers
cache-control: no-cache, private
content-type: application/json
access-control-allow-origin: *
{
"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.
Actualizar cuestionario PUT/PATCH /api/questionnaires/{questionnaire}
Example request:
curl --request PUT \
"http://localhost/api/questionnaires/33" \
--header "Content-Type: application/json" \
--header "Accept: application/json" \
--header "X-Requested-With: XMLHttpRequest"const url = new URL(
"http://localhost/api/questionnaires/33"
);
const headers = {
"Content-Type": "application/json",
"Accept": "application/json",
"X-Requested-With": "XMLHttpRequest",
};
fetch(url, {
method: "PUT",
headers,
}).then(response => response.json());$client = new \GuzzleHttp\Client();
$url = 'http://localhost/api/questionnaires/33';
$response = $client->put(
$url,
[
'headers' => [
'Content-Type' => 'application/json',
'Accept' => 'application/json',
'X-Requested-With' => 'XMLHttpRequest',
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));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 cuestionario PUT/PATCH /api/questionnaires/{questionnaire}
Example request:
curl --request PATCH \
"http://localhost/api/questionnaires/33" \
--header "Content-Type: application/json" \
--header "Accept: application/json" \
--header "X-Requested-With: XMLHttpRequest"const url = new URL(
"http://localhost/api/questionnaires/33"
);
const headers = {
"Content-Type": "application/json",
"Accept": "application/json",
"X-Requested-With": "XMLHttpRequest",
};
fetch(url, {
method: "PATCH",
headers,
}).then(response => response.json());$client = new \GuzzleHttp\Client();
$url = 'http://localhost/api/questionnaires/33';
$response = $client->patch(
$url,
[
'headers' => [
'Content-Type' => 'application/json',
'Accept' => 'application/json',
'X-Requested-With' => 'XMLHttpRequest',
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));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 cuestionario DELETE /api/questionnaires/{questionnaire}
Example request:
curl --request DELETE \
"http://localhost/api/questionnaires/33" \
--header "Content-Type: application/json" \
--header "Accept: application/json" \
--header "X-Requested-With: XMLHttpRequest"const url = new URL(
"http://localhost/api/questionnaires/33"
);
const headers = {
"Content-Type": "application/json",
"Accept": "application/json",
"X-Requested-With": "XMLHttpRequest",
};
fetch(url, {
method: "DELETE",
headers,
}).then(response => response.json());$client = new \GuzzleHttp\Client();
$url = 'http://localhost/api/questionnaires/33';
$response = $client->delete(
$url,
[
'headers' => [
'Content-Type' => 'application/json',
'Accept' => 'application/json',
'X-Requested-With' => 'XMLHttpRequest',
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));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 estadísticas de cuestionarios GET /api/questionnaires/stats
Example request:
curl --request GET \
--get "http://localhost/api/questionnaires/stats/summary" \
--header "Content-Type: application/json" \
--header "Accept: application/json" \
--header "X-Requested-With: XMLHttpRequest"const url = new URL(
"http://localhost/api/questionnaires/stats/summary"
);
const headers = {
"Content-Type": "application/json",
"Accept": "application/json",
"X-Requested-With": "XMLHttpRequest",
};
fetch(url, {
method: "GET",
headers,
}).then(response => response.json());$client = new \GuzzleHttp\Client();
$url = 'http://localhost/api/questionnaires/stats/summary';
$response = $client->get(
$url,
[
'headers' => [
'Content-Type' => 'application/json',
'Accept' => 'application/json',
'X-Requested-With' => 'XMLHttpRequest',
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));Example response (401):
Show headers
cache-control: no-cache, private
content-type: application/json
access-control-allow-origin: *
{
"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.
Buscar cuestionarios GET /api/questionnaires/search
Example request:
curl --request GET \
--get "http://localhost/api/questionnaires/search/query" \
--header "Content-Type: application/json" \
--header "Accept: application/json" \
--header "X-Requested-With: XMLHttpRequest"const url = new URL(
"http://localhost/api/questionnaires/search/query"
);
const headers = {
"Content-Type": "application/json",
"Accept": "application/json",
"X-Requested-With": "XMLHttpRequest",
};
fetch(url, {
method: "GET",
headers,
}).then(response => response.json());$client = new \GuzzleHttp\Client();
$url = 'http://localhost/api/questionnaires/search/query';
$response = $client->get(
$url,
[
'headers' => [
'Content-Type' => 'application/json',
'Accept' => 'application/json',
'X-Requested-With' => 'XMLHttpRequest',
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));Example response (401):
Show headers
cache-control: no-cache, private
content-type: application/json
access-control-allow-origin: *
{
"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.
Exportar cuestionarios GET /api/questionnaires/export
Example request:
curl --request GET \
--get "http://localhost/api/questionnaires/export/data" \
--header "Content-Type: application/json" \
--header "Accept: application/json" \
--header "X-Requested-With: XMLHttpRequest"const url = new URL(
"http://localhost/api/questionnaires/export/data"
);
const headers = {
"Content-Type": "application/json",
"Accept": "application/json",
"X-Requested-With": "XMLHttpRequest",
};
fetch(url, {
method: "GET",
headers,
}).then(response => response.json());$client = new \GuzzleHttp\Client();
$url = 'http://localhost/api/questionnaires/export/data';
$response = $client->get(
$url,
[
'headers' => [
'Content-Type' => 'application/json',
'Accept' => 'application/json',
'X-Requested-With' => 'XMLHttpRequest',
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));Example response (401):
Show headers
cache-control: no-cache, private
content-type: application/json
access-control-allow-origin: *
{
"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.
Obtener cuestionarios duplicados por folio GET /api/questionnaires/duplicates
Example request:
curl --request GET \
--get "http://localhost/api/questionnaires/duplicates/list" \
--header "Content-Type: application/json" \
--header "Accept: application/json" \
--header "X-Requested-With: XMLHttpRequest"const url = new URL(
"http://localhost/api/questionnaires/duplicates/list"
);
const headers = {
"Content-Type": "application/json",
"Accept": "application/json",
"X-Requested-With": "XMLHttpRequest",
};
fetch(url, {
method: "GET",
headers,
}).then(response => response.json());$client = new \GuzzleHttp\Client();
$url = 'http://localhost/api/questionnaires/duplicates/list';
$response = $client->get(
$url,
[
'headers' => [
'Content-Type' => 'application/json',
'Accept' => 'application/json',
'X-Requested-With' => 'XMLHttpRequest',
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));Example response (401):
Show headers
cache-control: no-cache, private
content-type: application/json
access-control-allow-origin: *
{
"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.
Validate the given request with the given rules.
Example request:
curl --request POST \
"http://localhost/api/questionnaires/validate/check" \
--header "Content-Type: application/json" \
--header "Accept: application/json" \
--header "X-Requested-With: XMLHttpRequest"const url = new URL(
"http://localhost/api/questionnaires/validate/check"
);
const headers = {
"Content-Type": "application/json",
"Accept": "application/json",
"X-Requested-With": "XMLHttpRequest",
};
fetch(url, {
method: "POST",
headers,
}).then(response => response.json());$client = new \GuzzleHttp\Client();
$url = 'http://localhost/api/questionnaires/validate/check';
$response = $client->post(
$url,
[
'headers' => [
'Content-Type' => 'application/json',
'Accept' => 'application/json',
'X-Requested-With' => 'XMLHttpRequest',
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));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 cuestionarios como sincronizados POST /api/questionnaires/mark-synced
Example request:
curl --request POST \
"http://localhost/api/questionnaires/bulk/mark-synced" \
--header "Content-Type: application/json" \
--header "Accept: application/json" \
--header "X-Requested-With: XMLHttpRequest"const url = new URL(
"http://localhost/api/questionnaires/bulk/mark-synced"
);
const headers = {
"Content-Type": "application/json",
"Accept": "application/json",
"X-Requested-With": "XMLHttpRequest",
};
fetch(url, {
method: "POST",
headers,
}).then(response => response.json());$client = new \GuzzleHttp\Client();
$url = 'http://localhost/api/questionnaires/bulk/mark-synced';
$response = $client->post(
$url,
[
'headers' => [
'Content-Type' => 'application/json',
'Accept' => 'application/json',
'X-Requested-With' => 'XMLHttpRequest',
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));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.
Verificar existencia y estado de sincronización de un cuestionario por folio y cedis GET /api/questionnaires/verify/{folio}?cedis=CDMX
Example request:
curl --request GET \
--get "http://localhost/api/questionnaires/verify/consequatur" \
--header "Content-Type: application/json" \
--header "Accept: application/json" \
--header "X-Requested-With: XMLHttpRequest"const url = new URL(
"http://localhost/api/questionnaires/verify/consequatur"
);
const headers = {
"Content-Type": "application/json",
"Accept": "application/json",
"X-Requested-With": "XMLHttpRequest",
};
fetch(url, {
method: "GET",
headers,
}).then(response => response.json());$client = new \GuzzleHttp\Client();
$url = 'http://localhost/api/questionnaires/verify/consequatur';
$response = $client->get(
$url,
[
'headers' => [
'Content-Type' => 'application/json',
'Accept' => 'application/json',
'X-Requested-With' => 'XMLHttpRequest',
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));Example response (401):
Show headers
cache-control: no-cache, private
content-type: application/json
access-control-allow-origin: *
{
"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.
Resetear estado de sincronización POST /api/questionnaires/{questionnaire}/reset-sync
Example request:
curl --request POST \
"http://localhost/api/questionnaires/33/reset-sync" \
--header "Content-Type: application/json" \
--header "Accept: application/json" \
--header "X-Requested-With: XMLHttpRequest"const url = new URL(
"http://localhost/api/questionnaires/33/reset-sync"
);
const headers = {
"Content-Type": "application/json",
"Accept": "application/json",
"X-Requested-With": "XMLHttpRequest",
};
fetch(url, {
method: "POST",
headers,
}).then(response => response.json());$client = new \GuzzleHttp\Client();
$url = 'http://localhost/api/questionnaires/33/reset-sync';
$response = $client->post(
$url,
[
'headers' => [
'Content-Type' => 'application/json',
'Accept' => 'application/json',
'X-Requested-With' => 'XMLHttpRequest',
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));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.