Redirect Short URL API

URL Shortener API

Endpoint: GET /api/shorten/{alias}

This endpoint allows you to shorten a URL by providing an alias. When a user accesses the shortened URL (with the alias), the system will look up the original long URL. If the alias exists in the database, the system will redirect to the original URL.

Request Example

To use this endpoint, enter the following URL in your browser: https://minifyurl.choreoapps.dev/api/shorten/{alias}

Replace {alias} with the desired alias for the shortened URL.

Behavior

  • If the alias is found in the database: The system will automatically redirect the user to the original long URL.

  • If the alias is not found in the database: A 419 error response will be returned, indicating that the alias is invalid.

Response Example

If the alias is invalid or not found, the response will be:

{
  "success": false,
  "message": "Invalid Alias"
}

Last updated