Commit inicial

This commit is contained in:
2024-08-02 12:00:57 -06:00
commit 4489b65e04
246 changed files with 83097 additions and 0 deletions

35
rest/token.php Normal file
View File

@@ -0,0 +1,35 @@
<?php
/*
idPeriodo: identificador del periodo a consultar (obligatorio, número entero)
*/
$ruta = "https://portal.ulsa.edu.mx/servicios/AuditoriaAsistencialRest/AuditoriaAsistencialService.svc/auditoriaAsistencial/inicioSesion/seleccionar";
$required_params = [
"username"=>"SGU_APSA_AUD_ASIST",
"password"=>"B4qa594JFPr2ufHrZdHS8A=="
];
try{
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => $ruta,
CURLOPT_RETURNTRANSFER => true,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode($required_params),
CURLOPT_HTTPHEADER => array('Content-Type:application/json'),
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err)
die("cURL Error #:$err");
$token = json_decode($response, true);
//echo "token $token";
}catch(Exception $e){
echo $e->getMessage();
exit();
}
?>