MENU navbar-image

Introduction

funciona alg

Documentación general de la API .

Authenticating requests

This API is not authenticated.

Autenticación

Iniciar sesión

Este endpoint permite autenticar a un usuario mediante correo y contraseña. Si las credenciales son correctas, devuelve un token que se utilizará para autenticar las siguientes peticiones.

Example request:
curl --request POST \
    "https://www.nexasplay.com/api/login" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --data "{
    \"email\": \"qkunze@example.com\",
    \"password\": \"O[2UZ5ij-e\\/dl4m{o,\"
}"
const url = new URL(
    "https://www.nexasplay.com/api/login"
);

const headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
};

let body = {
    "email": "qkunze@example.com",
    "password": "O[2UZ5ij-e\/dl4m{o,"
};

fetch(url, {
    method: "POST",
    headers,
    body: JSON.stringify(body),
}).then(response => response.json());

Example response (200):


{
    "access_token": "eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9...",
    "token_type": "bearer",
    "expires_in": 60
}
 

Example response (401):


{
    "error": "Unauthorized"
}
 

Request      

POST api/login

Headers

Content-Type      

Example: application/json

Accept      

Example: application/json

Body Parameters

email   string   

Correo electrónico del usuario. Ejemplo: cliente1@nexaxplay.com Example: qkunze@example.com

password   string   

Contraseña del usuario. Ejemplo: 123456789 Example: O[2UZ5ij-e/dl4m{o,

Registrar un nuevo usuario.

Permite crear un nuevo usuario en el sistema proporcionando los datos personales requeridos. Retorna un token JWT para autenticación posterior.

Example request:
curl --request POST \
    "https://www.nexasplay.com/api/register" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --data "{
    \"first_name\": \"consequatur\",
    \"last_name\": \"consequatur\",
    \"email\": \"qkunze@example.com\",
    \"password\": \"O[2UZ5ij-e\\/dl4m{o,\",
    \"phone\": \"consequatur\",
    \"password_confirmation\": \"consequatur\",
    \"birthdate\": \"consequatur\",
    \"gender\": \"consequatur\",
    \"current_city\": \"consequatur\"
}"
const url = new URL(
    "https://www.nexasplay.com/api/register"
);

const headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
};

let body = {
    "first_name": "consequatur",
    "last_name": "consequatur",
    "email": "qkunze@example.com",
    "password": "O[2UZ5ij-e\/dl4m{o,",
    "phone": "consequatur",
    "password_confirmation": "consequatur",
    "birthdate": "consequatur",
    "gender": "consequatur",
    "current_city": "consequatur"
};

fetch(url, {
    method: "POST",
    headers,
    body: JSON.stringify(body),
}).then(response => response.json());

Example response (200):


{
    "access_token": "eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9...",
    "token_type": "bearer",
    "expires_in": 60
}
 

Example response (422):


{
    "email": [
        "The email has already been taken."
    ]
}
 

Request      

POST api/register

Headers

Content-Type      

Example: application/json

Accept      

Example: application/json

Body Parameters

first_name   string   

Nombre del usuario. Ejemplo: Sean Example: consequatur

last_name   string   

Apellido del usuario. Ejemplo: paul Example: consequatur

email   string   

Correo electrónico válido y único. Ejemplo: seanpuol@gmail.com Example: qkunze@example.com

password   string   

Contraseña con mínimo 8 caracteres. Ejemplo: 123456789 Example: O[2UZ5ij-e/dl4m{o,

phone   string   

Número de teléfono único. Ejemplo: 30243614512 Example: consequatur

password_confirmation   string   

Confirmación de la contraseña. Ejemplo: 123456789 Example: consequatur

birthdate   date   

Fecha de nacimiento en formato Y-m-d. Ejemplo: 1989-04-15 Example: consequatur

gender   string   

Género del usuario (M o F). Ejemplo: M Example: consequatur

current_city   string   

Ciudad actual del usuario. Ejemplo: Pasto Example: consequatur

Cerrar sesión

Este endpoint cierra la sesión del usuario autenticado invalidando su token JWT. Después de cerrar sesión, el token ya no será válido para futuras peticiones.

Example request:
curl --request POST \
    "https://www.nexasplay.com/api/logout" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json"
const url = new URL(
    "https://www.nexasplay.com/api/logout"
);

const headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
};

fetch(url, {
    method: "POST",
    headers,
}).then(response => response.json());

Example response (200):


{
    "message": "Successfully logged out"
}
 

Example response (401):


{
    "message": "Token inválido o expirado"
}
 

Request      

POST api/logout

Headers

Content-Type      

Example: application/json

Accept      

Example: application/json

Refrescar token JWT

Este endpoint permite renovar el token JWT del usuario autenticado cuando está próximo a expirar. Devuelve un nuevo token válido que debe reemplazar al anterior en las siguientes peticiones.

Example request:
curl --request POST \
    "https://www.nexasplay.com/api/refresh" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json"
const url = new URL(
    "https://www.nexasplay.com/api/refresh"
);

const headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
};

fetch(url, {
    method: "POST",
    headers,
}).then(response => response.json());

Example response (200):


{
    "access_token": "eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9...",
    "token_type": "bearer",
    "expires_in": 60
}
 

