REST API
Mango provides a comprehensive REST API that allows you to interact with virtually every aspect of the system programmatically. All data points, data sources, events, users, and system configurations can be managed through HTTP endpoints.
In This Section
-
Overview -- Introduction to the REST API, how to explore available endpoints using Swagger UI and OpenAPI, and the base URL structure for API requests.
-
Authentication -- How to authenticate with the Mango REST API, including session-based login with CSRF/XSRF protection, request and response format, and example login flows.
-
RQL Queries -- Using Resource Query Language (RQL) to filter and query data through API endpoints. Covers RQL syntax, implementing RQL in custom module endpoints, and writing automated tests for query endpoints.
-
Examples -- Practical API usage examples including reading data points, querying point values, creating and managing data sources, and setting point values from external applications.
Quick Reference
| Detail | Value |
|---|---|
| Base URL | /rest/latest/ |
| Content Type | application/json |
| Authentication | Session cookie + XSRF token, or JWT |
| Query Language | RQL (Resource Query Language) |
| API Documentation | Swagger UI at /rest/latest/swagger-ui.html (requires openApiDocumentation module in Mango 5.4+) |
All API responses return JSON. List endpoints return paginated results using the RQL limit and offset operators. Error responses include a localizedMessage field with a human-readable description of the problem.