Retrieve a list of URL entities.
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
Retrieve information about a specific URL entity.
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
Create a new URL entity.
Field "expiresAt" is optional.
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
Update an existing URL entity.
Field "expiresAt" can be 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
Delete an existing URL entity.
DELETE /api/v1/urls/{id}
Authorization: Bearer {token}
Empty
204