Example response (401):


{
    "message": "Token inválido o expirado"
}
 

Request      

POST api/refresh

Headers

Content-Type      

Example: application/json

Accept      

Example: application/json

Obtener token de acceso desde una API Key

Este endpoint genera un token JWT válido para el usuario asociado a una API Key. Se usa cuando un sistema externo necesita autenticarse sin usar usuario y contraseña.

Example request:
curl --request POST \
    "https://www.nexasplay.com/api/token" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --data "{
    \"key\": \"consequatur\"
}"
const url = new URL(
    "https://www.nexasplay.com/api/token"
);

const headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
};

let body = {
    "key": "consequatur"
};

fetch(url, {
    method: "POST",
    headers,
    body: JSON.stringify(body),
}).then(response => response.json());

Example response (200):


{
    "access_token": "eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9..."
}
 

Example response (400):


{
    "message": "Invalid Api Key"
}
 

Example response (401):


{
    "message": "Unauthorized"
}
 

Request      

POST api/token

Headers

Content-Type      

Example: application/json

Accept      

Example: application/json

Body Parameters

key   string   

Clave API válida asociada a un usuario. Ejemplo: 4f9b28b5e912f7a2b1d4c8e7 Example: consequatur

Billetera de Usuario

Obtener Saldos

Devuelve los saldos actuales de monedas (coins) y el total de tickets (globalTickets) del usuario autenticado.

Example request:
curl --request GET \
    --get "https://www.nexasplay.com/api/user-balances" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json"
const url = new URL(
    "https://www.nexasplay.com/api/user-balances"
);

const headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
};

fetch(url, {
    method: "GET",
    headers,
}).then(response => response.json());

Example response (200):


{
    "data": {
        "coins": 150,
        "globalTickets": 75
    }
}
 

Example response (500):


{
    "message": "No se pudieron obtener los saldos. Intenta más tarde."
}
 

Request      

GET api/user-balances

Headers

Content-Type      

Example: application/json

Accept      

Example: application/json

Historial de Transacciones

Devuelve un historial paginado de todas las transacciones de monedas y tickets del usuario autenticado, ordenadas por fecha (más recientes primero).

Example request:
curl --request GET \
    --get "https://www.nexasplay.com/api/user-transactions?page=1" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json"
const url = new URL(
    "https://www.nexasplay.com/api/user-transactions"
);

const params = {
    "page": "1",
};
Object.keys(params)
    .forEach(key => url.searchParams.append(key, params[key]));

const headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
};

fetch(url, {
    method: "GET",
    headers,
}).then(response => response.json());

Example response (200):


{
  "current_page": 1,
  "data": [
    {
      "currency": "tickets",
      "type": "assign",
      "amount": 25,
      "source": "Premio diario",
      "date": "2025-09-30T10:30:00Z"
    },
    {
      "currency": "coins",
      "type": "spend",
      "amount": 10,
      "source": "Jugar a Pac-Man",
      "date": "2025-09-30T09:15:00Z"
    }
  ],
}
 

Request      

GET api/user-transactions

Headers

Content-Type      

Example: application/json

Accept      

Example: application/json

Query Parameters

page   integer  optional  

Página del historial que se desea ver. Example: 1

Compañías

Actualizar una Compañía

Permite a un administrador de compañía actualizar los detalles de su propia compañía. El usuario debe tener el permiso 'edit_companies' y pertenecer a la compañía que intenta actualizar.

Example request:
curl --request PUT \
    "https://www.nexasplay.com/api/companies-edit/1" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --data "{
    \"name\": \"\\\"Gama Arcades (Centro)\\\"\",
    \"description\": \"\\\"La mejor sala de juegos del centro.\\\"\",
    \"phone\": \"\\\"3109876543\\\"\",
    \"catalog\": \"consequatur\",
    \"schedule\": \"\\\"L-V: 10am-8pm\\\"\",
    \"address\": \"\\\"Calle 10 #1-23\\\"\",
    \"city\": \"mqeopfuudtdsufvyvddqa\",
    \"location\": \"\\\"1.2130,-77.2780\\\"\",
    \"game_room\": \"consequatur\",
    \"label_ids\": [
        1,
        3
    ]
}"
const url = new URL(
    "https://www.nexasplay.com/api/companies-edit/1"
);

const headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
};

let body = {
    "name": "\"Gama Arcades (Centro)\"",
    "description": "\"La mejor sala de juegos del centro.\"",
    "phone": "\"3109876543\"",
    "catalog": "consequatur",
    "schedule": "\"L-V: 10am-8pm\"",
    "address": "\"Calle 10 #1-23\"",
    "city": "mqeopfuudtdsufvyvddqa",
    "location": "\"1.2130,-77.2780\"",
    "game_room": "consequatur",
    "label_ids": [
        1,
        3
    ]
};

fetch(url, {
    method: "PUT",
    headers,
    body: JSON.stringify(body),
}).then(response => response.json());

Example response (200):


