Petal Docs
  • Introduction
  • Connect to muse (Free)
    • Connect muse & Stream Raw Data
      • Connect muse to Mac
      • Connect muse to Windows
  • Receive Data Streams (Free)
    • Receive an LSL Stream
      • Python Examples
      • Node Examples
    • Receive an OSC Stream
      • Python Examples
      • Node Examples
    • Receive Webhooks
      • Python Examples
      • Node Examples
  • Log Data (Free)
    • Logging Data
  • Metrics API (Maker Plan)
    • API Integration
    • Make Metrics API calls
      • Python Examples
      • Node.js Examples
  • Receive Data Streams (Maker Plan)
    • Receive an LSL Stream
      • Python Examples
      • Node Examples
    • Receive an OSC Stream
      • Python Examples
      • Node Examples
    • Receive Webhooks
      • Python Examples
      • Node Examples
  • Glossary of Terms
    • Glossary of Terms
  • 🧪Markers
    • 🧪Markers User Guide
Powered by GitBook
On this page
  • Receiving Webhooks
  • API Message Examples

Was this helpful?

  1. Receive Data Streams (Maker Plan)

Receive Webhooks

PreviousNode ExamplesNextPython Examples

Last updated 3 years ago

Was this helpful?

Receiving Webhooks

Webhooks are a way to get notifications over the network by setting up a server and listening for post events. To set up a simple server to receive webhooks, you can also use some of the example scripts in the .

All API messages are supported through webhooks.

All messages are sent on the root path '/'.

API Message Examples

blink

{
  'action': {
    'value': 0, 'time': 1214.697467542195
  },
  'data': {
    'blink': {'blink': 0},
    'id': 21,
    'lsl_ts': 1214.697467542195,
    'unix_ts': 1633343930.865,
    'lsl_eeg_fill_ts': 1214.7459047,
    'lsl_api_call_ts': 1257.6010982,
    'lsl_api_recv_ts': 1257.7840578,
    'last_eeg_id': 2895
  },
  'type': 'blink'
}

eye

{
  'action': {
    'value': 0,
    'time': 1214.697467542195
  },
  'data': {
    'eye': {'eye': 0},
    'id': 21,
    'lsl_ts': 1214.697467542195,
    'unix_ts': 1633343930.865,
    'lsl_eeg_fill_ts': 1214.7459047,
    'lsl_api_call_ts': 1257.6010982,
    'lsl_api_recv_ts': 1257.7840578,
    'last_eeg_id': 2895
  },
  'type': 'eye'
}

bandpower

{
  'action': {
    'value': [
      'bad_data', 'bad_data', 'bad_data', 'bad_data', 'bad_data', 'bad_data', 'bad_data', 'bad_data', 'bad_data', 'bad_data', 'bad_data', 'bad_data', 'bad_data', 'bad_data', 'bad_data', 'bad_data'
    ],
    'time': 1214.697467542195
  },
  'data': {
    'bandpower': {
      'ch1': {
        'delta': 'bad_data',
        'theta': 'bad_data',
        'alpha': 'bad_data',
        'beta': 'bad_data'
      }, 'ch2': {
        'delta': 'bad_data',
        'theta': 'bad_data',
        'alpha': 'bad_data',
        'beta': 'bad_data'
      },
      'ch3': {
        'delta': 'bad_data',
        'theta': 'bad_data',
        'alpha': 'bad_data',
        'beta': 'bad_data'
      },
      'ch4': {
        'delta': 'bad_data',
        'theta': 'bad_data',
        'alpha': 'bad_data',
        'beta': 'bad_data'
      }
    },
    'id': 21,
    'lsl_ts': 1214.697467542195,
    'unix_ts': 1633343930.865,
    'lsl_eeg_fill_ts': 1214.7459047,
    'lsl_api_call_ts': 1257.6010982,
    'lsl_api_recv_ts': 1257.7840578,
    'last_eeg_id': 2895
  },
  'type': 'bandpower'
}

artifact detection

