MENU navbar-image

Introduction

API para la gestión de mascotas con sus dueños(En este caso Gatos). Esta es una API RESTful robusta, desarrollada conLaravel 8.x+ y PHP, cuyo objetivo es gestionar personas y sus mascotas. La API utiliza JWT (JSON Web Tokens) para la autenticación de usuarios, garantizando la seguridad de las rutas privadas. El proyecto sigue una arquitectura sugerida que incluye el uso de controladores, servicios, repositorios, recursos y validadores (Form Requests) para mantener una estructura de código limpia y escalable.

Esta api esta realizada para gestionar los procesos CRUD de las mascotas y sus dueños (personas)

Authenticating requests

To authenticate requests, include an Authorization header with the value "Bearer {YOUR_AUTH_KEY}".

All authenticated endpoints are marked with a requires authentication badge in the documentation below.

You can retrieve your token by visiting your dashboard and clicking Generate API token.

Auth

Autenticación de un usuario en el API

Get a JWT via given credentials.

Example request:
curl --request POST \
    "https://pet-management-api.lorenzorojo.com/api/v1/auth/login" \
    --header "Accept: application/json" \
    --header "Content-Type: application/json" \
    --data "{
    \"email\": \"qkunze@example.com\",
    \"password\": \"Z5ij-e\\/dl4m{o,\"
}"
const url = new URL(
    "https://pet-management-api.lorenzorojo.com/api/v1/auth/login"
);

const headers = {
    "Accept": "application/json",
    "Content-Type": "application/json",
};

let body = {
    "email": "qkunze@example.com",
    "password": "Z5ij-e\/dl4m{o,"
};