{
    "data": {
        "id": 1,
        "name": "Gama Arcades (Centro)",
        "logoUrl": null,
        "description": "La mejor sala de juegos del centro.",
        "phone": "3109876543",
        "city": "Pasto",
        "location": "1.2130,-77.2780",
        "labels": [
            {
                "id": 1,
                "name": "Restaurante"
            },
            {
                "id": 3,
                "name": "Familiar"
            }
        ],
        "services": [
            {
                "id": 1,
                "name": "Wi-Fi Gratis"
            },
            {
                "id": 2,
                "name": "Estacionamiento"
            }
        ]
    }
}
 

Example response (403):


{
    "message": "No autorizado para modificar esta compañía."
}
 

Example response (404):


{
    "message": "Compañía no encontrada."
}
 

Request      

PUT api/companies-edit/{company_id}

Headers

Content-Type      

Example: application/json

Accept      

Example: application/json

URL Parameters

company_id   integer   

The ID of the company. Example: 1

company   string   

El ID de la compañía a actualizar. Example: 1

Body Parameters

name   string  optional  

El nuevo nombre de la compañía. Example: "Gama Arcades (Centro)"

description   string  optional  

La nueva descripción. Example: "La mejor sala de juegos del centro."

phone   string  optional  

El nuevo teléfono. Example: "3109876543"

catalog   string  optional  

Example: consequatur

schedule   string  optional  

El nuevo horario. Example: "L-V: 10am-8pm"

address   string  optional  

La nueva dirección. Example: "Calle 10 #1-23"

city   string  optional  

Must not be greater than 100 characters. Example: mqeopfuudtdsufvyvddqa

location   string  optional  

Las nuevas coordenadas. Example: "1.2130,-77.2780"

game_room   string  optional  

Example: consequatur

label_ids   string[]  optional  

Un array de IDs de las etiquetas que esta compañía debe tener.

Endpoints

POST api/match/join

Example request:
curl --request POST \
    "https://www.nexasplay.com/api/match/join" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json"
const url = new URL(
    "https://www.nexasplay.com/api/match/join"
);

const headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
};

fetch(url, {
    method: "POST",
    headers,
}).then(response => response.json());

Request      

POST api/match/join

Headers

Content-Type      

Example: application/json

Accept      

Example: application/json

GET api/rooms/{room_id}

Example request:
curl --request GET \
    --get "https://www.nexasplay.com/api/rooms/4" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json"
const url = new URL(
    "https://www.nexasplay.com/api/rooms/4"
);

const headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
};

fetch(url, {
    method: "GET",
    headers,
}).then(response => response.json());

Example response (401):

Show headers
cache-control: no-cache, private
content-type: application/json
access-control-allow-origin: *
 

{
    "message": "Unauthenticated."
}
 

Request      

GET api/rooms/{room_id}

Headers

Content-Type      

Example: application/json

Accept      

Example: application/json

URL Parameters

room_id   integer   

The ID of the room. Example: 4

GET api/user

Example request:
curl --request GET \
    --get "https://www.nexasplay.com/api/user" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json"
const url = new URL(
    "https://www.nexasplay.com/api/user"
);

const headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
};

fetch(url, {
    method: "GET",
    headers,
}).then(response => response.json());

Example response (401):

Show headers
cache-control: no-cache, private
content-type: application/json
access-control-allow-origin: *
 

{
    "message": "Unauthenticated."
}
 

Request      

GET api/user

Headers

Content-Type      

Example: application/json

Accept      

Example: application/json

GET api/{datatype}

Example request:
curl --request GET \
    --get "https://www.nexasplay.com/api/consequatur" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json"
const url = new URL(
    "https://www.nexasplay.com/api/consequatur"
);

const headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
};

fetch(url, {
    method: "GET",
    headers,
}).then(response => response.json());

Example response (401):

Show headers
cache-control: no-cache, private
content-type: application/json
access-control-allow-origin: *
 

{
    "message": "Unauthenticated."
}
 

Request      

GET api/{datatype}

Headers

Content-Type      

Example: application/json

Accept      

Example: application/json

URL Parameters

datatype   string   

Example: consequatur

GET api/{datatype}/{id}

Example request:
curl --request GET \
    --get "https://www.nexasplay.com/api/consequatur/consequatur" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json"
const url = new URL(
    "https://www.nexasplay.com/api/consequatur/consequatur"
);

const headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
};

fetch(url, {
    method: "GET",
    headers,
}).then(response => response.json());

Example response (401):

Show headers
cache-control: no-cache, private
content-type: application/json
access-control-allow-origin: *
 

{
    "message": "Unauthenticated."
}
 

Request      

GET api/{datatype}/{id}

Headers

Content-Type      

Example: application/json

Accept      

Example: application/json

URL Parameters

datatype   string   

Example: consequatur

id   string   

The ID of the {datatype}. Example: consequatur

PUT api/{datatype}/{id}

Example request:
curl --request PUT \
    "https://www.nexasplay.com/api/consequatur/consequatur" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json"
const url = new URL(
    "https://www.nexasplay.com/api/consequatur/consequatur"
);

const headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
};

fetch(url, {
    method: "PUT",
    headers,
}).then(response => response.json());

Request      

PUT api/{datatype}/{id}

Headers

Content-Type      

Example: application/json

Accept      

Example: application/json

URL Parameters

datatype   string   

Example: consequatur

id   string   

The ID of the {datatype}. Example: consequatur

POST api/{datatype}