{
  'action': {
    'value': [0, 0, 0, 0],
    'time': 1214.697467542195
  },
  'data': {
    'artifact_detect': {
      'ch1': 0,
      'ch2': 0,
      'ch3': 0,
      'ch4': 0
    },
    'id': 21,
    'lsl_ts': 1214.697467542195,
    'unix_ts': 1633343930.865,
    'lsl_eeg_fill_ts': 1214.7459047,
    'lsl_api_call_ts': 1257.6010982,
    'lsl_api_recv_ts': 1257.7840578,
    'last_eeg_id': 2895
  },
  'type': 'artifact-detect'
}

metricsJson (JSON object of all metrics data)

{
  'action': {
    'value': {
      'artifact_detect': {
        'channel1': 'artifact',
        'channel2': 'artifact',
        'channel3': 'artifact',
        'channel4': 'artifact'
      },
      'bandpower': {
        'channel1': {
          '0': 'bad_data',
          '1': 'bad_data',
          '2': 'bad_data',
          '3': 'bad_data'
        },
        'channel2': {
          '0': 'bad_data',
          '1': 'bad_data',
          '2': 'bad_data',
          '3': 'bad_data'
        },
        'channel3': {
          '0': 'bad_data',
          '1': 'bad_data',
          '2': 'bad_data',
          '3': 'bad_data'
        },
        'channel4': {
          '0': 'bad_data',
          '1': 'bad_data',
          '2': 'bad_data',
          '3': 'bad_data'
        }
      },
      'blink': {'blink': 0},
      'eye': {'eye': 0}
    },
    'time': 1214.697467542195
  },
  'data': {
    'metrics': {
      'artifact_detect': {
        'channel1': 'artifact',
        'channel2': 'artifact',
        'channel3': 'artifact',
        'channel4': 'artifact'
      },
      'bandpower': {
        'channel1': {
          '0': 'bad_data',
          '1': 'bad_data',
          '2': 'bad_data',
          '3': 'bad_data'
        },
        'channel2': {
          '0': 'bad_data',
          '1': 'bad_data',
          '2': 'bad_data',
          '3': 'bad_data'
        },
        'channel3': {
          '0': 'bad_data',
          '1': 'bad_data',
          '2': 'bad_data',
          '3': 'bad_data'
        },
        'channel4': {
          '0': 'bad_data',
          '1': 'bad_data',
          '2': 'bad_data',
          '3': 'bad_data'
        }
      },
      'blink': {'blink': 0},
      'eye': {'eye': 0}
    },
    'id': 21,
    'lsl_ts': 1214.697467542195,
    'unix_ts': 1633343930.865,
    'lsl_eeg_fill_ts': 1214.7459047,
    'lsl_api_call_ts': 1257.6010982,
    'lsl_api_recv_ts': 1257.7840578,
    'last_eeg_id': 2895
  },
  'type': 'metricsJson'
}

metrics (array object of all metrics data, same format as LSL)

{
  'action': {
    'value': [0, 0, 0, 0, 0, 0, 'bad_data', 'bad_data', 'bad_data', 'bad_data', 'bad_data', 'bad_data', 'bad_data', 'bad_data', 'bad_data', 'bad_data', 'bad_data', 'bad_data', 'bad_data', 'bad_data', 'bad_data', 'bad_data'],
    'time': 1214.697467542195
  },
  'data': {
    'metrics': [0, 0, 0, 0, 0, 0, 'bad_data', 'bad_data', 'bad_data', 'bad_data', 'bad_data', 'bad_data', 'bad_data', 'bad_data', 'bad_data', 'bad_data', 'bad_data', 'bad_data', 'bad_data', 'bad_data', 'bad_data', 'bad_data'],
    'id': 21,
    'lsl_ts': 1214.697467542195
     'unix_ts': 1633343930.865,
     'lsl_eeg_fill_ts': 1214.7459047,
     'lsl_api_call_ts': 1257.6010982,
     'lsl_api_recv_ts': 1257.7840578,
     'last_eeg_id': 2895
  },
  'type': 'metrics'
}
getting started repo