Is there an easy way how could I allow other users to send http request (to get some data from my imp) without letting them know my imp key?
I can imagine some hard ways like saving the data from imp to some cloud like firebase and then other people could send request to that firebase stored value, but is there something more easier?
I would like to share data from sensors on my Imps on websites, but I don’t want to share my key and also I want scalable solution.
Just to clarify: I meant imps agent url, imp key is probably something different.
No - at least not without a layer on top of your agent (like Firebase, or some other server) as you mentioned.
Commercial products get around this (at least in terms of scale) by using the BlinkUp SDK. Once BlinkUp is complete, it essentially returns the agentURL for the device (along with some other information) that is typically cached and used later for making requests to the device.
You could add some security into your API so that anyone can read from the imp (or read specific bits of information), but to do anything else they need to provide an API Key, username/password, etc…
I found answers here:
But I still welcome any new suggestions.
I will probably just add the password and I will make function for setting whether the sensor values are public (can be viewed without password) or private (only with password). Also function for setting new password.
Problem is what shoud I do when user forget his password?
Is it easy to send email with agent?
Yes! Here’s a thread that shows how to send emails with the MailGun API.
Thanks for that information. I will definitely use it.
I have another question. How can the user easily find his agent url?
Is agent url unchangeable?
There isn’t a super simple way for a user to find their agent url (other than logging into the ide). Some of this will be made a little easier to automate once our IDE API is released…
The agent url shouldn’t change for a particular developer device on an account (if the account changes, the agent url will change).
It sounds like you might be building something you plan on selling? A lot of the things you’re looking to do is made a lot easier with the tools we expose for our customers - let me know if you want some more information on those.
Yes, I am planning to sell something and would be glad for informations.
Generaly: My idea is selling the imp with included paper with written agent url so user then can wrote “agent code” to my web app as a start for controlling the device (and set the password, email etc.). Is that possible? Or some even easier way?
Using the setup you’re talking about is likely a bit more complicated than you’ve realized (because they need to configure the device to their WiFi).
You’ll need to either create a separate account for each device, or have all of the devices in a single account. The user will need to go download the Electric Imp app, sign in with the account credentials you’ve assigned them, and then BlinkUp… if all your devices are on a single account then they’ll have access to that account and do bad things (which is why you’ll likely want to create a new account for every user).
The BlinkUp SDK makes this much easier. It lets you integrate BlinkUp into a mobile app (and doesn’t require the user to login with Electric Imp credentials). The BlinkUp SDK can return information like the agentURL - so that you can easily make requests to the agent from the app (meaning the app could be the main place you get information).
If you send an email to email@example.com they can provide you some more information about how all the commercial bits fit together to make a good experience!
It’s great that blinkup can return the agent url, that’s much easier then my solution.
Is the agenturl unchangeable once user use blinkup for the new imp?
I already contacted sales before but they didnť provide me with such informations (just sheet of prices), so I am going to write them again. Thanks!
If you’re using the BlinkUp SDK, the url can change (this is intentional, so that if I sell my imp-powered device to someone else the URL will change).
Lots more information here (if you haven’t seen out relatively new BlinkUp SDK docs yet): http://electricimp.com/docs/manufacturing/sdkdocs/
Ok, but if I want agent url not to change (at least until new user use it), is it possible?
Great. Thank you very much for all your answers! I am much closer to understand whole process.