API Documentation
This page is meant for developers, vendors, and IT administrators to understand how to generate the bearer token to access our API to get/create/update shortlinks.
Last updated
curl --location --request POST 'https://for.sg/api/v1/urls' \
--header 'Authorization: Bearer live_v1_YOUR_API_KEY'{
"message": "Unauthorized"
}GET /v1/urls?...{
"urls": [
{
"shortUrl": "197abc",
"longUrl": "https://link.com",
"state": "ACTIVE",
"clicks": 0,
"createdAt": "2022-09-19T03:31:00.131Z",
"updatedAt": "2022-09-19T03:31:00.131Z"
}
],
"count": 1
}POST /v1/urls{
"shortUrl": "197abc",
"longUrl": "https://link.com",
"state": "ACTIVE",
"clicks": 0,
"createdAt": "2022-09-19T03:31:00.131Z",
"updatedAt": "2022-09-19T03:31:00.131Z"
}{
"message": "Short link \\"asd\\" is already used.",
"type": "ShortUrlError"
}PATCH /v1/urls/{shortUrl}{
"shortUrl": "197abc",
"longUrl": "https://link.com",
"state": "ACTIVE",
"clicks": 0,
"createdAt": "2022-09-19T03:31:00.131Z",
"updatedAt": "2022-09-19T03:31:00.131Z"
}