### Install Localtonet on Linux (Quick Install) Source: https://localtonet.com/documents/linux This command downloads and executes the official Localtonet installation script. It automatically detects the system's architecture and OS, then installs the correct build to `/usr/local/bin/localtonet`. Administrative privileges (sudo) may be required for installation. ```bash curl -fsSL https://localtonet.com/install.sh | sh ``` -------------------------------- ### Manual Install Localtonet on Linux (x64, glibc) Source: https://localtonet.com/documents/linux This section details the manual installation process for Localtonet on x64 glibc-based Linux distributions. It involves downloading the zip archive, extracting it to a user-specified directory, and granting execute permissions. Optionally, the binary can be moved to a system-wide PATH. ```bash wget https://localtonet.com/download/localtonet-linux-x64.zip ``` ```bash unzip localtonet-linux-x64.zip -d ~/localtonet ``` ```bash chmod 755 ~/localtonet/localtonet ``` ```bash # optional: move to PATH (requires sudo) sudo mv ~/localtonet/localtonet /usr/local/bin/localtonet ``` -------------------------------- ### Install Localtonet on Termux (Android) Source: https://localtonet.com/documents/linux This guide outlines the manual installation of Localtonet on Termux for Android devices. It involves downloading a specific Termux package, extracting it, installing the .deb file using `pkg`, and then authenticating the device. Service mode and VPN are not supported on Termux. ```bash wget https://localtonet.com/download/localtonet-termux.zip ``` ```bash unzip localtonet-termux.zip ``` ```bash pkg install ./localtonet.deb ``` -------------------------------- ### Authenticate Localtonet with AuthToken (Windows) Source: https://localtonet.com/documents/windows This command authenticates your Localtonet installation on Windows using your unique AuthToken. It stores the token locally, making Localtonet ready for use. Ensure you replace `` with your actual token. ```powershell localtonet.exe --authtoken ``` -------------------------------- ### Run Localtonet Docker Container with Authentication Source: https://localtonet.com/documents/docker Starts a Localtonet Docker container and authenticates it using a provided token. Replace `` with your actual authentication token obtained from the Localtonet dashboard. ```docker docker run localtonet/localtonet --authtoken ``` -------------------------------- ### Manage Localtonet Docker Container Source: https://localtonet.com/documents/docker Provides essential Docker commands for managing the Localtonet container, including viewing running containers, streaming logs, stopping, starting, and removing the container. ```docker docker ps docker logs -f localtonet docker stop localtonet docker start localtonet docker rm -f localtonet ``` -------------------------------- ### Display Localtonet Command Line Help Source: https://localtonet.com/documents/linux This command displays the help information for the Localtonet command-line interface. It lists all available commands, options, and their descriptions, useful for understanding the full capabilities of the tool. ```bash localtonet --help ``` -------------------------------- ### Pull Localtonet Docker Image Source: https://localtonet.com/documents/docker Fetches the latest version of the Localtonet Docker image from the registry. This command ensures you are using the most up-to-date software. ```docker docker pull localtonet/localtonet ``` -------------------------------- ### WebHookRequest JSON Payload Example Source: https://localtonet.com/documents/webhook This is an example of the JSON payload sent by Localtonet webhooks when a token or tunnel connection status changes. It includes the ID of the token/tunnel, the action date, the type (Token or Tunnel), and the new status (Connected or Disconnected). ```json { "Id": "9xknivVmUWwu1dqBOHRybM78", "ActionDate": "2024-04-29T12:35:17.154580", "Type": "Token", "Status": "Disconnected" } ``` -------------------------------- ### Authenticate Localtonet on Linux/Termux Source: https://localtonet.com/documents/linux Authenticates the current device with Localtonet using a provided authentication token. The token is stored locally for the user and can be managed from the Localtonet dashboard. This command is used for both basic usage and after manual installation. ```bash localtonet --authtoken ``` -------------------------------- ### Run Localtonet Docker Container in Detached Mode with Auto-Restart Source: https://localtonet.com/documents/docker Launches the Localtonet Docker container in the background (`-d`) and configures it to automatically restart unless explicitly stopped (`--restart unless-stopped`). This is ideal for running Localtonet as a persistent service. ```docker docker run -d \ --name localtonet \ --restart unless-stopped \ localtonet/localtonet --authtoken ``` -------------------------------- ### Login to Localtonet SMS Bot Source: https://localtonet.com/documents/smsbot Authenticate with the Localtonet SMS Bot using the `/login` command followed by your API key. This is the first step to access the bot's functionalities. ```bash /login hlTMBXz1S62V3jUpyamWt5OLoq33 ``` -------------------------------- ### SSH Tunnel Command for Localtonet Source: https://localtonet.com/documents/zero-install-ssh This command establishes an SSH tunnel using Localtonet to expose a local service. It requires an SSH client and a valid tunnel token. The command forwards traffic from a public address to a local address and port. ```shell ssh -p 223 YourTunnelToken@example.localto.net -R3327:127.0.0.1:8080 ``` -------------------------------- ### User Authentication API Source: https://localtonet.com/documents/smsbot Logs in the user to the Localtonet SMS Bot using an API key. This is the first step to authenticate and use other bot functionalities. ```APIDOC ## POST /login ### Description Logs the user into the Localtonet SMS Bot using their API key for authentication. ### Method POST ### Endpoint /login ### Parameters #### Path Parameters None #### Query Parameters None #### Request Body - **apiKey** (string) - Required - The API key obtained from the dashboard for authentication. ### Request Example ```json { "apiKey": "hlTMBXz1S62V3jUpyamWt5OLoq33Terminal Copy" } ``` ### Response #### Success Response (200) - **message** (string) - A success message indicating successful login. #### Response Example ```json { "message": "Successfully logged in." } ``` ``` -------------------------------- ### Send USSD Code API Source: https://localtonet.com/documents/smsbot Sends a USSD code to the network for execution. ```APIDOC ## POST /sendussdcode ### Description Executes a provided USSD code on the network. ### Method POST ### Endpoint /sendussdcode ### Parameters #### Path Parameters None #### Query Parameters None #### Request Body - **authToken** (string) - Required - The authentication token for the user. - **ussdCode** (string) - Required - The USSD code to be executed (e.g., *123#). ### Request Example ```json { "authToken": "tOnJ2FwMf3zSZYvHiTbBrRd7", "ussdCode": "*123#" } ``` ### Response #### Success Response (200) - **status** (string) - The status of the USSD code execution. - **response** (string) - The response received from the USSD code execution. #### Response Example ```json { "status": "success", "response": "Your balance is $10.00" } ``` ``` -------------------------------- ### Send USSD Code via Localtonet SMS Bot Source: https://localtonet.com/documents/smsbot Execute a USSD code using the `/sendussdcode` command. Provide your authentication token and the USSD code you wish to send. ```bash /sendussdcode tOnJ2FwMf3zSZYvHiTbBrRd7 *123# ``` -------------------------------- ### POST /webhook Source: https://localtonet.com/documents/webhook Receives webhook notifications from Localtonet when a token or tunnel's status changes. The system sends a POST request with a JSON payload containing event details. ```APIDOC ## POST /webhook ### Description This endpoint receives webhook notifications from Localtonet. It is triggered when a token or tunnel's status changes (e.g., connected or disconnected). A POST request with a JSON payload is sent to the configured webhook URL. ### Method POST ### Endpoint /webhook ### Request Body #### `WebHookRequest` (object) - Required Represents the data payload sent with the webhook notification. - **Id** (string) - Required - The ID of the tunnel or authtoken. - **ActionDate** (string) - Required - The timestamp indicating when the action occurred (e.g., '2024-04-29T12:35:17.154580'). - **Type** (string) - Required - The type of event, either 'Token' or 'Tunnel'. - **Status** (string) - Required - The new status of the token or tunnel, either 'Connected' or 'Disconnected'. ### Request Example ```json { "Id": "9xknivVmUWwu1dqBOHRybM78", "ActionDate": "2024-04-29T12:35:17.154580", "Type": "Token", "Status": "Disconnected" } ``` ### Response #### Success Response (200 OK) Indicates that the webhook notification was successfully received and processed by your application. #### Response Example ```json { "message": "Webhook received successfully" } ``` #### Error Response (e.g., 400 Bad Request, 500 Internal Server Error) Indicates an issue with processing the webhook request. #### Error Response Example ```json { "error": "Invalid payload format" } ``` ``` -------------------------------- ### Read All SMS Messages from Last Hour Source: https://localtonet.com/documents/smsbot Retrieve all SMS messages received in the last hour using the `/readallsms` command. This command requires your authentication token and the duration (in hours) for which to fetch messages. ```bash /readallsms tOnJ2FwMf3zSZYvHiTbBrRd7 1 ``` -------------------------------- ### Send SMS API Source: https://localtonet.com/documents/smsbot Sends an SMS message to a specified recipient. ```APIDOC ## POST /sendsms ### Description Sends an SMS message to a specified phone number. ### Method POST ### Endpoint /sendsms ### Parameters #### Path Parameters None #### Query Parameters None #### Request Body - **authToken** (string) - Required - The authentication token for the user. - **phoneNumber** (string) - Required - The recipient's phone number, including the country code. - **message** (string) - Required - The content of the SMS message. ### Request Example ```json { "authToken": "tOnJ2FwMf3zSZYvHiTbBrRd7", "phoneNumber": "+15615557689", "message": "Hello" } ``` ### Response #### Success Response (200) - **status** (string) - The status of the SMS sending operation. - **messageId** (string) - A unique identifier for the sent SMS message. #### Response Example ```json { "status": "sent", "messageId": "msg_12345abcde" } ``` ``` -------------------------------- ### Read SMS Messages API Source: https://localtonet.com/documents/smsbot Retrieves all SMS messages received within a specified duration (in hours) from the last hour. ```APIDOC ## GET /readallsms ### Description Fetches all SMS messages received within the specified duration (in hours) from the last hour. ### Method GET ### Endpoint /readallsms ### Parameters #### Path Parameters None #### Query Parameters - **authToken** (string) - Required - The authentication token for the user. - **durationHours** (integer) - Required - The duration in hours to retrieve SMS messages from. #### Request Body None ### Request Example ``` /readallsms tOnJ2FwMf3zSZYvHiTbBrRd7 1Terminal Copy ``` ### Response #### Success Response (200) - **messages** (array) - A list of SMS messages received within the specified duration. - **from** (string) - The sender's phone number. - **message** (string) - The content of the SMS message. - **timestamp** (string) - The time the message was received. #### Response Example ```json { "messages": [ { "from": "+1234567890", "message": "Hello there!", "timestamp": "2023-10-27T10:00:00Z" } ] } ``` ``` -------------------------------- ### Send SMS Message via Localtonet SMS Bot Source: https://localtonet.com/documents/smsbot Send an SMS message to a specified recipient using the `/sendsms` command. This requires your authentication token, the recipient's phone number (including country code), and the message content. ```bash /sendsms tOnJ2FwMf3zSZYvHiTbBrRd7 +15615557689 Hello ``` === COMPLETE CONTENT === This response contains all available snippets from this library. No additional content exists. Do not make further requests.