Initial Commit

This commit is contained in:
Cloud User
2024-03-06 17:45:49 -06:00
commit 8986493161
250 changed files with 43078 additions and 0 deletions

41
rest/token.php.save Normal file
View File

@@ -0,0 +1,41 @@
<?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_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 0,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode($required_params),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
print_r($response);
$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();
}
?>