[APP][Pro] Webhook.manager

Support topic for the app Webhook Manager

After installing the app, go to the ‘Settings’ page and see the Webhook Manager settings. It shows the URL you can POST to and example code in PHP with the correct URL for your installation.

For example, in PHP using CURL:

<?php
	$data = array("event" => "MyEvent", "data1" => "test1", "data2" => "test2", "data3" => "test3");                                                                    
	$data_string = json_encode($data);
	
	$ch = curl_init('https://webhooks.athom.com/webhook/57274085acb3bd6d24b3d200/?token=YOUR_TOKEN');
	
	curl_setopt($ch, CURLOPT_CUSTOMREQUEST, "POST");                                                                     
	curl_setopt($ch, CURLOPT_POSTFIELDS, $data_string);                                                                  
	curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);                                                                      
	curl_setopt($ch, CURLOPT_HTTPHEADER, array(                                                                          
	    'Content-Type: application/json',                                                                                
	    'Content-Length: ' . strlen($data_string))                                                                       
	);                                                                                                                   
	                                                                                                                     
	$result = curl_exec($ch);
	
	var_dump ($result);
?>

In a web browser:

https://webhooks.athom.com/webhook/57274085acb3bd6d24b3d200/?token=YOUR_TOKEN&event=MyEvent&data1=test1&data2=test2&data3=test3

Linux command line (using curl):

curl -d '{"event":"MyEvent","data1":"test1","data2":"test2","data3":"test3"}' -H "Content-Type: application/json" https://webhooks.athom.com/webhook/57274085acb3bd6d24b3d200/?token=YOUR_TOKEN

Please notice that all fields (event, data1, data2, data3) as well as the token field (replace YOUR_TOKEN) are required.

1 Like

Please note that the current 0.2.6 version has problems. A fix for this is on its way.

Hi,

i am trying to call webhook but my flow is not triggered.

From postman i am calling following request:

POST https://webhooks.athom.com/webhook/xxxxxxxxxx/?token=yyyyyyyy HTTP/1.1
Content-Type: application/json
Host: webhooks.athom.com
Content-Length: 88

{“event”: “testEvent”, “data1”: “testData1”, “data2”: “testData2”, “data3”: “testData3”}

Getting response 200, and it returns “ok” in body, but flow is not triggered.

Flow definition:

Homey Firmware version: 7.1.6

Any ideas what is wrong?

Thanks,
Michal

@Jorden, Can you explain what the advantage of this app is over the standard webhooks provided by Athom? Those also allow for parameters to be sent.

Currently: none. I think the builtin webhooks can completely replace the Webhook.manager functionality.

At the moment I built the app, these functions weren’t available yet. I might ask Athom to remove the Webhook.Manager app from the store, meaning there will be no more updates to it but current installations remain available.

2 Likes

Hey
i believe that in ur script, this: 57274085acb3bd6d24b3d200
should be replaced by my athom cloud id, right?
but what is the token? how to find it?

It mustn’t be replaced. You need to install the app, go to the settings page of the app in Homey, all is explained there.

not everything, i cannot find the explaination of how to find that token.

There is an input field at the top and bottom of the settings page, that contains the full URL including the token.

You can also find it a little bit lower in the PHP code.

oh!! those are already mine?
but why is the first mentioned id the same as yours? 57274085acb3bd6d24b3d200

Yeah that’s correct!

The first is one refers to the Athom Cloud Webhook that is “mine”; that takes care of the server side handling of the webhook at the Athom servers. The code I placed on the Athom server makes sure that the call/data will be redirected to your Homey, according to the token that is unique for your Homey installation.

hummm, oke… then i don’t understand why it is not working. i will figure it out then.
thnx for fast support.

Make sure to mention all variables in the URL, even if they are empty. That might help.

Would you be willing to update this app to SDKv3 as well, @Jorden?
I find this app very usefull for easy webhook usage….

It’s on my todolist for my days off in december (between Christmas and New year’s eve), together with the mail-app, Telegram app and LG Hombot app.

The Webhook app is the least work so might put that one at the top of the list.

4 Likes

Great!
Thanks @Jorden!

Does anyone know what will happen when I migrate to my new Homey 2023 and install an updated app some time after?
Will the flows that the updated app concern repair automagically?

I understand it depends on how Athom is implementing migration, but the bottleneck seems to be Zigbee.
How about repairing devices and flows that do kot already have a SDK v3 version of it’s app?

Hi,

Will the Webhook.manager be available for the Homey Pro 2023?

Regards,
Vincent

@Vincent_Ducate See two posts UP !

2 Likes

Athom writes in it’s latest blog:
“The fine print here is the exception of any apps still using SDK v2 at time of migration. However, once such an app has been updated to SDK v3, you can then install the app, and your previous settings will still be there.”
So good news, there!
But having an upde before is always better of course. Did you fine some time yet, @Jorden?
:+1: :smiley:

I have updated the first app (Telegram Bot) to SDK v3 but still need to release it to the appstore. Sadly had to make some big changes to keep the ‘shared’ bot save so this took some extra time.

I am planning to do the ImageGrabber next, because I think the combination ImageGrabber-Telegram is used often and doesn’t work so stable with the SDK v3 update of Telegram and the SDK v2 version of ImageGrabber.
The WebhookManager and Mail-app are next.

4 Likes