The Public Application Programming Interface (API) function is an interface that allows sharing your datasets and widgets with your clients. In the Public API section of the MSPbots app, you can create, share, and delete your own API key. Once you have made and shared your public API, your clients can access the datasets and widgets assigned to that key.
What's on this page:
To access the Public API section, log in to MSPbots and navigate to Settings > Public API.
Create an API key:
Go to the Public API tab and click the Add New Key button.
Input a Name, select Custom for Type, and provide a short Description for your API.
Click Save.
Copy the API Key
Select the API you created in Step 1 from the APIKey dropdown.
Click the copy icon to copy the API. Send this to your clients for access to your datasets and widgets.
To remove an API Key, click the Remove This Key button. Removing an API key will draw your client's access to the datasets and widgets you assigned to the key.
To disconnect and unbind data to the API
The Enable Public API switch is the global switch that controls the availability of the Public API feature. The API Keys and all connected data will not be available if this switch is OFF or disabled.
Public API follows the REST model of exposing resources as URLs. The unified domain name of all interfaces is:
https://api.mspbots.ai/
REQUEST
Depending on the type of operation, the endpoints use one of two HTTP methods: POST, GET
RESPONSE
The response is in JSON format.
SAMPLE REQUEST
GET REQUEST (Dataset)
curl https://api.mspbots.ai/api/dataset/{resourceId} -H 'apikey: {apiKey}' -X GET
REQUEST
RESPONSE
GET REQUEST (Widget)
curl https://api.mspbots.ai/api/widget/{resourceId} -H 'apikey: {apiKey}' -X GET
REQUEST
RESPONSE
Supported query criteria
(Please Note: Currently, widgets that include measure or calculate layers are not supported.)
https://api.mspbots.ai/api/widget/{resourceId}?current=1&size=10&Real Name=n&Update Date=2021-10-10,2023-03-30,2023-04-05&Id=,1534956341424005122
Logical Operators | Field Type | example | ||||
TEXT | NUMBER | BOOLEAN | DATE | DATETIME | ||
Is Empty | √ | √ | √ | √ | √ | status= |
Contains | √ | name=Tod | ||||
Equals | √ | √ | is_default=true id=654321324612312 | |||
Later Than (>=) | √ | √ | √ | price=12.6, date=2022-07-01 | ||
Earlier Than (<=) | √ | price=,56.3 | ||||
between (>= and <=) | √ | √ | √ | price=12.6,56.3 date=2022-07-01,2023-02-01 | ||
Multiple intervals (>= and <=) or (>= and <=) | √ | √ | √ | price=12.6,56.3,103,210 date=2022-07-01,2023-02-01,2023-04-01,2023-05-01 | ||
(>= and <=) or (=) | √ | price=12.6,56.3,105.1 | ||||
(>= and <=) or (>=) | √ | √ | date=2022-07-01,2023-02-01,2023-04-01 |