Recuperar una lista de URL.
GET /api/v1/urls
Authorization: Bearer {token}
{
"data": [
{
"id": 1,
"hash": "S8akS",
"shortUrl": "http://lnkz.at/S8akS",
"url": "https://example.com",
"clicks": 146,
"expiresAt": "2023-07-04 10:00:00",
},
{
"id": 1,
"hash": "rnMyK",
"shortUrl": "http://lnkz.at/rnMyK",
"url": "https://google.com",
"clicks": 755,
"expiresAt": "2023-12-12 13:30:00",
}
]
}
200
Recuperar información sobre una URL específica.
GET /api/v1/urls/{id}
Authorization: Bearer {token}
{
"data": {
"id": 1,
"hash": "S8akS",
"shortUrl": "http://lnkz.at/S8akS",
"url": "https://example.com",
"clicks": 146,
"expiresAt": "2023-07-04 10:00:00",
}
}
200
Crear una nueva URL.
El campo "expiresAt" es opcional.
POST /api/url
Authorization: Bearer {token}
Content-Type: application/json
{
"url": "https://www.youtube.com",
"expiresAt": "2025-12-31 23:59:59"
}
{
"data": {
"id": 3,
"hash": "2zKwy",
"shortUrl": "http://lnkz.at/2zKwy",
"url": "https://www.youtube.com",
"clicks": null,
"expiresAt": "2025-12-31T23:59:59.000000Z"
}
}
201
Actualizar una URL existente.
El campo "expiresAt" puede ser null.
PUT /api/v1/urls/{id}
Authorization: Bearer {token}
Content-Type: application/json
{
"url": "https://example.com",
"expiresAt": "2025-12-31 23:59:59"
}
empty
200
Eliminar una URL existente.
DELETE /api/v1/urls/{id}
Authorization: Bearer {token}
Empty
204