Hi everyone,
I'm trying to figure out which object to pass in the body of this request: https://io.adafruit.com/api/docs/#replace-action. The docs mention the "trigger" object but I can't find it's definition, so I don't know which values and keys I need to pass in i.e. a Postman request.
Anyone an idea? Thanks!
Rob Nickmans
Trigger object
Moderators: adafruit_support_bill, adafruit
Forum rules
If you're posting code, please make sure your code does not include your Adafruit IO Active Key or WiFi network credentials.
If you're posting code, please make sure your code does not include your Adafruit IO Active Key or WiFi network credentials.
- jwcooper
- Posts: 1004
- Joined: Tue May 01, 2012 9:08 pm
Re: Trigger object
We renamed triggers to 'actions' recently, but this isn't a commonly used api endpoint, and it expects the older trigger object yet.
Here are the valid values you can pass:
Formatting would be:
trigger: { feed_id: n, operator: n, ...}
We typically suggest using the UI to manage actions, as the API for this isn't as well documented as it should be yet (the demand has never really been there for making it easier to use).
What is your use case where you're looking to automate this?
Here are the valid values you can pass:
Code: Select all
:feed_id, :operator, :value, :action, :to_feed_id, :action_feed_id, :action_value, :body_template, :subject_template
trigger: { feed_id: n, operator: n, ...}
We typically suggest using the UI to manage actions, as the API for this isn't as well documented as it should be yet (the demand has never really been there for making it easier to use).
What is your use case where you're looking to automate this?
- nickmansrob
- Posts: 3
- Joined: Sat Jan 02, 2021 2:13 pm
Re: Trigger object
Hi
Thanks for supplying me with the details. I'm trying to control the Actions tab of Adafruit IO with an Android app. That way, I can change the values of an action right in the app.
Thanks for supplying me with the details. I'm trying to control the Actions tab of Adafruit IO with an Android app. That way, I can change the values of an action right in the app.
- jwcooper
- Posts: 1004
- Joined: Tue May 01, 2012 9:08 pm
Re: Trigger object
Glad to help.
Also, a great way to see exactly how to handle the API calls is make an create/update/delete to an action in the IO UI, and take a look at the network call in inspector. The IO UI is using the API for everything as well. You can see how the request is built, etc.
Also, a great way to see exactly how to handle the API calls is make an create/update/delete to an action in the IO UI, and take a look at the network call in inspector. The IO UI is using the API for everything as well. You can see how the request is built, etc.
- jwcooper
- Posts: 1004
- Joined: Tue May 01, 2012 9:08 pm
Re: Trigger object
Also, just a heads-up...we're actively working on actions right now and the API calls will likely subtly change. API V2 for the Actions/Triggers isn't really set in stone yet.
Last week we deployed changes to the email action output type that allows custom subject and body templating similar to webhooks.
In the pipeline is action limiters, to control how often they are allowed to fire.
Last week we deployed changes to the email action output type that allows custom subject and body templating similar to webhooks.
In the pipeline is action limiters, to control how often they are allowed to fire.
- nickmansrob
- Posts: 3
- Joined: Sat Jan 02, 2021 2:13 pm
Re: Trigger object
Thank you a lot! I managed it to work, I can implement this now in my app and update it accordingly when the API changes. Thanks for your help and have a great day!
Forum rules
If you're posting code, please make sure your code does not include your Adafruit IO Active Key or WiFi network credentials.
If you're posting code, please make sure your code does not include your Adafruit IO Active Key or WiFi network credentials.