Quick Start
As a quick start, let's get you your registration file. U just need two steps:
Send a login request
Send a registration file request
1. Send a login request
The easiest way to log in is by sending a POST request to the /login end-point, this end-point requires a body with just two pieces of information:
With your CPF and password ready, u can prepare and send the login request like so:
curl --request POST \
--url https://mysiga.laravieira.me/login \
--header 'Content-Type: multipart/form-data' \
--form cpf=12345678901 \
--form password=mysiga123$cpf = '12345678901';
$password = 'mysiga123';
$headers = array("Content-Type: application/x-www-form-urlencoded");
$data = "cpf=$cpf&password=$password";
$curl = curl_init("https://mysiga.laravieira.me/login");
curl_setopt($curl, CURLOPT_POST, true);
curl_setopt($curl, CURLOPT_RETURNTRANSFER, true);
curl_setopt($curl, CURLOPT_HTTPHEADER, $headers);
curl_setopt($curl, CURLOPT_POSTFIELDS, $data);
$response = curl_exec($curl);
curl_close($curl);import requests
from requests.structures import CaseInsensitiveDict
url = "https://mysiga.laravieira.me/login"
headers = CaseInsensitiveDict()
headers["Content-Type"] = "application/x-www-form-urlencoded"
data = "cpf=12345678901&password=mysiga123"
response = requests.post(url, headers=headers, data=data)If everything worked, you should get a JSON response like this:
{
"server": "https:\/\/sigam1.ufjf.br\/index.php",
"siga": "cltrava6630eo6fln4ao621vn2",
"client": "1e1a3a2698a6ac2fb0bbe8867f713e09",
"logged": true
}2. Send a registration file request
Now you're logged, so let's do a GET request to /academic/registration/browser end-point, this only requires the PHPSESSID cookie to be sent so it knows who u are, the PHPSESSID value is the same as the "client" field on the login response.
curl --request GET \
--url https://mysiga.laravieira.me/academic/registration/browser \
--cookie 'PHPSESSID=1e1a3a2698a6ac2fb0bbe8867f713e09'$headers = array(
'Cookie: PHPSESSID=1e1a3a2698a6ac2fb0bbe8867f713e09'
);
$curl= curl_init('https://mysiga.laravieira.me/academic/registration/browser');
curl_setopt($curl, CURLOPT_HTTPHEADER, $headers);
curl_setopt($curl, CURLOPT_RETURNTRANSFER, true);
curl_setopt($curl, CURLOPT_FOLLOWLOCATION, true);
curl_exec($curl);
curl_close($curl);import requests
from requests.structures import CaseInsensitiveDict
headers = CaseInsensitiveDict()
headers["Cookie"] = "PHPSESSID=1e1a3a2698a6ac2fb0bbe8867f713e09"
requests.get("https://mysiga.laravieira.me/academic/registration/browser", headers=headers)If you are using the browser or an API tester, the registration pdf will show up.
Extra step
If you are a person who loves to click on the logout button, u can also send a GET request to /login/logout destroy your session on the MySiga and on Siga 3. This also requires u to send the PHPSESSID, so MySiga knows which session to destroy. Do it like this:
curl --request GET \
--url https://mysiga.laravieira.me/login/logout \
--cookie 'PHPSESSID=1e1a3a2698a6ac2fb0bbe8867f713e09'$headers = array(
'Cookie: PHPSESSID=1e1a3a2698a6ac2fb0bbe8867f713e09'
);
$curl= curl_init('https://mysiga.laravieira.me/login/logout');
curl_setopt($curl, CURLOPT_HTTPHEADER, $headers);
curl_setopt($curl, CURLOPT_RETURNTRANSFER, true);
curl_setopt($curl, CURLOPT_FOLLOWLOCATION, true);
curl_exec($curl);
curl_close($curl);import requests
from requests.structures import CaseInsensitiveDict
headers = CaseInsensitiveDict()
headers["Cookie"] = "PHPSESSID=1e1a3a2698a6ac2fb0bbe8867f713e09"
requests.get("https://mysiga.laravieira.me/login/logout", headers=headers)The logout will give u a JSON response like that:
{
"server": "https:\/\/sigam1.ufjf.br\/index.php",
"siga": "cltrava6630eo6fln4ao621vn2",
"client": null,
"logged": false
}Next steps
Now that u had accomplished the Quick Start tutorial, feel free to check out the reference and discover more about MySiga API.
Last updated