API Docs
Create a new short link
POST /api/links
You can use qm.ar's API to generate your own short links. This endpoint expects a JSON object containing the link you'd like to shorten, and returns the generated hash.
cURL Request
curl --request POST \
--url https://qm.ar/api/links \
--header 'Content-Type: application/json' \
--data '{
"url": "https://www.google.com/"
}'
Response
{
"status": 200,
"data": {
"_id": "KzAFSr",
"url": "https://www.google.com/",
"createdAt": "2023-02-25T15:07:16.578Z",
"updatedAt": "2023-02-25T15:07:16.578Z"
}
}
Retrieve an existing link
GET /api/links/:hash
You can retrieve a shortened link using the generated hash.
cURL Request
curl --request GET \
--url https://qm.ar/api/links/KzAFSr
Response
{
"status": 200,
"data": {
"_id": "KzAFSr",
"url": "https://www.google.com/",
"createdAt": "2023-02-25T15:07:16.578Z",
"updatedAt": "2023-02-25T15:07:16.578Z"
}
}