Example request:
curl --request POST \
    "https://www.nexasplay.com/api/consequatur" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json"
const url = new URL(
    "https://www.nexasplay.com/api/consequatur"
);

const headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
};

fetch(url, {
    method: "POST",
    headers,
}).then(response => response.json());

Request      

POST api/{datatype}

Headers

Content-Type      

Example: application/json

Accept      

Example: application/json

URL Parameters

datatype   string   

Example: consequatur

DELETE api/{datatype}/{id}

Example request:
curl --request DELETE \
    "https://www.nexasplay.com/api/consequatur/consequatur" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json"
const url = new URL(
    "https://www.nexasplay.com/api/consequatur/consequatur"
);

const headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
};

fetch(url, {
    method: "DELETE",
    headers,
}).then(response => response.json());

Request      

DELETE api/{datatype}/{id}

Headers

Content-Type      

Example: application/json

Accept      

Example: application/json

URL Parameters

datatype   string   

Example: consequatur

id   string   

The ID of the {datatype}. Example: consequatur

Eventos

Tabla de Clasificación del Evento (Leaderboard)

Devuelve la clasificación de los usuarios para un evento específico, basada en la suma de sus puntuaciones en todos los minijuegos de ese evento.

Example request:
curl --request GET \
    --get "https://www.nexasplay.com/api/events-leaderboard/1" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json"
const url = new URL(
    "https://www.nexasplay.com/api/events-leaderboard/1"
);

const headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
};

fetch(url, {
    method: "GET",
    headers,
}).then(response => response.json());

Example response (200):


{
    "data": [
        {
            "rank": 1,
            "user": {
                "id": 2,
                "username": "usertest",
                "firstName": "Usuario",
                "lastName": "Prueba",
                "avatarUrl": "users/default.png"
            },
            "totalScore": 500
        },
        {
            "rank": 2,
            "user": {
                "id": 1,
                "username": "admin",
                "firstName": "Wave",
                "lastName": "Admin",
                "avatarUrl": "users/default.png"
            },
            "totalScore": 250
        }
    ]
}
 

Request      

GET api/events-leaderboard/{event_id}

Headers

Content-Type      

Example: application/json

Accept      

Example: application/json

URL Parameters

event_id   integer   

The ID of the event. Example: 1

event   string   

El ID del evento. Example: 1

Ver Mi Clasificación en un Evento

Obtiene el puntaje total del usuario para un evento específico y su posición (rango) en la tabla de clasificación de ese evento.

Example request:
curl --request GET \
    --get "https://www.nexasplay.com/api/events-leaderboard/1/my-rank" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json"
const url = new URL(
    "https://www.nexasplay.com/api/events-leaderboard/1/my-rank"
);

const headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
};

fetch(url, {
    method: "GET",
    headers,
}).then(response => response.json());

Example response (200):


(Clasificado) {
  "data": {
    "rank": 2,
    "totalScore": 250,
    "user": {
      "id": 1,
      "username": "admin",
      "firstName": "Wave",
      "lastName": "Admin",
      "avatarUrl": "users/default.png"
    }
  }
}
 

Example response (200):


(No clasificado) {
  "data": {
     "rank": null,
     "totalScore": 0,
     "user": {
       "id": 3,
       "username": "carlos",
       "firstName": "Carlos",
       "lastName": "Solarte",
       "avatarUrl": "users/default.png"
     }
  }
}
 

Request      

GET api/events-leaderboard/{event_id}/my-rank

Headers

Content-Type      

Example: application/json

Accept      

Example: application/json

URL Parameters

event_id   integer   

The ID of the event. Example: 1

event   string   

El ID del evento. Example: 1

Filtros

Listar y Filtrar Compañías

Muestra una lista paginada de compañías. Permite múltiples filtros y opciones de ordenamiento para descubrir compañías.

Example request:
curl --request GET \
    --get "https://www.nexasplay.com/api/companies-filters?label=Restaurante&has_active_events=1&sort_by=rating" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json"
const url = new URL(
    "https://www.nexasplay.com/api/companies-filters"
);

const params = {
    "label": "Restaurante",
    "has_active_events": "1",
    "sort_by": "rating",
};
Object.keys(params)
    .forEach(key => url.searchParams.append(key, params[key]));

const headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
};

fetch(url, {
    method: "GET",
    headers,
}).then(response => response.json());

Example response (200):


{
   "data": [
     {
       "id": 1,
       "name": "Company 1",
       "logoUrl": null,
       "description": "This company.",
       "phone": "3121231230",
       "catalogUrl": null,
       "schedule": null,
       "address": null,
       "city": "Pasto",
       "location": "1.2136,-77.2793",
       "gameRoomUrl": null,
       "hasActiveEvents": true
     }
  ]
}
 

Example response (404):


{
    "message": "No query results for model [App\\Models\\Company] 99"
}
 

Request      

GET api/companies-filters

Headers

Content-Type      

Example: application/json

Accept      

Example: application/json

Query Parameters

label   string  optional  

Filtrar compañías por el nombre de una etiqueta. Example: Restaurante

has_active_events   boolean  optional  

Filtrar compañías que tengan al menos un evento activo. Example: true

sort_by   string  optional  

