Overview
TheLoginEntry model is used to authenticate and gain access to manage a specific short URL. When a short URL is password-protected, you must provide valid credentials to perform management operations.
When to Use
This model is used in:- POST /login - Authenticate and receive an access token for managing a short URL
Schema Definition
The short code of the URL you want to manage.This should match the
url_code used when creating the short URL.The password that was set when creating the short URL.Authentication:
- Must match the password set during URL creation
- Used to generate a JWT access token for subsequent management operations
- Tokens expire after a set duration (check API response for expiration)
Example JSON
Authentication Flow
The login endpoint returns a JWT access token that must be included in the Authorization header for protected management endpoints.
Step-by-Step Authentication
Step-by-Step Authentication
- Login Request - Send POST to
/loginwithLoginEntrycredentials - Receive Token - API responds with access token and expiration time
- Use Token - Include token in
Authorization: Bearer <token>header - Token Expiry - Use
/refresh_tokenendpoint to get a new token before expiration - Manage URL - Perform operations like delete, pause, change password, etc.
Response
Successful authentication returns:Error Cases
Security Considerations
Best Practices
Best Practices
- Never log or expose the
url_passin client-side code - Use HTTPS for all login requests to prevent password interception
- Store access tokens securely (e.g., HTTP-only cookies, secure storage)
- Implement token refresh logic before expiration
- Clear tokens on logout
Related Endpoints
- Login - Authenticate with this model
- Refresh Token - Extend your session
- Validate Token - Check if your token is still valid