Editor helpers

Lists the editor uses for pickers, sample event data, schedule previews and test events.

MethodPathSummary
GET/api/devicesRMM devices (for the device step)
GET/api/bramble/formA form's questions, for the "Form response submitted" trigger (as the flow's owner: their own access decides)
GET/api/bramble/optionsPickers in Bramble steps (engine/nodes/bramble.js OPTION_SOURCES), as the flow's owner: ?flow=&source=psa.queues[&project=12]
POST/api/events/testSends a "flows.test" event for the current user, to try event triggers
POST/api/schedule/previewWhen a schedule would next run, for the settings panel
GET/api/events/:type/sampleExample data for an app event

#RMM devices (for the device step)

GET/api/devices
Address
https://<your-org>.brambleit.cloud/flows/api/devices
Requires
Signed-in browser session (the sso_session / session_id cookies from Bramble sign-in).
Licence: Flows.

Query parameters

NameTypeDescription
flownumber
qany

Response 200

Errors

StatusMessage
404Flow not found

Example request

JavaScript
// From a page served by Bramble (uses the signed-in session)
const res = await fetch('/flows/api/devices', {
  method: 'GET',
  credentials: 'include',
});
const data = await res.json();

#A form's questions, for the "Form response submitted" trigger (as the flow's owner: their own access decides)

GET/api/bramble/form
Address
https://<your-org>.brambleit.cloud/flows/api/bramble/form
Requires
Signed-in browser session (the sso_session / session_id cookies from Bramble sign-in).
Licence: Flows.

Query parameters

NameTypeDescription
flownumber
formnumber

Response 200

Errors

StatusMessage
404Flow not found

Example request

JavaScript
// From a page served by Bramble (uses the signed-in session)
const res = await fetch('/flows/api/bramble/form', {
  method: 'GET',
  credentials: 'include',
});
const data = await res.json();

#Pickers in Bramble steps (engine/nodes/bramble.js OPTION_SOURCES), as the flow's owner: ?flow=&source=psa.queues[&project=12]

GET/api/bramble/options
Address
https://<your-org>.brambleit.cloud/flows/api/bramble/options
Requires
Signed-in browser session (the sso_session / session_id cookies from Bramble sign-in).
Licence: Flows.

Query parameters

NameTypeDescription
flownumber
sourcestring
projectany

Response 200

FieldTypeDescription
optionsarray of any
Example response
JSON
{
  "options": []
}

Errors

StatusMessage
400Unknown list
404Flow not found

Example request

JavaScript
// From a page served by Bramble (uses the signed-in session)
const res = await fetch('/flows/api/bramble/options', {
  method: 'GET',
  credentials: 'include',
});
const data = await res.json();

#Sends a "flows.test" event for the current user, to try event triggers

POST/api/events/test
Address
https://<your-org>.brambleit.cloud/flows/api/events/test
Requires
Signed-in browser session (the sso_session / session_id cookies from Bramble sign-in).
Licence: Flows.

Request body JSON

NameTypeDescription
messagestring

Response 201

FieldTypeDescription
event_idinteger
Example response
JSON
{
  "event_id": 7
}

Example request

JavaScript
// From a page served by Bramble (uses the signed-in session)
const res = await fetch('/flows/api/events/test', {
  method: 'POST',
  credentials: 'include',
  headers: { 'Content-Type': 'application/json' },
  body: JSON.stringify({"message":"Saved"}),
});
const data = await res.json();

#When a schedule would next run, for the settings panel

POST/api/schedule/preview
Address
https://<your-org>.brambleit.cloud/flows/api/schedule/preview
Requires
Signed-in browser session (the sso_session / session_id cookies from Bramble sign-in).
Licence: Flows.

Request body JSON

NameTypeDescription
scheduleany

Response 200

FieldTypeDescription
descriptionstring
nextarray of any
Example response
JSON
{
  "description": "string",
  "next": []
}

Example request

JavaScript
// From a page served by Bramble (uses the signed-in session)
const res = await fetch('/flows/api/schedule/preview', {
  method: 'POST',
  credentials: 'include',
  headers: { 'Content-Type': 'application/json' },
  body: JSON.stringify({"schedule":"…"}),
});
const data = await res.json();

#Example data for an app event

GET/api/events/:type/sample
Address
https://<your-org>.brambleit.cloud/flows/api/events/:type/sample
Requires
Signed-in browser session (the sso_session / session_id cookies from Bramble sign-in).
Licence: Flows.

Path parameters

NameTypeDescription
typerequiredstring

Response 200

FieldTypeDescription
sampleobject
sample.eventstring
Example response
JSON
{
  "sample": {
    "event": "string",
    "…e.sample": "…"
  }
}

Errors

StatusMessage
404Unknown event

Example request

JavaScript
// From a page served by Bramble (uses the signed-in session)
const res = await fetch('/flows/api/events/string/sample', {
  method: 'GET',
  credentials: 'include',
});
const data = await res.json();