Skip to content
This repository has been archived by the owner on Jan 11, 2025. It is now read-only.

Unable to get value data in IFTTTT #3

Open
cgkades opened this issue Mar 13, 2022 · 1 comment
Open

Unable to get value data in IFTTTT #3

cgkades opened this issue Mar 13, 2022 · 1 comment

Comments

@cgkades
Copy link

cgkades commented Mar 13, 2022

payload = {'value1': value1, 'value2': value2, 'value3': value3}

I've been trying to get home assistant (which imports this module) to send json data to IFTTT and it's not working correctly. Looking at their docs to get anything usable besides the event name (I could be wrong), you need to send it a different way

https://help.ifttt.com/hc/en-us/articles/4405029291163-Parsing-JSON-body-with-filter-code

Basically

Note that the URL for the [Webhooks - Receive a web request with a JSON payload](https://ifttt.com/maker_webhooks/triggers/json_event) trigger is in a slightly different format than the regular IFTTT Webhook URL (https://maker.ifttt.com/trigger/{event}/with/key/{key} vs https://maker.ifttt.com/trigger/{event}/json/with/key/{key}).

If the URL of your web request does not include /json/ as above, the {{JsonPayload}} ingredient will be empty:

So it looks like this should have the /json/ path added if the intention is to be able to use any values

url = 'https://maker.ifttt.com/trigger/{e}/with/key/{k}/'.format(e=event,

@cgkades
Copy link
Author

cgkades commented Mar 13, 2022

I modified the line locally to:

    url = 'https://maker.ifttt.com/trigger/{e}/json/with/key/{k}/'.format(e=event,
                                                                     k=api_key)

I've verified that I'm able to get the json data in IFTTT with this.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant