Welcome to the API documentation for QwkLink! This guide will walk you through the steps of authenticating and creating shortened URLs via our API.
Our API uses Laravel Sanctum for authentication, which allows users to create API tokens for secure access. Follow the steps below to authenticate and start shortening URLs.
To use the API, you'll need an API token. Follow these steps to generate one:
Once you have your API token, you can authenticate API requests by including the token in the Authorization header as a Bearer token.
curl -X POST "https://qwkl.ink/api/shorten" \
-H "Authorization: Bearer YOUR_API_TOKEN" \
-H "Content-Type: application/json" \
-d '{
"original_url": "https://example.com"
}'
This endpoint allows you to create a shortened URL from a given original URL.
POST https://qwkl.ink/api/shorten
Parameter | Type | Description | Required |
---|---|---|---|
original_url | string | The full URL to be shortened | Yes |
curl -X POST "https://qwkl.ink/api/shorten" \
-H "Authorization: Bearer YOUR_API_TOKEN" \
-H "Content-Type: application/json" \
-d '{
"original_url": "https://example.com"
}'
If the request is successful, the API will return the shortened URL.
{
"shortened_url": "https://qwkl.ink/abc123"
}
{
"message": "The given data was invalid.",
"errors": {
"original_url": [
"The original_url must be a valid URL."
]
}
}
{
"message": "Unauthenticated."
}
We may impose rate limits on API requests to prevent abuse. If you exceed the limit, you will receive a 429 status code.
Authorization
header.
original_url
parameter is a valid, properly formatted
URL.
If you encounter any issues or have questions, please contact our support team at [email protected].