Skip to main content
Returns user accounts from the system, filtered automatically based on the requesting user’s role. Requires a valid session token — unauthenticated requests are rejected. Endpoint: USERS service — https://script.google.com/macros/s/AKfycbxAqyEcAHetH6yN4qccGILL-L3IzMSPVuVJ1kpuO86GqfDXTKP8cHrrB7UkKN1r_0g5/exec Action: getUsers
Requester roleUsers returned
DesarrolladorAll users
Gefe / JefeSupervisor and Tecnico users only
SupervisorTecnico users only
TecnicoAccess denied

Request

action
string
required
Must be "getUsers".
payload.sessionToken
string
required
The active session token of the requesting user. Used to determine their role and filter the response.

Response

status
string
required
"success" on success, "error" on failure.
users
array
Array of user objects visible to the requesting role. Note: the response key is users, not data.

Example

const USERS_ENDPOINT = 'https://script.google.com/macros/s/AKfycbxAqyEcAHetH6yN4qccGILL-L3IzMSPVuVJ1kpuO86GqfDXTKP8cHrrB7UkKN1r_0g5/exec';

const session = JSON.parse(localStorage.getItem('gpsepedia_session'));

const response = await fetch(USERS_ENDPOINT, {
  method: 'POST',
  headers: { 'Content-Type': 'text/plain' },
  body: JSON.stringify({
    action: 'getUsers',
    payload: { sessionToken: session.SessionToken }
  }),
  redirect: 'follow'
});

const result = await response.json();
if (result.status === 'success') {
  // Note: response key is `users`, not `data`
  const users = result.users;
  const technicians = users.filter(u => u.Privilegios === 'Tecnico');
  console.log('Technicians:', technicians.map(u => u.Nombre_Completo));
}

Build docs developers (and LLMs) love