### GET /api/getconfig - Get Backend Configuration Source: https://context7.com/sintan1729/chhoto-url/llms.txt Retrieve server configuration including version, slug settings, and operational mode. ```APIDOC ## GET /api/getconfig ### Description Retrieve server configuration including version, slug settings, and operational mode. ### Method GET ### Endpoint `/api/getconfig` ### Response #### Success Response (200) - **version** (string) - The current version of the Chhoto URL service. - **site_url** (string) - The configured site URL. - **allow_capital_letters** (boolean) - Whether capital letters are allowed in shortlinks. - **public_mode** (boolean) - Whether the service is in public mode (allowing unauthenticated link creation). - **public_mode_expiry_delay** (integer) - The default expiration delay for links created in public mode. #### Response Example ```json { "version": "6.3.0", "site_url": "https://example.com", "allow_capital_letters": false, "public_mode": false, "public_mode_expiry_delay": 0 } ``` ``` -------------------------------- ### GET /api/all Source: https://github.com/sintan1729/chhoto-url/blob/main/CLI.md Retrieves a list of all currently available short links managed by the Chhoto URL service. Requires API key authentication. ```APIDOC ## GET /api/all ### Description Retrieves a list of all currently available short links managed by the Chhoto URL service. Requires API key authentication. ### Method GET ### Endpoint /api/all ### Parameters None ### Request Example ```bash curl -H "X-API-Key: " http://localhost:4567/api/all ``` ### Response #### Success Response (200) Returns a list of all short links. The exact format of the list items is not specified in the provided text but would typically include shortlink, longlink, creation date, expiry, etc. #### Response Example ```json [ { "shortlink": "example1", "longlink": "http://example.com/page1" }, { "shortlink": "example2", "longlink": "http://example.com/page2" } ] ``` ``` -------------------------------- ### Get Backend Configuration - Bash Source: https://context7.com/sintan1729/chhoto-url/llms.txt Retrieves the server configuration details, including version, site URL, and operational modes, by sending a GET request to the /api/getconfig endpoint. An API key is required for access. The response is a JSON object containing configuration parameters. ```bash # Get configuration curl -H "X-API-Key: YOUR_API_KEY_HERE" \ http://localhost:4567/api/getconfig # Response: # { # "version": "6.3.0", # "site_url": "https://example.com", # "allow_capital_letters": false, # "public_mode": false, # "public_mode_expiry_delay": 0 ``` -------------------------------- ### Get All Available Links (API Key) Source: https://github.com/sintan1729/chhoto-url/blob/main/CLI.md Fetches a list of all currently active short links managed by the Chhoto URL instance, using API key authentication. ```bash curl -H "X-API-Key: " http://localhost:4567/api/all ``` -------------------------------- ### GET /api/version Source: https://github.com/sintan1729/chhoto-url/blob/main/CLI.md Retrieves the current version of the Chhoto URL server. ```APIDOC ## GET /api/version ### Description Retrieves the current version of the Chhoto URL server. ### Method GET ### Endpoint /api/version ### Parameters None ### Request Example ```bash curl http://localhost:4567/api/version ``` ### Response #### Success Response (200) Returns the server version string. #### Response Example ```json { "version": "" } ``` ``` -------------------------------- ### Hash Password with Argon2 Source: https://github.com/sintan1729/chhoto-url/blob/main/INSTALLATION.md Provides a command-line example for hashing a password using the Argon2 algorithm, a salt, and specific tuning parameters. This is recommended for enhancing security in the chhoto-url application. ```bash echo -n | argon2 -id -t 3 -m 16 -l 32 -e ``` -------------------------------- ### GET /api/siteurl Source: https://github.com/sintan1729/chhoto-url/blob/main/CLI.md Retrieves the site URL configured for the Chhoto URL service. ```APIDOC ## GET /api/siteurl ### Description Retrieves the site URL configured for the Chhoto URL service. ### Method GET ### Endpoint /api/siteurl ### Parameters None ### Request Example ```bash curl http://localhost:4567/api/siteurl ``` ### Response #### Success Response (200) Returns the configured site URL string. #### Response Example ```json { "siteurl": "" } ``` ``` -------------------------------- ### Get Chhoto URL Server Version Source: https://github.com/sintan1729/chhoto-url/blob/main/CLI.md Retrieves the current version of the Chhoto URL server. This endpoint does not require authentication and returns basic information about the running service. ```bash curl http://localhost:4567/api/version ``` -------------------------------- ### Generate Secure Credentials (Bash) Source: https://context7.com/sintan1729/chhoto-url/llms.txt Demonstrates how to generate secure API keys and Argon2 password hashes using bash commands. It includes examples for creating a random 128-character API key and hashing a password with Argon2id. The output can be directly used in the Docker Compose configuration. ```bash # Generate secure API key (128 characters recommended) tr -dc A-Za-z0-9 " \ -d '' http://localhost:4567/api/getconfig ``` ### Response #### Success Response (200) - **version** (string) - The current version of the Chhoto URL server. - **site_url** (string) - The base URL of the Chhoto URL service. - **allow_capital_letters** (boolean) - Whether capital letters are allowed in shortlinks. - **public_mode** (boolean) - Whether public mode is enabled. - **public_mode_expiry_delay** (string) - Default expiry delay in public mode. - **slug_style** (string) - The style of slug generation. - **slug_length** (string) - The length of generated slugs. - **try_longer_slug** (boolean) - Whether to try longer slugs if initial generation fails. #### Error Response (400/401/404/500) - **success** (boolean) - Indicates if the operation was successful (will be false). - **error** (boolean) - Indicates if an error occurred (will be true). - **reason** (string) - A message explaining the reason for the error. #### Response Example (Success) ```json { "version": "", "site_url": "", "allow_capital_letters": true/false, "public_mode": true/false, "public_mode_expiry_delay": "", "slug_style": "