How to use Event API?

I’m trying to make a script using the Event API, but I can’t get it to work. The reason for using it, is that I need to monitor some events on my gateways. I have used the documentation found here

I’m able to get it to work with a curl command

curl -X POST -H "Authorization: Bearer NNSXS.XXXXXX" -H "Accept: text/event-stream" --data '{"identifiers":[{"gateway_ids":{"gateway_id":"gw139"}}]}'

Since I want to store some of the events in a database, I have tried to set up a flow in Node-RED and also using a python script with no success.

The python script looks like this

import requests

auth_token = 'NNSXS.XXXXXX'

header = {'Authorization': 'Bearer ' + auth_token,
          'Accept': 'text/event-stream'}

payload = '{"identifiers":[{"gateway_ids":{"gateway_id":"gw139"}}]}'

url = ''
response =, headers=header, data=payload)

After doing a little bit of research it looks like I need something called a SSE client, but after trying to use that in python and Node-RED - I still can’t get it to work.

Does anybody have any experience with this or can point me in the right direction :slight_smile: ?