Currently the access tokens have an expiration date of 90 days.
The access tokens is for your Spark account, not for a single Core.
As far as I’m aware, the Build IDE will show you your current access token, so if you request a new one, it will replace the previous one.
If you’re the only user of the app, then it probably doesn’t hurt to just store it locally. For added security, you could make use of PHP files to hide it, but that probably isn’t necessary. There is a topic on the forum though, should you be interested.
Does this mean that the replaced token is no longer valid??
Suppose I have a mobile application that I use to control my core. AS you said it expires every 90 days do I need to invoke the spark auth url to create a new token every 90 days or before that??
You need a valid access token to be able to control your Sparks, so it's perhaps best to renew them before they expire, to avoid any problems. Access tokens have been an ongoing discussion for a while, and I believe the nice folks at Spark HQ are looking at ways to improve them.
I don’t remember of an API endpoint that allows you to do so but just query https://api.spark.io/v1/devices and it should say invalid access token if the token has expired
This is a helpful discussion. Can anybody discuss how existing Spark based products (dog feeder, sous vide, etc.) work from a user experience? Are purchasers required to set up an account with Spark? Can the provider of the product manage the entire experience? Thanks in advanced!
This is the kind of info I was specifically reading this thread for. So if someone can elaborate on how to handle things like access codes and IDs in a commercial (i.e.: not sitting on my development bench), I would love to read it.
@MarkSHarrisTX I think the new we just heard from the Spark Team seems to indicate that this will be addressed in the forthcoming Fleet Management functionality. Fingers crossed!