Ordenar los resultados. Opciones: 'rating' (mejor a peor calificada). Example: rating

Buscar compañías cercanas

Este endpoint permite buscar compañías cercanas a una ubicación geográfica utilizando latitud, longitud y un radio (en km).

Example request:
curl --request GET \
    --get "https://www.nexasplay.com/api/companies-filters/nearby?lat=-12.0464&lng=-77.0428&radius=10" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --data "{
    \"lat\": -89,
    \"lng\": -180,
    \"radius\": 16
}"
const url = new URL(
    "https://www.nexasplay.com/api/companies-filters/nearby"
);

const params = {
    "lat": "-12.0464",
    "lng": "-77.0428",
    "radius": "10",
};
Object.keys(params)
    .forEach(key => url.searchParams.append(key, params[key]));

const headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
};

let body = {
    "lat": -89,
    "lng": -180,
    "radius": 16
};

fetch(url, {
    method: "GET",
    headers,
    body: JSON.stringify(body),
}).then(response => response.json());

Example response (200):


{
"data": [
  {
    "id": 1,
    "name": "Arcade Central Pasto",
    "logoUrl": null,
    "description": "La mejor sala de juegos de Nariño.",
    "phone": null,
    "catalogUrl": null,
    "schedule": null,
    "address": null,
    "city": "Pasto",
    "location": "1.213615,-77.279343",
    "gameRoomUrl": null,
    "distance": 0.01
  },
]}
 

Request      

GET api/companies-filters/nearby

Headers

Content-Type      

Example: application/json

Accept      

Example: application/json

Query Parameters

lat   string   

float Latitud actual del usuario. Example: -12.0464

lng   string   

float Longitud actual del usuario. Example: -77.0428

radius   number  optional  

Radio de búsqueda en kilómetros (por defecto: 25 km). Mínimo: 1, máximo: 100. Example: 10

Body Parameters

lat   number   

Must be between -90 and 90. Example: -89

lng   number   

Must be between -180 and 180. Example: -180

radius   number  optional  

Must be at least 1. Must not be greater than 100. Example: 16

Obtener calificación compañia

Calcula y devuelve la calificación promedio (de 1 a 5) y el número total de reseñas para una compañía específica.

Example request:
curl --request GET \
    --get "https://www.nexasplay.com/api/companies-filters/1/average-rating" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json"
const url = new URL(
    "https://www.nexasplay.com/api/companies-filters/1/average-rating"
);

const headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
};

fetch(url, {
    method: "GET",
    headers,
}).then(response => response.json());

Example response (200):


{
    "data": {
        "company_id": 1,
        "average_rating": "4.3",
        "review_count": 15
    }
}
 

Example response (404):


{
    "message": "No query results for model [App\\Models\\Company] 99"
}
 

Request      

GET api/companies-filters/{company_id}/average-rating

Headers

Content-Type      

Example: application/json

Accept      

Example: application/json

URL Parameters

company_id   string   

El ID de la compañía. Example: 1

Listar y filtrar Eventos

Muestra una lista paginada de todos los eventos que están actualmente activos. Permite filtrar por ciudad, compañía o por los minijuegos incluidos en el evento. Los eventos se ordenan por los más recientes primero.

Example request:
curl --request GET \
    --get "https://www.nexasplay.com/api/events-filters?city=Pasto&company_id=1&minigame_id=2" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json"
const url = new URL(
    "https://www.nexasplay.com/api/events-filters"
);

const params = {
    "city": "Pasto",
    "company_id": "1",
    "minigame_id": "2",
};
Object.keys(params)
    .forEach(key => url.searchParams.append(key, params[key]));

const headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
};

fetch(url, {
    method: "GET",
    headers,
}).then(response => response.json());

Example response (200):


{
"data": [
  {
    "id": 1,
    "description": "Gran Torneo de Verano",
    "duration": "7 days",
    "isActive": true,
    "city": "Pasto",
    "company": {
      "id": 1,
      "name": "Arcade Central Pasto"
    },
  "minigames": [
      {
        "id": 1,
        "name": "Space Invaders"
      },
      {
        "id": 2,
        "name": "Tetris Challenge"
      }
    ]
  }
],
}
 

Request      

GET api/events-filters

Headers

Content-Type      

Example: application/json

Accept      

Example: application/json

Query Parameters

city   string  optional  

Filtrar eventos por ciudad (búsqueda parcial). Example: Pasto

company_id   integer  optional  

Filtrar eventos por el ID de la compañía organizadora. Example: 1

minigame_id   integer  optional  

Filtrar eventos que incluyan un minijuego específico por su ID. Example: 2

Juegos

Iniciar Partida

Valida si el usuario puede pagar el costo del minijuego (con monedas o tickets) y resta el saldo correspondiente, registrando la transacción.

Example request:
curl --request POST \
    "https://www.nexasplay.com/api/minigames/1/play" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --data "{
    \"payment_method\": \"\\\"coins\\\"\",
    \"event_id\": 1
}"
const url = new URL(
    "https://www.nexasplay.com/api/minigames/1/play"
);

const headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
};

let body = {
    "payment_method": "\"coins\"",
    "event_id": 1
};

fetch(url, {
    method: "POST",
    headers,
    body: JSON.stringify(body),
}).then(response => response.json());

