Jet Bridge

Jet uses its own universal messaging protocol via REST API to run actions on your Backend. So it will first ask your Backend for a list of available actions and then will execute them when you need to. Actions which are connected to some Collection will automatically appear in Jet Admin interface. To define your FlexAction you will need to implement single REST API method on your side to process 2 types of messages:

  1. List of available actions and their parameters

  2. Execution of particular action

  3. Get field options

After you have implemented this API method you should specify Messages URL field in your Jet Admin Project Settings to finish integration.

post
Jet Admin messages REST API endpoint

http://YOURBACKEND/api/messages/
Request
Response
Headers
Authorization
optional
object
Authorization Token which you should check
Body Parameters
params
optional
object
Optional action parameters
name
required
string
Unique messages name, may be one of: get_action_list, execute_action
200: OK
Example of get_action_list message response
[
{
// each action shoud defined unique name
"name": "mail_users",
"model_action": { // this is action which will be applied to selected users (for_instance==True flag)
"model": "users", // this should be collection name
"for_instance": true,
"bulk": true // this allows to execute single action query with ids separated with comma instead of one query per row
}
},
{
"name": "refresh_users_status",
"model_action": { // this is action which will be applied to all users (no for_instance==True flag)
"model": "users"
}
},
{
"name": "refresh_users_status",
"common_action": { } // this is a common action which is not connected to any collections
}
]
201: Created
Example of execute_action message response
{
"result": true
}
202: Accepted
Example of get_field_options message response
[
{
'value': 'london',
'name': 'London',
'color': 'blue'
},
{
'value': 'new_york',
'name': 'New York',
'color': 'green'
}
]