Private channel access via URL?

Thomas Lowell le 18 Jan 2024
Dernière activité Réponse par Thomas Lowell le 22 Mar 2024

I'd like to give someone quick access to a private channel via a URL. Basically, I'd like to place a QR code sticker on the device so that any time they want, they can quickly check out how the device data is trending by pointing their cell phone camera at the QR code and clicking. Ez-peezie. This works with a public channel because no authentication is required,
Is there a way to do this with a private channel? I was hoping I could add their email address to the sharing tab for the channel and then, after they had logged into Thingspeak on their phone with their own account, perhaps their browser state would be retained and when the camera launched a browser tab with the url, it would work. But alas, I've probably over-simplied the credentials aspect betwen the camera app and the brower app. At least it doesn't seem to work with Safari or Chrome on IOS.
Does anyone know of an easy way (easy for the end user) to make this work?
Thomas Lowell
Thomas Lowell le 21 Mar 2024 (modifié(e) le 21 Mar 2024)
Hi Christopher,
I'm wrapping up my implementation of this approach and would appreciate double-checking my understanding of "sharing via email address "with you..
I initally thought that the "Share channel view only with the following users:" functionality in the "Channel Sharing Settings" on the "Sharing" tab of the web UI was only useful if the user was logged into the web UI and browsing to the shared channel. But while testing some use cases in order to write this note I realized the grantee (the user who's emai address is listed in the sharing tab) can view charts via a URL if they're logged in (and they'll be prompted if to log in they aren't)
Select users can view this chart with out an API key if shared with their email.
So, regarding to my idea of putting a QR code sticker on my device that points to the ThingSpeak data; It seems I have to chose between two options:
(a) create the QR code based on a url that shares to a specific user. The downside is they'll have to log in, or be logged and they'll only be able to see one chart per QR code because access is only hru the chart API, or...
(b) create the QR code based on a url that includes an API key. While the user won't have to log in, or be logged in, the downside is that anyone can see the chart (although using a second read key, I can easily invalidate the key if this becomes and issue). And again, they will only be able to see one chart per QR code.
Does that sound right? Is there any way to view all fields charts at once via a url on a private channel like one can for a public channel?
thanks!
Christopher Stapels
Christopher Stapels le 22 Mar 2024
II think you've spelled it out pretty well.
There is another post where Vinod describes how to share plots ona google dashboard. You might be able to use that or some other dashboarding service to share multiple plots, but of course that adds some complexity. You could even host your own page with the plots on it. I do that for my duck house controller project.
You can use MATLAB visualizations to build charts with multiple tiles in them, and then share that as a dashboard using the API key method you described.
I think b is your best option.
Thomas Lowell
Thomas Lowell le 22 Mar 2024

okay, yeah I was thinking of an approach to generate a page on the fly that combines 3 or 4 ThingSpeak charts. I think might have even seen an example of such a page in the doc. I'm going to just keep it simple for now because I don't know if my users will even use the functionality.

so for now, I'm going to go with: (1) private channel (2) second read api key for the qr code sticker on the case (3) still add user's email to the device channel sharing tab and encourage them to create an account and view their complete set of data.

I think that'll be good enough for field test.

thanks for the quick response!

Christopher Stapels
Christopher Stapels le 19 Jan 2024 (modifié(e) le 8 Fév 2024)
Use the charts API to create a URL for the plot of interest, and embed the Read API key in the URL for the QR code. Anyone who sans the code can see the plot, but you can revoke the read API key anytime you need to. You can also create multiple read API keys for the channel and revoke specific users credentials when needed.
As an example, the attached QR code should take to to a photo of my plant (actually it may have been your plant at one point). Its public, but you can embed the read API key into the URL for a private plot.
Thomas Lowell
Thomas Lowell le 8 Fév 2024
This will work perfectly for my use case Christopher. And by using multiple read API keys, I can use one read key in my code and one for the sticker, lessening the likelihood of having to revoke and update the code if the sticker read key needs to get revoked. Nice. Thanks!
Thomas Lowell
Thomas Lowell le 8 Fév 2024
Hi Christopher,
Just wanted to circle back and thank you for your reply. I hope to give this a try in the next day or two.