PUT HTTP Request Troubleshooting

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.
Locked
User avatar
Spencer_Textile
 
Posts: 14
Joined: Sun Dec 16, 2018 2:57 pm

PUT HTTP Request Troubleshooting

Post by Spencer_Textile »

Okay. I'm sorry that this has probably been answered a zillion times, but I'm stumped here.

I am trying to use the http request module in Integromat to update an AIO feed.

I'm using a PUT request to https://io.adafruit.com/api/v2/{user name}/feeds/{feed_key}

Raw Body type/JSON with this body:

Code: Select all

{
"value":1
}
I literally just want to send a value of 1 to the feed when my http request is triggered by another process.

I keep getting a 400 response: {"error":"request failed - feed parameter is required"}

Not sure what else I could be doing.

Any ideas?

User avatar
jwcooper
 
Posts: 1004
Joined: Tue May 01, 2012 9:08 pm

Re: PUT HTTP Request Troubleshooting

Post by jwcooper »

Try this endpoint:
https://io.adafruit.com/api/docs/#create-data

POST https://io.adafruit.com/api/v2/{usernam ... _key}/data

That will create a new data value for your feed. Each feed has multiple points of data. There is a way to make a feed only have a single point of data by turning off history for that feed. Then, any time you create data for that feed, it will just replace the same data point.

If this doesn't solve it, let us know with more details on what you're trying to do.

The endpoint you're currently using would simply update the settings for a feed, such as if you want to turn off the history.

User avatar
Spencer_Textile
 
Posts: 14
Joined: Sun Dec 16, 2018 2:57 pm

Re: PUT HTTP Request Troubleshooting

Post by Spencer_Textile »

Of course.

So sorry. I just misread the documentation. I was trying to update the feed, not the data. What I was doing made sense to me at the time, but now I don't know why I thought that. Oh well.

I implemented the correction. Worked perfectly.

I hope I can get through the rest of the project without too much help. I only touch this stuff every 2 years or so, and I tend to forget everything I learned.

Thanks much,

Locked
Forum rules
If you're posting code, please make sure your code does not include your Adafruit IO Active Key or WiFi network credentials.

Return to “Internet of Things: Adafruit IO and Wippersnapper”