0

URL stopped working (with 404)? send.json
Moderators: adafruit_support_bill, adafruit

Please be positive and constructive with your questions and comments.

URL stopped working (with 404)? send.json

by thayes on Fri Dec 28, 2018 12:29 am

I had been using this endpoint to send multiple feed updates using a single HTTPS GET via parameters in the URL. This worked for a couple years until about 11 hours ago (about noon Eastern on Dec 27th.) Now it returns a "404 Not Found".

The full URL would look something like:

https://io.adafruit.com/api/v1/groups/<key>/send.json?x-aio-key=<blah>&feed_key1=value1&feed_key2=value2&<etc...>

I don't see any announcement about a change, but then again I only ever check the forum when things stop working so perhaps I missed an announcement a year ago that this method was going away?

Do I need to recode all my stuff or is this just a bug on your end that will get fixed? I liked this mechanism because it was easy to code in a shell script with minimal text processing. No need to build JSON or deal with stuffing anything into the BODY of a POST.

thayes
 
Posts: 17
Joined: Mon Apr 04, 2016 5:36 pm

Re: URL stopped working (with 404)? send.json

by DopeBean on Sun Dec 30, 2018 12:13 pm

Same here! Also I can't send any data to feeds anymore... It was indeed a very handy and easy to use code. Please fix it a.s.a.p... Now i need to put the vacuum robot on by hand... sooo lame and so 2017....

DopeBean
 
Posts: 3
Joined: Tue Oct 10, 2017 3:37 am

Re: URL stopped working (with 404)? send.json

by thayes on Sun Dec 30, 2018 12:23 pm

DopeBean wrote:Same here!

I'm sorry you get to join me in my suffering. I'm trying to decide if I want to recode my stuff to use the v2 API or, if I have to recode anyway, switch to a more full-featured service (Google IoT Core looks free/cheapest for my usage pattern.)

I wish adafruit would just reply and say if this is a bug or if they intentionally removed this feature.

thayes
 
Posts: 17
Joined: Mon Apr 04, 2016 5:36 pm

Re: URL stopped working (with 404)? send.json

by jwcooper on Sun Dec 30, 2018 5:31 pm

Unfortunately, we had to remove that single endpoint unexpectedly. This was due to a potential for the endpoint to be improperly used as an attack vector that we discovered in our testing. There was no actual security incident, but we didn't want to leave the endpoint live any longer. This didn't give us any time to announce a sun-setting of this endpoint like we would in a normal scenario. The api v1 is still available, other than this one HTTP GET request with the ability to save data.

I apologize that we weren't able to alert you beforehand.

jwcooper
 
Posts: 666
Joined: Tue May 01, 2012 9:08 pm

Re: URL stopped working (with 404)? send.json

by DopeBean on Mon Dec 31, 2018 7:34 am

So what options are exactly left to send data to a feed? Do you have examples of it? I try to work with the app called Olisto but I'm not sure if sending data to a feed now is still possible with it.

DopeBean
 
Posts: 3
Joined: Tue Oct 10, 2017 3:37 am

Re: URL stopped working (with 404)? send.json

by jwcooper on Mon Dec 31, 2018 11:34 am

I'm not familiar with Olisto, but here is our api documentation with examples:
https://io.adafruit.com/api/docs/

In the header you can click which version you'd like.

Also, here are extensive guides on various ways of using and connecting to Adafruit IO:
https://learn.adafruit.com/category/adafruit-io

If you have specific examples or issues you run into, you can create a new thread and we can try to help you out as well.

jwcooper
 
Posts: 666
Joined: Tue May 01, 2012 9:08 pm

Re: URL stopped working (with 404)? send.json

by rogonzalez on Wed Jan 02, 2019 4:51 pm

Just so that we're clear, you're saying there is no simple solution to this
https://io.adafruit.com/api/v1/groups/<key>/send.json?x-aio-key=<blah>&feed_key1=value1&feed_key2=value2&<etc...>

If this is not the case, can you give a real example of what the above example should now look like.

Thanks.

rogonzalez
 
Posts: 2
Joined: Mon Sep 18, 2017 12:35 pm

Re: URL stopped working (with 404)? send.json

by abachman on Wed Jan 02, 2019 5:54 pm

Hi rogonzalez,


You can use all the same URLs, requests just have to be HTTP POST instead of POST or GET.

For example, if you're using curl to publish data, that would mean:
Code: Select all | TOGGLE FULL SIZE
curl "https://io.adafruit.com/api/v1/groups/<key>/send.json?x-aio-key=<blah>&feed_key1=value1&feed_key2=value2&<etc...>"
becomes:
Code: Select all | TOGGLE FULL SIZE
curl -XPOST "https://io.adafruit.com/api/v1/groups/<key>/send.json?x-aio-key=<blah>&feed_key1=value1&feed_key2=value2&<etc...>"



- adam b.

abachman
 
Posts: 319
Joined: Mon Feb 01, 2010 12:48 pm

Re: URL stopped working (with 404)? send.json

by Ddahl08 on Thu Jan 03, 2019 12:38 am

So what is the url that will still work? Using ajax and want simple. Just starting using adafruit io again and one week later it doesnt work.... Please bring this feature back

Ddahl08
 
Posts: 5
Joined: Mon Jan 23, 2017 4:57 pm

Re: URL stopped working (with 404)? send.json

by abachman on Thu Jan 03, 2019 10:11 am

If you're using an ajax library like fetch() or jQuery's $.ajax() all you need to do is add method: 'POST' to the request options and it will work. If you're using XMLHttpRequest, change your request.open() from request.open("GET", url) to request.open("POST", url).

For example, this page sends a timestamp to two feeds every 10 seconds and shows the results in the console:

Code: Select all | TOGGLE FULL SIZE
<!doctype html>
<html>
  <head></head>
  <body>
    <script>
      var AIO_KEY = "toomanysecrets"

      function reqListener () {
        console.log(this.responseText)
      }

      function sendData() {
        var now = Date.now()
        var url = "https://io.adafruit.com/api/v1/groups/example/send.json?x-aio-key=" + AIO_KEY + "&counter-1=" + now + "&counter-2=" + now
        var oReq = new XMLHttpRequest()
        oReq.addEventListener("load", reqListener)
        oReq.open("POST", url)
        oReq.send()
      }

      setInterval(sendData, 10000)
    </script>
  </body>
</html>



Due to the GET endpoint's ability to be used in redirect based credential stealing attacks, we've turned it off permanently.


- adam b.

abachman
 
Posts: 319
Joined: Mon Feb 01, 2010 12:48 pm

Re: URL stopped working (with 404)? send.json

by rogonzalez on Fri Jan 04, 2019 2:59 pm

Thanks for the example, curl isn't an option in my case as I was hitting using the url directly but I found a work around.

rogonzalez
 
Posts: 2
Joined: Mon Sep 18, 2017 12:35 pm

Re: URL stopped working (with 404)? send.json

by sm on Mon Jan 14, 2019 8:31 pm

This is sad that this is no longer available.
I was using it with an older version of FileMaker that does not allow me to POST using curl. (I can can only GET).
Or at least, I have not figured out how to POST.

Is there any other way to send data to IO using only GET or a web browser's address field?

sm
 
Posts: 7
Joined: Wed Sep 14, 2016 1:56 am

Please be positive and constructive with your questions and comments.