Eine Liste der URL-Adressen abrufen.
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
Informationen zu einer bestimmten URL-Adresse abrufen.
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
Eine neue URL-Adresse erstellen.
Das Feld "expiresAt" ist 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
Eine vorhandene URL-Adresse aktualisieren.
Das Feld "expiresAt" kann null sein.
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
Eine vorhandene URL-Adresse löschen.
DELETE /api/v1/urls/{id}
Authorization: Bearer {token}
Empty
204