Beyond the Web UI and Command-Line Interface (CLI), the ConHive Agent provides a powerful RESTful API. This interface allows developers to programmatically access agent functionalities, manage modules, retrieve data, and integrate the agent into custom applications, automation workflows, or third-party orchestration tools.
Before using the API, ensure the following conditions are met:
Agent Running: The ConHive Agent must be installed and actively running on the target device.
Network Accessibility: Your client machine must have network connectivity to the agent’s host and the configured HTTP port (default: 5050). Check firewalls if necessary.
Valid Credentials: You need the username and password for a valid agent user account.
Note: Default credentials might be specified during initial setup or located within the agent’s configuration files (consult the Configuration guide if unsure).
Most API endpoints are protected and require authentication using a JSON Web Token (JWT), commonly referred to as a Bearer Token. You must first obtain this token by authenticating with your user credentials.
Here are practical examples using curl to interact with the API. These assume you have obtained a token and stored it in a variable named TOKEN (as shown in the jq tip above).
The most convenient way to explore the full API surface, view detailed request/response models, and test endpoints interactively is through the built-in Swagger UI documentation.
Access it via your browser at: http://<AGENT_HOST>:<PORT>/docs
(Example using localhost: http://localhost:5050/docs)