API Documentation

Welcome to the URL Shortener API! This API allows you to shorten long URLs and resolve them back to their original form.

API Endpoints

1. Shorten URL

Endpoint: POST /shorten

Request Body:

{"longUrl": "https://www.example.com"}

2. Resolve Shortened URL

Endpoint: GET /resolve?code=abc123

Response:

{"originalUrl": "https://www.example.com"}

Example Usage

Shorten a URL (Using cURL)

curl -X POST https://urlshotner.online/shorten -H "Content-Type: application/json" -d '{"longUrl": "https://www.example.com"}'

Resolve a Shortened URL (Using cURL)

curl -X GET "https://urlshotner.online/resolve?code=abc123"