Skip to content

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.

EndpointNameDescription
/server.serviceServer ServiceProvides information and control from the MODLR Instance regarding available memory, storage capacity, users list, FTP server status and authentication.
/model.serviceModel ServiceProvides functions for managing the objects within a model.
/collaborator.serviceCollaborator ServiceProvides functions for accessing an application as a end user.
/datasource.serviceDatasource ServiceProvides functions for creating, updating and testing datasources.
/api.serviceAPI ServiceProvides 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.


Server Save Image

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.

Server Save Response Image

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.

TaskServiceDescription
TaskServiceDescription
server.saveServerInstructs the MODLR Instance to save the objects it holds in memory to disk.
server.memoryServerReturns the current available and used memory.
server.usersServerReturns a list of users and their details.
security.refreshServerRefreshes the list of users and their associated authentication tokens.
storage.checkServerReturns the current available and used disk space.
ftp.enableServerEnables the FTP Server. This will return the generic login details for a "writer" and a "reader" account.
ftp.disableServerDisables the FTP Server.
ftp.statusServerReturns 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.