URL Shortener API Documentation#
1. Create Short URL (POST /shorten)#
Purpose: Takes a long URL and generates a shortened URL.originalUrl (required): The URL you want to shorten.
customPath (optional): A custom alias for your shortened link (e.g., "my-link").
Success Response (200 OK): Returns the generated shortUrl in a JSON object.
Error Responses: Returns 400 Bad Request if originalUrl is missing, or 500 for server issues.
2. Redirect to Original URL (GET /:shortPath)#
Purpose: Interprets a short path and redirects the user to their original long destination.shortPath: The string ID of the shortened link you want to visit.
Success Response (302 Redirect): Automatically redirects the browser to the original destination URL.
Error Responses: Returns 404 Not Found if the short path doesn't exist, or 500 for server issues.
Modified at 2026-04-10 07:30:01