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 role Users returned DesarrolladorAll users Gefe / JefeSupervisor and Tecnico users onlySupervisorTecnico users onlyTecnicoAccess denied
Request
The active session token of the requesting user. Used to determine their role and filter the response.
Response
"success" on success, "error" on failure.
Array of user objects visible to the requesting role. Note: the response key is users, not data. Show user object properties
Unique identifier for the user.
The user’s login username (permanent, cannot be changed).
The user’s full display name.
The user’s role. One of "Tecnico", "Supervisor", "Jefe", "Gefe", or "Desarrollador".
Phone number (may be empty).
Email address (may be empty).
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 ));
}