HTTP/1.1 301 Moved Permanently when using REST API

Hi Guys,

We’re trying to something very simple but are having trouble finding the correct way via the REST API.

We want to post a time-stamp to the cloud and have multiple DASH devices on our remote sensor nodes (4-6 of them) retrieve that time-stamp. It’s used for some housekeeping etc…

I have been through the docs @ http://docs.konekt.apiary.io but cannot figure this out. I was assuming that I could use curl to retrieve the time-stamp data but every URL I tried sends me back a “HTTP/1.1 301 Moved Permanently” response. It’s surely possible (probable) that I am interpreting the docs wrong…

So, does anyone have a procedure like this or know where to find the docs for all endpoints with some real examples.

-rock

Hi Rock,

You might be receiving that Moved Permanently redirect if you are attempting to connect via HTTP instead of HTTPS. Our API only allows connections to be made over HTTPS, and the 301-redirect is used to help prevent clients from accidentally leaking sensitive information if they are misconfigured to use HTTP instead of HTTPS.

All the best,
PFW

Also, I updated some spots in the docs that may not have clearly reflected that. Hope that helps!

Thank you Pat! That was it.
Also remembering that I need to include the sesskey on every call? is that right? lots of the examples do not include it.

-rock

Hey Pat,

forgot a questions…

Is there a way to broadcast SMS to an entire group of devices?

Also, I note the ‘https://dashboard.konekt.io/api/1/sms/incoming’ endpoint requires a device ID, is that the name of the device?

-rock

Hey @rscavetta,

Yes, there is a way. I just updated that section of the documentation to reflect our newly-added support for arrays of deviceids.

It’s not the name of the device, but the ID of the device. If you login to the Dashboard and click on a particular device, you will see the deviceid in the URL within your browser. You can also see a list of devices, along with their ids, by making a GET request to the https://dashboard.konekt.io/api/1/devices/ call.

Hope this helps,
PFW

As for the sesskey, you will need to include session information in one way or another on all calls. That’s the simplest way, but there is also an HTTP BASIC AUTH way of doing it, as well as using session cookies (like when negotiating sessions between a web browser and a web server).

That all being said, the most straight-forward way is to include the sesskey variable or to use the HTTP BASIC AUTH method, if you’re developing something in a back-end service!