Restful API
All communication between the MODLR Gateway and the MODLR Instances are completed over the stateless RESTfull API. The requests are made by the Gateway service to each of the MODLR Instances. Developers each have full access to this API and can make requests of their MODLR Instances.
The MODLR Gateway service includes a page called the API Sandbox https://go.modlr.co/sandbox/ which provides a full list of API functions, descriptions and required arguments for use. This page allows API calls to be directly made against a MODLR Instance.
The API is available with 5 endpoints.
| Endpoint | Name | Description |
|---|---|---|
| /server.service | Server Service | Provides information and control from the MODLR Instance regarding available memory, storage capacity, users list, FTP server status and authentication. |
| /model.service | Model Service | Provides functions for managing the objects within a model. |
| /collaborator.service | Collaborator Service | Provides functions for accessing an application as a end user. |
| /datasource.service | Datasource Service | Provides functions for creating, updating and testing datasources. |
| /api.service | API Service | Provides an overview of the available API functions. |
Example calling the Server.Save function
On the sandbox page the available services are listed and below them their available functions. One can select the server.save function from the task list and see that the formulated request doesn’t have any empty properties so this task may not need any additional information to run.
TIP
The server save function instructs the MODLR Instance to save the objects it holds in memory to disk.

If the call button is pressed, the request is transported to the MODLR Instance which then executes the function and provides the results in JSON format.

For further information on the MODLR API please refer to the MODLR API Documentation.
Common Tasks performed using the API Sandbox
There are many common development tasks that modellers can perform using the API Sandbox.
| Task | Service | Description |
|---|---|---|
| Task | Service | Description |
| server.save | Server | Instructs the MODLR Instance to save the objects it holds in memory to disk. |
| server.memory | Server | Returns the current available and used memory. |
| server.users | Server | Returns a list of users and their details. |
| security.refresh | Server | Refreshes the list of users and their associated authentication tokens. |
| storage.check | Server | Returns the current available and used disk space. |
| ftp.enable | Server | Enables the FTP Server. This will return the generic login details for a "writer" and a "reader" account. |
| ftp.disable | Server | Disables the FTP Server. |
| ftp.status | Server | Returns a result of "1" if the FTP server is enabled. Returns a result of "0" if the FTP server is not running. Returns the generic login details for "writer" and "reader" accounts. |