Example response (200):


{
    "message": "¡Partida iniciada! Buena suerte."
}
 

Example response (402):


{
    "message": "Saldo de monedas insuficiente."
}
 

Example response (422):


{
    "message": "Este minijuego no está disponible en el evento especificado."
}
 

Request      

POST api/minigames/{minigame_id}/play

Headers

Content-Type      

Example: application/json

Accept      

Example: application/json

URL Parameters

minigame_id   integer   

The ID of the minigame. Example: 1

minigame   string   

El ID del minijuego al que se quiere jugar. Example: 1

Body Parameters

payment_method   string   

El método de pago. Opciones: 'coins', 'tickets'. Example: "coins"

event_id   integer   

El ID del evento en el que se está jugando. Example: 1

Guardar Puntuación

requires authentication

Guarda la puntuación final del usuario para un minijuego en un evento específico.

Example request:
curl --request POST \
    "https://www.nexasplay.com/api/scores" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --data "{
    \"minigame_id\": 1,
    \"event_id\": 1,
    \"score\": 15000
}"
const url = new URL(
    "https://www.nexasplay.com/api/scores"
);

const headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
};

let body = {
    "minigame_id": 1,
    "event_id": 1,
    "score": 15000
};

fetch(url, {
    method: "POST",
    headers,
    body: JSON.stringify(body),
}).then(response => response.json());

Example response (201):


{
    "message": "Puntuación guardada exitosamente"
}
 

Request      

POST api/scores

Headers

Content-Type      

Example: application/json

Accept      

Example: application/json

Body Parameters

minigame_id   integer   

El ID del minijuego. Example: 1

event_id   integer   

El ID del evento. Example: 1

score   integer   

La puntuación obtenida. Example: 15000

Reseñas (Reviews)

Listar Reseñas de una Compañía

Muestra una lista paginada de todas las reseñas para una compañía específica. Las reseñas se ordenan por las más recientes primero.

Example request:
curl --request GET \
    --get "https://www.nexasplay.com/api/companies-reviews/1/reviews" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json"
const url = new URL(
    "https://www.nexasplay.com/api/companies-reviews/1/reviews"
);

const headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
};

fetch(url, {
    method: "GET",
    headers,
}).then(response => response.json());

Example response (200):


{
  "data": [
    {
      "id": 1,
      "rating": 5,
      "comment": "¡El mejor lugar!",
      "user": {
        "id": 2,
        "name": "Carlos Solarte"
      }
    }
  ],
}
 

Request      

GET api/companies-reviews/{company_id}/reviews

Headers

Content-Type      

Example: application/json

Accept      

Example: application/json

URL Parameters

company_id   integer   

The ID of the company. Example: 1

company   string   

El ID de la compañía. Example: 1

Crear una Nueva Reseña

Permite al usuario autenticado publicar una nueva reseña para una compañía. Un usuario solo puede publicar una reseña por compañía.

Example request:
curl --request POST \
    "https://www.nexasplay.com/api/companies-reviews/1/reviews" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --data "{
    \"rating\": 5,
    \"comment\": \"\\\"Me encantó el servicio.\\\"\"
}"
const url = new URL(
    "https://www.nexasplay.com/api/companies-reviews/1/reviews"
);

const headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
};

let body = {
    "rating": 5,
    "comment": "\"Me encantó el servicio.\""
};

fetch(url, {
    method: "POST",
    headers,
    body: JSON.stringify(body),
}).then(response => response.json());

Example response (201):


{
    "data": {
        "id": 2,
        "rating": 5,
        "comment": "Me encantó el servicio.",
        "user": {
            "id": 1,
            "name": "Ana Rivera"
        }
    }
}
 

Example response (422):


{
    "message": "Ya has calificado a esta compañía.",
    "errors": {
        "company_id": [
            "Ya has calificado a esta compañía."
        ]
    }
}
 

Request      

POST api/companies-reviews/{company_id}/reviews

Headers

Content-Type      

Example: application/json

Accept      

Example: application/json

URL Parameters

company_id   integer   

The ID of the company. Example: 1

company   string   

El ID de la compañía a calificar. Example: 1

Body Parameters

rating   integer   

La calificación (de 1 a 5 estrellas). Example: 5

comment   string  optional  

El comentario (opcional). Example: "Me encantó el servicio."

Actualizar una Reseña

Permite al usuario autenticado actualizar su propia reseña para una compañía. El usuario solo puede modificar la calificación y/o el comentario.

Example request:
curl --request PUT \
    "https://www.nexasplay.com/api/companies-reviews/1/reviews" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --data "{
    \"rating\": 4,
    \"comment\": \"\\\"Lo he pensado mejor, el servicio fue bueno.\\\"\"
}"
const url = new URL(
    "https://www.nexasplay.com/api/companies-reviews/1/reviews"
);

const headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
};

let body = {
    "rating": 4,
    "comment": "\"Lo he pensado mejor, el servicio fue bueno.\""
};

fetch(url, {
    method: "PUT",
    headers,
    body: JSON.stringify(body),
}).then(response => response.json());

Example response (200):


{
    "data": {
        "id": 1,
        "rating": 4,
        "comment": "Lo he pensado mejor, el servicio fue bueno.",
        "user": {
            "id": 1,
            "name": "Ana Rivera"
        }
    }
}
 

