ouh.la

API Documentation

Shorten a URL

POST /shorten

Creates a new short URL. This endpoint is public, but can be enhanced by providing an authentication token.

Request Body

{
    "url": "https://your-long-url.com/with/a/very/long/path"
}

Authenticated Request (Optional)

To associate a short URL with your account, include your Firebase ID token in the Authorization header:

Authorization: Bearer [YOUR_ID_TOKEN]

Success Response (200)

{
    "short_url": "https://ouh.la/aBc12D"
}

Get My URLs

GET /api/my-urls?page=1

Retrieves a paginated list of short URLs created by the authenticated user. Requires authentication.

Headers

Authorization: Bearer [YOUR_ID_TOKEN]

Query Parameters

  • page (optional): The page number to retrieve. Defaults to 1.

Success Response (200)

{
    "urls": [
        {
            "ShortURL": "aBc12D",
            "LongURL": "https://your-long-url.com/...",
            "UserID": "firebase-user-id",
            "CreatedAt": "2025-10-30T12:00:00Z",
            "AccessCount": 42
        }
    ],
    "totalPages": 5,
    "currentPage": 1
}