Estado de sesión
curl --request GET \
--url https://api.dev.impactu.colav.co/meimport requests
url = "https://api.dev.impactu.colav.co/me"
response = requests.get(url)
print(response.text)const options = {method: 'GET'};
fetch('https://api.dev.impactu.colav.co/me', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.dev.impactu.colav.co/me",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api.dev.impactu.colav.co/me"
req, _ := http.NewRequest("GET", url, nil)
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://api.dev.impactu.colav.co/me")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.dev.impactu.colav.co/me")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
response = http.request(request)
puts response.read_body{
"status": "sesion_activa",
"msg": "Sesión activa",
"user": {
"_id": "example-institution-id",
"email": "usuario@example.com",
"institution": "Universidad Ejemplo",
"role": "staff"
}
}
{"msg": "Sesión no iniciada", "status": "sesion_no_iniciada"}
{ "status": "token_expirado", "msg": "Token expirado o inválido" }
Autenticación
Estado de sesión
Verifica si la sesión está activa leyendo el JWT desde la cookie HttpOnly.
GET
/
me
Estado de sesión
curl --request GET \
--url https://api.dev.impactu.colav.co/meimport requests
url = "https://api.dev.impactu.colav.co/me"
response = requests.get(url)
print(response.text)const options = {method: 'GET'};
fetch('https://api.dev.impactu.colav.co/me', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.dev.impactu.colav.co/me",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api.dev.impactu.colav.co/me"
req, _ := http.NewRequest("GET", url, nil)
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://api.dev.impactu.colav.co/me")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.dev.impactu.colav.co/me")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
response = http.request(request)
puts response.read_body{
"status": "sesion_activa",
"msg": "Sesión activa",
"user": {
"_id": "example-institution-id",
"email": "usuario@example.com",
"institution": "Universidad Ejemplo",
"role": "staff"
}
}
{"msg": "Sesión no iniciada", "status": "sesion_no_iniciada"}
{ "status": "token_expirado", "msg": "Token expirado o inválido" }
No requiere parámetros. El servidor lee la cookie
access_token_cookie
automáticamente. Devuelve 401 si no hay sesión activa o si el token expiró.Respuesta
string
Estado de la sesión:
sesion_activa, sesion_no_iniciada o token_expirado.string
Mensaje descriptivo del estado.
object
{
"status": "sesion_activa",
"msg": "Sesión activa",
"user": {
"_id": "example-institution-id",
"email": "usuario@example.com",
"institution": "Universidad Ejemplo",
"role": "staff"
}
}
{"msg": "Sesión no iniciada", "status": "sesion_no_iniciada"}
{ "status": "token_expirado", "msg": "Token expirado o inválido" }