Webhook register example needed

Okay. I was able to get my personId and request all of the types of webhooks available, but I’m not clear on how to register a webhook. I would like to register so I can capture weather intelligence notifications (in my Smart Home Server - HomeSeer). From what I could decipher in other posts it looks like I should use a domain for the URL (I do have my own domain) and I have a reverse proxy server setup on my network to forward all traffic from port 443 (the only port open externally). Can someone please post an example as to how I can register a webhook?

Thanks!

There is some documentation here (official readme.io link), but it’s definitely unclear.

To summarize you need to make a POST request to https://api.rach.io/1/public/notification/webhook

Within said request you need to be sure to have several headers:
“Authorization: Bearer {your API key}”
“Content-Type: application/json” (that’s what you will be sending with your POST request

Now the contents of your post request should have a JSON string that looks something like this:

{“device”:{“id”:“2a5e7d3c-c140-4e2e-91a1-a212a518adc5”}, “externalId” : “external company ID”, “url”:“https://www.mydomain.com/another_webhook",“eventTypes”:[{“id”:“1”},{“id”:"2”}]}

device.id you can lookup via static requests, first to your person/info, where you’ll get your id
than to person/{id} where you’ll get all of your devices along with their ids, that’s id you want to use in webhook request

To know which even types are available for your account, you’ll also want to make a reuqest to event type endpoint (example here), you’ll need only your API key for that and those type id(s) will be passed along to the service during webhook registration.

externalId is just a memo for your own use. This way you may be able to route data in your own code.
url is the url of your webhook. You could use IP in lieu of a domain, but urls tend to work better with remote proxies. Data doesn’t have to go to port 443 (https), it can be on any valid port, just append it via http(s)://(url/ip):port/ You can also include username:password for basic auth in front of url.

That said, unfortunately rachio doesn’t push weather data to webhooks. You’ll be able to get a notification when weather has caused your schedule to skip for example, but not really any granular weather data. To know all of the data available via a webhook, you can check here:

Webhook types and sample JSON (readme.io)

Thanks Gene! I really appreciate the time you took to lay out an example. I haven’t been home or time these past few days, but when I get home, I’ll give it a try. Thanks!

Okay. I was able to finally get to this. Thanks to your advise Gene, I was able to register webhooks and confirm they are registered. I created a URL: "www.mydomain.com/rachio_webhooks

Where “mydomain” is a redaction of my personal domain I use. My next question is what do I do to receive the info? I assume I would setup a reverse proxy (which is currently setup on my server for 443). So I would do the following:

www.mydomain.com/rachio_webhooks:443 > 192.168.1.35:80 (My SmartHome Server)

But what would I do to capture the webhook? Would I use the www.mydomain.com/rachio_webhooks path in my HomeSeer server? Thanks!