Example response (404):


{
    "message": "No se encontró una reseña tuya para esta compañía."
}
 

Request      

PUT api/companies-reviews/{company_id}/reviews

Headers

Content-Type      

Example: application/json

Accept      

Example: application/json

URL Parameters

company_id   integer   

The ID of the company. Example: 1

company   string   

El ID de la compañía cuya reseña quieres actualizar. Example: 1

Body Parameters

rating   integer  optional  

La nueva calificación (de 1 a 5 estrellas). Example: 4

comment   string  optional  

El nuevo comentario (opcional). Example: "Lo he pensado mejor, el servicio fue bueno."

Reaccionar a una Reseña (Like/Dislike)

Permite al usuario dar "me gusta" o "no me gusta" a una reseña.

Example request:
curl --request POST \
    "https://www.nexasplay.com/api/reviews-react/1" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --data "{
    \"reaction\": \"\\\"like\\\"\"
}"
const url = new URL(
    "https://www.nexasplay.com/api/reviews-react/1"
);

const headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
};

let body = {
    "reaction": "\"like\""
};

fetch(url, {
    method: "POST",
    headers,
    body: JSON.stringify(body),
}).then(response => response.json());

Example response (200):


{
    "message": "Reacción actualizada.",
    "new_likes": 1,
    "new_dislikes": 0
}
 

Request      

POST api/reviews-react/{review_id}

Headers

Content-Type      

Example: application/json

Accept      

Example: application/json

URL Parameters

review_id   integer   

The ID of the review. Example: 1

review   string   

El ID de la reseña a la que reaccionar. Example: 1

Body Parameters

reaction   string   

El tipo de reacción. Opciones: 'like', 'dislike'. Example: "like"

Rooms

Crear una nueva sala de juego.

requires authentication

Este endpoint permite crear una sala automáticamente con un nombre único y asignar al usuario autenticado como propietario. La sala puede ser pública o privada según el parámetro enviado.

Example request:
curl --request POST \
    "https://www.nexasplay.com/api/match/create" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --data "{
    \"privacidad\": \"publica\"
}"
const url = new URL(
    "https://www.nexasplay.com/api/match/create"
);

const headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
};

let body = {
    "privacidad": "publica"
};

fetch(url, {
    method: "POST",
    headers,
    body: JSON.stringify(body),
}).then(response => response.json());

Example response (201):


{
  "status": "success",
  "data": {
    "id": 1,
    "name": "Room-ABCD12",
    "owner_id": 5,
    "status": "creada",
    "privacidad": "publica",
    "created_at": "2025-10-08T16:41:12.000000Z",
    "updated_at": "2025-10-08T16:41:12.000000Z"
  }
} "La respuesta incluye los datos completos de la sala creada, mostrando su estado inicial, privacidad y propietario."
 

Example response (401):


{
  "message": "Unauthenticated."
} "Se retorna cuando el usuario no está autenticado y no puede crear la sala."
 

Request      

POST api/match/create

Headers

Content-Type      

Example: application/json

Accept      

Example: application/json

Body Parameters

privacidad   string   

Define la privacidad de la sala. Puede ser "publica" o "privada". Example: publica

Unirse a una sala privada.

requires authentication

Example request:
curl --request POST \
    "https://www.nexasplay.com/api/match/join/Room-ABCD12" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json"
const url = new URL(
    "https://www.nexasplay.com/api/match/join/Room-ABCD12"
);

const headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
};

fetch(url, {
    method: "POST",
    headers,
}).then(response => response.json());

Example response (200):


{
    "status": "success",
    "data": {
        "room_name": "Room-ABCD12",
        "users": [
            {
                "id": 1,
                "name": "Harvey"
            },
            {
                "id": 2,
                "name": "Pablo"
            }
        ],
        "user_count": 2
    }
}
 

Example response (403):


{
    "status": "error",
    "message": "La sala ya está completa."
}
 

Example response (404):


{
    "status": "error",
    "message": "Sala no encontrada."
}
 

Example response (423):


{
    "status": "error",
    "message": "Otro usuario está uniéndose a la sala, intenta de nuevo."
}
 

Request      

POST api/match/join/{room_name}

Headers

Content-Type      

Example: application/json

Accept      

Example: application/json

URL Parameters

room_name   string   

Nombre de la sala a la que el usuario quiere unirse. Example: Room-ABCD12

Unirse a una sala pública de forma aleatoria.

requires authentication

Busca una sala pública con espacio disponible (máximo 2 jugadores). Si existe, el usuario se une a ella. Si no existe, se crea una nueva sala pública y el usuario se convierte en su propietario.

Example request:
curl --request POST \
    "https://www.nexasplay.com/api/match/joinramdon" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json"
const url = new URL(
    "https://www.nexasplay.com/api/match/joinramdon"
);

const headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
};

fetch(url, {
    method: "POST",
    headers,
}).then(response => response.json());

Example response (200):


{
    "status": "success",
    "message": "Te uniste a una sala pública existente.",
    "data": {
        "room_name": "Room-XYZ123",
        "users": [
            {
                "id": 5,
                "first_name": "Harvey"
            },
            {
                "id": 7,
                "first_name": "Carlos"
            }
        ],
        "user_count": 2
    }
}
 

