External Triggers

The developer API exposes “External” trigger outside of mtion studio. It allows them to be queried as well as fired. This API can be called at localhost:35393 whenever a local instance of mtion studio is running.

Get all external triggers

Returns an array of external trigger datas in the currently opened clubhouse

URL

GET http://localhost:35393/external-trigger/triggers

Response Codes

Code
Description

200 OK

Successfully retrieved the currently opened clubhouse’s external triggers

404 Not Found

No clubhouse open

Sample Query

curl -X GET 'http://localhost:35393/external-trigger/triggers'

Sample Response

[
    {
        "id": "1ff84176fc8242d8918e1404f33d6161",
        "name": "New External Trigger",
        "output_parameters": [
            {
                "parameter_index": 0,
                "name": "First String Parameter",
                "data_type": "string"
            },
            {
                "parameter_index": 1,
                "name": "Second Number Parameter",
                "data_type": "number"
            },
            {
                "parameter_index": 2,
                "name": "Third Bool Parameter",
                "data_type": "bool"
            },
            {
                "parameter_index": 3,
                "name": "Fourth Enum Parameter",
                "data_type": "enum"
            }
        ]
    },
    {
        "id": "08195c6a468a49228ccf4c88f11558c7",
        "name": "New External Trigger 2",
        "output_parameters": [
            {
                "parameter_index": 0,
                "name": "First String Parameter",
                "data_type": "string"
            }
        ]
    }
]

Get single external trigger

Returns a single external trigger data specified by id in the currently opened clubhouse

URL

GET http://localhost:35393/external-trigger/trigger/:trigger-id

Response Codes

Code
Description

200 OK

Successfully retrieved the trigger data

404 Not Found

No clubhouse open or trigger not found

Sample Query

Sample Response

Fire External Trigger

Fires an external trigger with some optional parameter data. When called with GET the data is passed as a query parameter. When called with PATCH the data is passed as a JSON in the body. This request also returns the data of the trigger that was fired.

URL

GET http://localhost:35393/external-trigger/fire-trigger/:trigger-id?parameter_data=[]

PATCH http://localhost:35393/external-trigger/fire-trigger/:trigger-id

Response Codes

Code
Description

200 OK

Successfully fired the trigger

404 Not Found

No clubhouse open or trigger not found

Sample GET Query

Sample PATCH Query

Sample Response

Sample Python script

Below is a sample python script which queries the external triggers in the currently opened clubhouse. It then fires each one while passing some mock data to each of their parameters.

Clubhouses

The developer API exposes clubhouses of mtion studio. This API can be called at localhost:35393 whenever a local instance of mtion studio is running.

Get all clubhouses

Returns an array of clubhouse datas for the current user.

URL

GET http://localhost:35393/clubhouses

Response Codes

Code
Description

200 OK

Successfully retrieved the currently opened clubhouse’s external triggers

Sample Query

Get single clubhouse

Returns the clubhouse data specified by the id.

URL

GET http://localhost:35393/clubhouse/:clubhouse-id

Response Codes

Code
Description

200 OK

Successfully retrieved the currently opened clubhouse’s external triggers

404 Not Found

Clubhouse not found

Sample Query

Sample Response

Get active clubhouse

Returns the currently opened clubhouse’s data.

URL

GET http://localhost:35393/active-clubhouse

Response Codes

Code
Description

200 OK

Successfully retrieved the currently opened clubhouse’s external triggers

404 Not Found

No clubhouse open

Sample Query

Sample Response

Last updated