fetch(url, {
    method: "POST",
    headers,
    body: JSON.stringify(body),
}).then(response => response.json());
$client = new \GuzzleHttp\Client();
$url = 'https://pet-management-api.lorenzorojo.com/api/v1/auth/login';
$response = $client->post(
    $url,
    [
        'headers' => [
            'Accept' => 'application/json',
            'Content-Type' => 'application/json',
        ],
        'json' => [
            'email' => 'qkunze@example.com',
            'password' => 'Z5ij-e/dl4m{o,',
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));

Request      

POST api/v1/auth/login

Headers

Accept      

Example: application/json

Content-Type      

Example: application/json

Body Parameters

email   string   

Must be a valid email address. Must not be greater than 255 characters. Example: qkunze@example.com

password   string   

Must be at least 6 characters. Example: Z5ij-e/dl4m{o,

Log the user out (Invalidate the token).

requires authentication

Example request:
curl --request POST \
    "https://pet-management-api.lorenzorojo.com/api/v1/auth/logout" \
    --header "Authorization: Bearer {YOUR_AUTH_KEY}" \
    --header "Accept: application/json" \
    --header "Content-Type: application/json"
const url = new URL(
    "https://pet-management-api.lorenzorojo.com/api/v1/auth/logout"
);

const headers = {
    "Authorization": "Bearer {YOUR_AUTH_KEY}",
    "Accept": "application/json",
    "Content-Type": "application/json",
};

fetch(url, {
    method: "POST",
    headers,
}).then(response => response.json());
$client = new \GuzzleHttp\Client();
$url = 'https://pet-management-api.lorenzorojo.com/api/v1/auth/logout';
$response = $client->post(
    $url,
    [
        'headers' => [
            'Authorization' => 'Bearer {YOUR_AUTH_KEY}',
            'Accept' => 'application/json',
            'Content-Type' => 'application/json',
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));

Request      

POST api/v1/auth/logout

Headers

Authorization      

Example: Bearer {YOUR_AUTH_KEY}

Accept      

Example: application/json

Content-Type      

Example: application/json

Get the authenticated User.

requires authentication

Example request:
curl --request GET \
    --get "https://pet-management-api.lorenzorojo.com/api/v1/auth/me" \
    --header "Authorization: Bearer {YOUR_AUTH_KEY}" \
    --header "Accept: application/json" \
    --header "Content-Type: application/json"
const url = new URL(
    "https://pet-management-api.lorenzorojo.com/api/v1/auth/me"
);

const headers = {
    "Authorization": "Bearer {YOUR_AUTH_KEY}",
    "Accept": "application/json",
    "Content-Type": "application/json",
};

fetch(url, {
    method: "GET",
    headers,
}).then(response => response.json());
$client = new \GuzzleHttp\Client();
$url = 'https://pet-management-api.lorenzorojo.com/api/v1/auth/me';
$response = $client->get(
    $url,
    [
        'headers' => [
            'Authorization' => 'Bearer {YOUR_AUTH_KEY}',
            'Accept' => 'application/json',
            'Content-Type' => 'application/json',
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));

Example response (401):

Show headers
cache-control: no-cache, private
content-type: application/json
access-control-allow-origin: *
 

{
    "error": "Invalid tokenWrong number of segments"
}
 

Request      

GET api/v1/auth/me

Headers

Authorization      

Example: Bearer {YOUR_AUTH_KEY}

Accept      

Example: application/json

Content-Type      

Example: application/json

Refresh a token.

requires authentication

Example request:
curl --request POST \
    "https://pet-management-api.lorenzorojo.com/api/v1/auth/refresh" \
    --header "Authorization: Bearer {YOUR_AUTH_KEY}" \
    --header "Accept: application/json" \
    --header "Content-Type: application/json"
const url = new URL(
    "https://pet-management-api.lorenzorojo.com/api/v1/auth/refresh"
);

const headers = {
    "Authorization": "Bearer {YOUR_AUTH_KEY}",
    "Accept": "application/json",
    "Content-Type": "application/json",
};

fetch(url, {
    method: "POST",
    headers,
}).then(response => response.json());
$client = new \GuzzleHttp\Client();
$url = 'https://pet-management-api.lorenzorojo.com/api/v1/auth/refresh';
$response = $client->post(
    $url,
    [
        'headers' => [
            'Authorization' => 'Bearer {YOUR_AUTH_KEY}',
            'Accept' => 'application/json',
            'Content-Type' => 'application/json',
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));

Request      

POST api/v1/auth/refresh

Headers

Authorization      

Example: Bearer {YOUR_AUTH_KEY}

Accept      

Example: application/json

Content-Type      

Example: application/json

Store new User

Example request:
curl --request POST \
    "https://pet-management-api.lorenzorojo.com/api/v1/auth/register" \
    --header "Accept: application/json" \
    --header "Content-Type: application/json" \
    --data "{
    \"name\": \"vmqeopfuudtdsufvyvddq\",
    \"email\": \"kunde.eloisa@example.com\",
    \"password\": \"4[*UyPJ\\\"}6\"
}"
const url = new URL(
    "https://pet-management-api.lorenzorojo.com/api/v1/auth/register"
);

const headers = {
    "Accept": "application/json",
    "Content-Type": "application/json",
};

let body = {
    "name": "vmqeopfuudtdsufvyvddq",
    "email": "kunde.eloisa@example.com",
    "password": "4[*UyPJ\"}6"
};

fetch(url, {
    method: "POST",
    headers,
    body: JSON.stringify(body),
}).then(response => response.json());
$client = new \GuzzleHttp\Client();
$url = 'https://pet-management-api.lorenzorojo.com/api/v1/auth/register';
$response = $client->post(
    $url,
    [
        'headers' => [
            'Accept' => 'application/json',
            'Content-Type' => 'application/json',
        ],
        'json' => [
            'name' => 'vmqeopfuudtdsufvyvddq',
            'email' => 'kunde.eloisa@example.com',
            'password' => '4[*UyPJ"}6',
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));

Request      

POST api/v1/auth/register

Headers

Accept      

Example: application/json

Content-Type      

Example: application/json

Body Parameters

name   string   

Must not be greater than 255 characters. Example: vmqeopfuudtdsufvyvddq

email   string   

Must be a valid email address. Must not be greater than 255 characters. Example: kunde.eloisa@example.com

password   string   

Must be at least 6 characters. Example: 4[*UyPJ"}6

Person

Person owner pets management

Display a listing of the resource.

requires authentication

Example request:
curl --request GET \
    --get "https://pet-management-api.lorenzorojo.com/api/v1/person?page=73&perPage=13" \
    --header "Authorization: Bearer {YOUR_AUTH_KEY}" \
    --header "Accept: application/json" \
    --header "Content-Type: application/json"
const url = new URL(
    "https://pet-management-api.lorenzorojo.com/api/v1/person"
);

const params = {
    "page": "73",
    "perPage": "13",
};
Object.keys(params)
    .forEach(key => url.searchParams.append(key, params[key]));

const headers = {
    "Authorization": "Bearer {YOUR_AUTH_KEY}",
    "Accept": "application/json",
    "Content-Type": "application/json",
};

fetch(url, {
    method: "GET",
    headers,
}).then(response => response.json());
$client = new \GuzzleHttp\Client();
$url = 'https://pet-management-api.lorenzorojo.com/api/v1/person';
$response = $client->get(
    $url,
    [
        'headers' => [
            'Authorization' => 'Bearer {YOUR_AUTH_KEY}',
            'Accept' => 'application/json',
            'Content-Type' => 'application/json',
        ],
        'query' => [
            'page' => '73',
            'perPage' => '13',
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));

Example response (401):

Show headers
cache-control: no-cache, private
content-type: application/json
access-control-allow-origin: *
 

{
    "error": "Invalid tokenWrong number of segments"
}
 

Request      

GET api/v1/person

Headers

Authorization      

Example: Bearer {YOUR_AUTH_KEY}

Accept      

Example: application/json

Content-Type      

Example: application/json

Query Parameters

page   integer   

Must be at least 1. Example: 73

perPage   integer   

Must be at least 1. Must not be greater than 100. Example: 13

Store a newly created resource in storage.

requires authentication

Example request:
curl --request POST \
    "https://pet-management-api.lorenzorojo.com/api/v1/person" \
    --header "Authorization: Bearer {YOUR_AUTH_KEY}" \
    --header "Accept: application/json" \
    --header "Content-Type: application/json" \
    --data "{
    \"name\": \"vmqeopfuudtdsufvyvddq\",
    \"email\": \"kunde.eloisa@example.com\",
    \"birthdate\": \"2025-08-19\"
}"
const url = new URL(
    "https://pet-management-api.lorenzorojo.com/api/v1/person"
);

const headers = {
    "Authorization": "Bearer {YOUR_AUTH_KEY}",
    "Accept": "application/json",
    "Content-Type": "application/json",
};

let body = {
    "name": "vmqeopfuudtdsufvyvddq",
    "email": "kunde.eloisa@example.com",
    "birthdate": "2025-08-19"
};

fetch(url, {
    method: "POST",
    headers,
    body: JSON.stringify(body),
}).then(response => response.json());
$client = new \GuzzleHttp\Client();
$url = 'https://pet-management-api.lorenzorojo.com/api/v1/person';
$response = $client->post(
    $url,
    [
        'headers' => [
            'Authorization' => 'Bearer {YOUR_AUTH_KEY}',
            'Accept' => 'application/json',
            'Content-Type' => 'application/json',
        ],
        'json' => [
            'name' => 'vmqeopfuudtdsufvyvddq',
            'email' => 'kunde.eloisa@example.com',
            'birthdate' => '2025-08-19',
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));

Request      

POST api/v1/person

Headers

Authorization      

Example: Bearer {YOUR_AUTH_KEY}

Accept      

Example: application/json

Content-Type      

Example: application/json

Body Parameters

name   string   

Must not be greater than 255 characters. Example: vmqeopfuudtdsufvyvddq

email   string   

Must be a valid email address. Must not be greater than 255 characters. Example: kunde.eloisa@example.com

birthdate   string   

Must be a valid date in the format Y-m-d. Example: 2025-08-19

Display the specified resource.

requires authentication

Example request:
curl --request GET \
    --get "https://pet-management-api.lorenzorojo.com/api/v1/person/1" \
    --header "Authorization: Bearer {YOUR_AUTH_KEY}" \
    --header "Accept: application/json" \
    --header "Content-Type: application/json"
const url = new URL(
    "https://pet-management-api.lorenzorojo.com/api/v1/person/1"
);

const headers = {
    "Authorization": "Bearer {YOUR_AUTH_KEY}",
    "Accept": "application/json",
    "Content-Type": "application/json",
};

fetch(url, {
    method: "GET",
    headers,
}).then(response => response.json());
$client = new \GuzzleHttp\Client();
$url = 'https://pet-management-api.lorenzorojo.com/api/v1/person/1';
$response = $client->get(
    $url,
    [
        'headers' => [
            'Authorization' => 'Bearer {YOUR_AUTH_KEY}',
            'Accept' => 'application/json',
            'Content-Type' => 'application/json',
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));

Example response (401):

Show headers
cache-control: no-cache, private
content-type: application/json
access-control-allow-origin: *
 

{
    "error": "Invalid tokenWrong number of segments"
}
 

Request      

GET api/v1/person/{id}

Headers

Authorization      

Example: Bearer {YOUR_AUTH_KEY}

Accept      

Example: application/json

Content-Type      

Example: application/json

URL Parameters

id   integer   

The ID of the person. Example: 1

Update the specified resource in storage.

requires authentication

Example request:
curl --request PUT \
    "https://pet-management-api.lorenzorojo.com/api/v1/person/1" \
    --header "Authorization: Bearer {YOUR_AUTH_KEY}" \
    --header "Accept: application/json" \
    --header "Content-Type: application/json" \
    --data "{
    \"name\": \"vmqeopfuudtdsufvyvddq\",
    \"email\": \"kunde.eloisa@example.com\",
    \"birthdate\": \"2025-08-19\"
}"
const url = new URL(
    "https://pet-management-api.lorenzorojo.com/api/v1/person/1"
);

const headers = {
    "Authorization": "Bearer {YOUR_AUTH_KEY}",
    "Accept": "application/json",
    "Content-Type": "application/json",
};

let body = {
    "name": "vmqeopfuudtdsufvyvddq",
    "email": "kunde.eloisa@example.com",
    "birthdate": "2025-08-19"
};

fetch(url, {
    method: "PUT",
    headers,
    body: JSON.stringify(body),
}).then(response => response.json());
$client = new \GuzzleHttp\Client();
$url = 'https://pet-management-api.lorenzorojo.com/api/v1/person/1';
$response = $client->put(
    $url,
    [
        'headers' => [
            'Authorization' => 'Bearer {YOUR_AUTH_KEY}',
            'Accept' => 'application/json',
            'Content-Type' => 'application/json',
        ],
        'json' => [
            'name' => 'vmqeopfuudtdsufvyvddq',
            'email' => 'kunde.eloisa@example.com',
            'birthdate' => '2025-08-19',
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));

Request      

PUT api/v1/person/{id}

PATCH api/v1/person/{id}

Headers

Authorization      

Example: Bearer {YOUR_AUTH_KEY}

Accept      

Example: application/json

Content-Type      

Example: application/json

URL Parameters

id   integer   

The ID of the person. Example: 1

Body Parameters

name   string  optional  

Must not be greater than 255 characters. Example: vmqeopfuudtdsufvyvddq

email   string  optional  

Must be a valid email address. Must not be greater than 255 characters. Example: kunde.eloisa@example.com

birthdate   string  optional  

Must be a valid date in the format Y-m-d. Example: 2025-08-19

Remove the specified resource from storage.

requires authentication

Example request:
curl --request DELETE \
    "https://pet-management-api.lorenzorojo.com/api/v1/person/1" \
    --header "Authorization: Bearer {YOUR_AUTH_KEY}" \
    --header "Accept: application/json" \
    --header "Content-Type: application/json"
const url = new URL(
    "https://pet-management-api.lorenzorojo.com/api/v1/person/1"
);

const headers = {
    "Authorization": "Bearer {YOUR_AUTH_KEY}",
    "Accept": "application/json",
    "Content-Type": "application/json",
};

fetch(url, {
    method: "DELETE",
    headers,
}).then(response => response.json());
$client = new \GuzzleHttp\Client();
$url = 'https://pet-management-api.lorenzorojo.com/api/v1/person/1';
$response = $client->delete(
    $url,
    [
        'headers' => [
            'Authorization' => 'Bearer {YOUR_AUTH_KEY}',
            'Accept' => 'application/json',
            'Content-Type' => 'application/json',
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));

Request      

DELETE api/v1/person/{id}

Headers

Authorization      

Example: Bearer {YOUR_AUTH_KEY}

Accept      

Example: application/json

Content-Type      

Example: application/json

URL Parameters

id   integer   

The ID of the person. Example: 1

Pet

Pet Management

Display a listing of the resource.

requires authentication

Example request:
curl --request GET \
    --get "https://pet-management-api.lorenzorojo.com/api/v1/pet?page=73&perPage=13" \
    --header "Authorization: Bearer {YOUR_AUTH_KEY}" \
    --header "Accept: application/json" \
    --header "Content-Type: application/json"
const url = new URL(
    "https://pet-management-api.lorenzorojo.com/api/v1/pet"
);

const params = {
    "page": "73",
    "perPage": "13",
};
Object.keys(params)
    .forEach(key => url.searchParams.append(key, params[key]));

const headers = {
    "Authorization": "Bearer {YOUR_AUTH_KEY}",
    "Accept": "application/json",
    "Content-Type": "application/json",
};

fetch(url, {
    method: "GET",
    headers,
}).then(response => response.json());
$client = new \GuzzleHttp\Client();
$url = 'https://pet-management-api.lorenzorojo.com/api/v1/pet';
$response = $client->get(
    $url,
    [
        'headers' => [
            'Authorization' => 'Bearer {YOUR_AUTH_KEY}',
            'Accept' => 'application/json',
            'Content-Type' => 'application/json',
        ],
        'query' => [
            'page' => '73',
            'perPage' => '13',
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));

Example response (401):

Show headers
cache-control: no-cache, private
content-type: application/json
access-control-allow-origin: *
 

{
    "error": "Invalid tokenWrong number of segments"
}
 

Request      

GET api/v1/pet

Headers

Authorization      

Example: Bearer {YOUR_AUTH_KEY}

Accept      

Example: application/json

Content-Type      

Example: application/json

Query Parameters

page   integer   

Must be at least 1. Example: 73

perPage   integer   

Must be at least 1. Must not be greater than 100. Example: 13

Store a newly created resource in storage.

requires authentication

Example request:
curl --request POST \
    "https://pet-management-api.lorenzorojo.com/api/v1/pet" \
    --header "Authorization: Bearer {YOUR_AUTH_KEY}" \
    --header "Accept: application/json" \
    --header "Content-Type: application/json" \
    --data "{
    \"name\": \"vmqeopfuudtdsufvyvddq\",
    \"species\": \"amniihfqcoynlazghdtqt\",
    \"breed\": \"qxbajwbpilpmufinllwlo\",
    \"age\": 17,
    \"person_id\": 17
}"
const url = new URL(
    "https://pet-management-api.lorenzorojo.com/api/v1/pet"
);

const headers = {
    "Authorization": "Bearer {YOUR_AUTH_KEY}",
    "Accept": "application/json",
    "Content-Type": "application/json",
};

let body = {
    "name": "vmqeopfuudtdsufvyvddq",
    "species": "amniihfqcoynlazghdtqt",
    "breed": "qxbajwbpilpmufinllwlo",
    "age": 17,
    "person_id": 17
};

fetch(url, {
    method: "POST",
    headers,
    body: JSON.stringify(body),
}).then(response => response.json());
$client = new \GuzzleHttp\Client();
$url = 'https://pet-management-api.lorenzorojo.com/api/v1/pet';
$response = $client->post(
    $url,
    [
        'headers' => [
            'Authorization' => 'Bearer {YOUR_AUTH_KEY}',
            'Accept' => 'application/json',
            'Content-Type' => 'application/json',
        ],
        'json' => [
            'name' => 'vmqeopfuudtdsufvyvddq',
            'species' => 'amniihfqcoynlazghdtqt',
            'breed' => 'qxbajwbpilpmufinllwlo',
            'age' => 17,
            'person_id' => 17,
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));

Request      

POST api/v1/pet

Headers

Authorization      

Example: Bearer {YOUR_AUTH_KEY}

Accept      

Example: application/json

Content-Type      

Example: application/json

Body Parameters

name   string   

Must not be greater than 60 characters. Example: vmqeopfuudtdsufvyvddq

species   string   

Must not be greater than 60 characters. Example: amniihfqcoynlazghdtqt

breed   string   

Must not be greater than 60 characters. Example: qxbajwbpilpmufinllwlo

age   integer   

Example: 17

person_id   integer   

The id of an existing record in the people table. Example: 17

Display the specified resource.

requires authentication

Example request:
curl --request GET \
    --get "https://pet-management-api.lorenzorojo.com/api/v1/pet/1" \
    --header "Authorization: Bearer {YOUR_AUTH_KEY}" \
    --header "Accept: application/json" \
    --header "Content-Type: application/json"
const url = new URL(
    "https://pet-management-api.lorenzorojo.com/api/v1/pet/1"
);

const headers = {
    "Authorization": "Bearer {YOUR_AUTH_KEY}",
    "Accept": "application/json",
    "Content-Type": "application/json",
};

fetch(url, {
    method: "GET",
    headers,
}).then(response => response.json());
$client = new \GuzzleHttp\Client();
$url = 'https://pet-management-api.lorenzorojo.com/api/v1/pet/1';
$response = $client->get(
    $url,
    [
        'headers' => [
            'Authorization' => 'Bearer {YOUR_AUTH_KEY}',
            'Accept' => 'application/json',
            'Content-Type' => 'application/json',
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));

Example response (401):

Show headers
cache-control: no-cache, private
content-type: application/json
access-control-allow-origin: *
 

{
    "error": "Invalid tokenWrong number of segments"
}
 

Request      

GET api/v1/pet/{id}

Headers

Authorization      

Example: Bearer {YOUR_AUTH_KEY}

Accept      

Example: application/json

Content-Type      

Example: application/json

URL Parameters

id   integer   

The ID of the pet. Example: 1

Update the specified resource in storage.

requires authentication

Example request:
curl --request PUT \
    "https://pet-management-api.lorenzorojo.com/api/v1/pet/1" \
    --header "Authorization: Bearer {YOUR_AUTH_KEY}" \
    --header "Accept: application/json" \
    --header "Content-Type: application/json" \
    --data "{
    \"name\": \"vmqeopfuudtdsufvyvddq\",
    \"species\": \"amniihfqcoynlazghdtqt\",
    \"breed\": \"qxbajwbpilpmufinllwlo\",
    \"age\": 17,
    \"person_id\": 17
}"
const url = new URL(
    "https://pet-management-api.lorenzorojo.com/api/v1/pet/1"
);

const headers = {
    "Authorization": "Bearer {YOUR_AUTH_KEY}",
    "Accept": "application/json",
    "Content-Type": "application/json",
};

let body = {
    "name": "vmqeopfuudtdsufvyvddq",
    "species": "amniihfqcoynlazghdtqt",
    "breed": "qxbajwbpilpmufinllwlo",
    "age": 17,
    "person_id": 17
};

fetch(url, {
    method: "PUT",
    headers,
    body: JSON.stringify(body),
}).then(response => response.json());
$client = new \GuzzleHttp\Client();
$url = 'https://pet-management-api.lorenzorojo.com/api/v1/pet/1';
$response = $client->put(
    $url,
    [
        'headers' => [
            'Authorization' => 'Bearer {YOUR_AUTH_KEY}',
            'Accept' => 'application/json',
            'Content-Type' => 'application/json',
        ],
        'json' => [
            'name' => 'vmqeopfuudtdsufvyvddq',
            'species' => 'amniihfqcoynlazghdtqt',
            'breed' => 'qxbajwbpilpmufinllwlo',
            'age' => 17,
            'person_id' => 17,
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));

Request      

PUT api/v1/pet/{id}

PATCH api/v1/pet/{id}

Headers

Authorization      

Example: Bearer {YOUR_AUTH_KEY}

Accept      

Example: application/json

Content-Type      

Example: application/json

URL Parameters

id   integer   

The ID of the pet. Example: 1

Body Parameters

name   string   

Must not be greater than 60 characters. Example: vmqeopfuudtdsufvyvddq

species   string   

Must not be greater than 60 characters. Example: amniihfqcoynlazghdtqt

breed   string   

Must not be greater than 60 characters. Example: qxbajwbpilpmufinllwlo

age   integer   

Example: 17

person_id   integer   

The id of an existing record in the people table. Example: 17

Remove the specified resource from storage.

requires authentication

Example request:
curl --request DELETE \
    "https://pet-management-api.lorenzorojo.com/api/v1/pet/1" \
    --header "Authorization: Bearer {YOUR_AUTH_KEY}" \
    --header "Accept: application/json" \
    --header "Content-Type: application/json"
const url = new URL(
    "https://pet-management-api.lorenzorojo.com/api/v1/pet/1"
);

const headers = {
    "Authorization": "Bearer {YOUR_AUTH_KEY}",
    "Accept": "application/json",
    "Content-Type": "application/json",
};

fetch(url, {
    method: "DELETE",
    headers,
}).then(response => response.json());
$client = new \GuzzleHttp\Client();
$url = 'https://pet-management-api.lorenzorojo.com/api/v1/pet/1';
$response = $client->delete(
    $url,
    [
        'headers' => [
            'Authorization' => 'Bearer {YOUR_AUTH_KEY}',
            'Accept' => 'application/json',
            'Content-Type' => 'application/json',
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));

Request      

DELETE api/v1/pet/{id}

Headers

Authorization      

Example: Bearer {YOUR_AUTH_KEY}

Accept      

Example: application/json

Content-Type      

Example: application/json

URL Parameters

id   integer   

The ID of the pet. Example: 1

Get available breeds 'The CAT API'

requires authentication

Example request:
curl --request GET \
    --get "https://pet-management-api.lorenzorojo.com/api/v1/pet/cat/breeds?page=0&perPage=10" \
    --header "Authorization: Bearer {YOUR_AUTH_KEY}" \
    --header "Accept: application/json" \
    --header "Content-Type: application/json"
const url = new URL(
    "https://pet-management-api.lorenzorojo.com/api/v1/pet/cat/breeds"
);

const params = {
    "page": "0",
    "perPage": "10",
};
Object.keys(params)
    .forEach(key => url.searchParams.append(key, params[key]));

const headers = {
    "Authorization": "Bearer {YOUR_AUTH_KEY}",
    "Accept": "application/json",
    "Content-Type": "application/json",
};

fetch(url, {
    method: "GET",
    headers,
}).then(response => response.json());
$client = new \GuzzleHttp\Client();
$url = 'https://pet-management-api.lorenzorojo.com/api/v1/pet/cat/breeds';
$response = $client->get(
    $url,
    [
        'headers' => [
            'Authorization' => 'Bearer {YOUR_AUTH_KEY}',
            'Accept' => 'application/json',
            'Content-Type' => 'application/json',
        ],
        'query' => [
            'page' => '0',
            'perPage' => '10',
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));

Example response (401):

Show headers
cache-control: no-cache, private
content-type: application/json
access-control-allow-origin: *
 

{
    "error": "Invalid tokenWrong number of segments"
}
 

Request      

GET api/v1/pet/cat/breeds

Headers

Authorization      

Example: Bearer {YOUR_AUTH_KEY}

Accept      

Example: application/json

Content-Type      

Example: application/json

Query Parameters

page   integer   

Current page number. Example: 0

perPage   integer   

Registers by page. Example: 10

Reports

API Reports

Devuelve una persona con sus mascotas

requires authentication

Example request:
curl --request GET \
    --get "https://pet-management-api.lorenzorojo.com/api/v1/person/1/with-pets" \
    --header "Authorization: Bearer {YOUR_AUTH_KEY}" \
    --header "Accept: application/json" \
    --header "Content-Type: application/json"
const url = new URL(
    "https://pet-management-api.lorenzorojo.com/api/v1/person/1/with-pets"
);

const headers = {
    "Authorization": "Bearer {YOUR_AUTH_KEY}",
    "Accept": "application/json",
    "Content-Type": "application/json",
};

fetch(url, {
    method: "GET",
    headers,
}).then(response => response.json());
$client = new \GuzzleHttp\Client();
$url = 'https://pet-management-api.lorenzorojo.com/api/v1/person/1/with-pets';
$response = $client->get(
    $url,
    [
        'headers' => [
            'Authorization' => 'Bearer {YOUR_AUTH_KEY}',
            'Accept' => 'application/json',
            'Content-Type' => 'application/json',
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));

Example response (200):


{
    "id": 111,
    "name": "Pepito",
    "email": "pepito123@gmail.com",
    "birthdate": "13-08-1995",
    "pets": [
        {
            "id": 11,
            "name": "Michilina",
            "species": "cat",
            "breed": "angora",
            "age": "10.00",
            "image_url": null,
            "life_span": null,
            "adaptability": null,
            "reference_image_id": null,
            "created_at": "2025-05-18"
        },
        {
            "id": 12,
            "name": "Minina",
            "species": "cat",
            "breed": "Criolla",
            "age": "8.00",
            "image_url": null,
            "life_span": null,
            "adaptability": null,
            "reference_image_id": null,
            "created_at": "2025-05-18"
        },
        {
            "id": 13,
            "name": "Minina",
            "species": "cat",
            "breed": "Criolla",
            "age": "8.00",
            "image_url": null,
            "life_span": null,
            "adaptability": null,
            "reference_image_id": null,
            "created_at": "2025-05-18"
        },
        {
            "id": 14,
            "name": "Minina Acur",
            "species": "cat",
            "breed": "Abyssinian",
            "age": "8.00",
            "image_url": "https://cdn2.thecatapi.com/images/0XYvRd7oD.jpg",
            "life_span": "14 - 15",
            "adaptability": 5,
            "reference_image_id": "0XYvRd7oD",
            "created_at": "2025-05-18"
        },
        {
            "id": 15,
            "name": "Minina Acur  sdsdsdsd",
            "species": "Gato",
            "breed": "Abyssinian",
            "age": "5.00",
            "image_url": "https://cdn2.thecatapi.com/images/0XYvRd7oD.jpg",
            "life_span": "14 - 15",
            "adaptability": 5,
            "reference_image_id": "0XYvRd7oD",
            "created_at": "2025-05-18"
        }
    ]
}
 

Request      

GET api/v1/person/{person_id}/with-pets

Headers

Authorization      

Example: Bearer {YOUR_AUTH_KEY}

Accept      

Example: application/json

Content-Type      

Example: application/json

URL Parameters

person_id   integer   

The ID of the person. Example: 1