Example response (201):


{
    "status": "created",
    "message": "No había sala disponible, se creó una nueva pública.",
    "data": {
        "room_name": "Room-ABCD12",
        "users": [
            {
                "id": 5,
                "first_name": "Harvey"
            }
        ],
        "user_count": 1
    }
}
 

Example response (423):


{
    "status": "error",
    "message": "Otro usuario está uniéndose a una sala, intenta de nuevo."
}
 

Request      

POST api/match/joinramdon

Headers

Content-Type      

Example: application/json

Accept      

Example: application/json

Iniciar una partida.

requires authentication

Verifica si el usuario pertenece a la sala y si hay al menos 2 jugadores para poder iniciar la partida , la idea general es que cuando se cree la sala o se una a la sala ramdon o privada lo pase al star para ver el contrincante.

Example request:
curl --request POST \
    "https://www.nexasplay.com/api/match/start/Room-ABCD12" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json"
const url = new URL(
    "https://www.nexasplay.com/api/match/start/Room-ABCD12"
);

const headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
};

fetch(url, {
    method: "POST",
    headers,
}).then(response => response.json());

Example response (200):


{
    "status": "incompleto",
    "users": [
        {
            "id": 5,
            "first_name": "Carlos"
        }
    ],
    "message": "Esperando jugadores."
}
 

Example response (200):


{
    "status": "success",
    "message": "Partida iniciada.",
    "data": {
        "room_name": "Room-ABCD12",
        "users": [
            {
                "id": 5,
                "first_name": "Carlos"
            },
            {
                "id": 6,
                "first_name": "Ana"
            }
        ]
    }
}
 

Example response (403):


{
    "status": "error",
    "message": "No tienes acceso a esta sala."
}
 

Example response (404):


{
    "status": "error",
    "message": "Sala no encontrada."
}
 

Request      

POST api/match/start/{room_name}

Headers

Content-Type      

Example: application/json

Accept      

Example: application/json

URL Parameters

room_name   string   

El nombre único de la sala. Example: Room-ABCD12

Repartir cartas a un jugador en la sala.

requires authentication

Example request:
curl --request POST \
    "https://www.nexasplay.com/api/match/deal/Room-ABCD12" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json"
const url = new URL(
    "https://www.nexasplay.com/api/match/deal/Room-ABCD12"
);

const headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
};

fetch(url, {
    method: "POST",
    headers,
}).then(response => response.json());

Example response (200):


{
    "status": "success",
    "message": "Cartas asignadas.",
    "cards": [
        {
            "id": 12,
            "name": "Fuego Básico",
            "element": "fire",
            "power": 3,
            "sprite_key": "fire_basic",
            "win_effect": "fire_blast",
            "lose_effect": "smoke"
        },
        {
            "id": 20,
            "name": "Agua Básica",
            "element": "water",
            "power": 2,
            "sprite_key": "water_basic",
            "win_effect": "water_splash",
            "lose_effect": "drowned"
        }
    ]
}
 

Example response (403):


{
    "status": "error",
    "message": "No tienes acceso a esta sala."
}
 

Example response (404):


{
    "status": "error",
    "message": "Sala no encontrada."
}
 

Request      

POST api/match/deal/{room_name}

Headers

Content-Type      

Example: application/json

Accept      

Example: application/json

URL Parameters

room_name   string   

Nombre único de la sala. Example: Room-ABCD12

Jugar una carta en la sala.

requires authentication

Permite al jugador enviar una carta durante una ronda activa. Si la carta es válida y aún no ha sido jugada, se marca como jugada y se le asigna una nueva carta al jugador. Cuando ambos jugadores han jugado, la ronda se resuelve automáticamente.

Example request:
curl --request POST \
    "https://www.nexasplay.com/api/match/playcard/Room-OD9PHT94" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --data "{
    \"card_id\": 5
}"
const url = new URL(
    "https://www.nexasplay.com/api/match/playcard/Room-OD9PHT94"
);

const headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
};

let body = {
    "card_id": 5
};

fetch(url, {
    method: "POST",
    headers,
    body: JSON.stringify(body),
}).then(response => response.json());

Example response (200):


{
    "status": "success",
    "message": "Carta enviada correctamente",
    "new_card": {
        "id": 12
    }
}
 

Example response (400):


{
    "status": "error",
    "message": "No existe esa carta en la baraja o ya fue jugada"
}
 

Example response (400):


{
    "status": "error",
    "message": "Ya jugaste tu carta en esta ronda."
}
 

Example response (400):


{
    "status": "error",
    "message": "No hay más cartas disponibles."
}
 

Example response (403):


{
    "status": "error",
    "message": "No tienes acceso a esta sala."
}
 

Example response (404):


{
    "status": "error",
    "message": "Sala no encontrada."
}
 

Request      

POST api/match/playcard/{room_name}

Headers

Content-Type      

Example: application/json

Accept      

Example: application/json

URL Parameters

room_name   string   

Nombre único de la sala. Example: Room-OD9PHT94

Body Parameters

card_id   integer   

ID de la carta que el jugador desea jugar. Example: 5