How to get notification of state change of web thing (button press)

I have a zigbee on / off button registered by my webthings service. It works perfectly. I would like to have an outside service get notified of when I user presses the button. Is this possible. I know there is an api to get (poll) the status of the button, but would prefer not to poll.

thanks

You can use the websocket API on the gateway. It’s described in the spec.

Thanks, I have started down that path, but am running into some issues.
Im first starting with the simple rest api, using postman and am getting unauthorized 401, when call X.x.x.x/things for example.
I see that I can create a access token , via the local token service, but when I create it, and place it into my authorization header in postman, I get a 403 error forbidden. Am I missing something here?, are there any examples of using the rest api as a client… via postman, / js/…etc?, thanks

I see the examples that show up when I create the token, but neither of the js ones are working for me when running from node, nothing comes back,

I think I got it working finally, the url must be https, not http that is shown in some of the examples…