Channel ID doesn't matter during upload data

2 次查看(过去 30 天)
Hi,
I'm working with ESP32 (Arduino IDE) and I noticed that the Channel ID doesn't matter during upload data.
I use ThingSpeak.writeFields() function and I can use any number as Channel ID to do a success upload.
The API Key is important because when I modify it the upload will be unsuccess. Then why I have to give the Channel ID in ThingSpeak.writeFields() function?
ThingSpeak.setField(1, field1);
ThingSpeak.setField(2, field2);
int x = ThingSpeak.writeFields(myChannelNumber, myWriteAPIKey);
I have found a description about Channel ID next below. Does it mean the Channel ID is used only to read data from the channel?
"Channel ID: Auto-generated ID of your unique channel. Your application uses this ID to read data from the channel. You cannot change its value."
I think for security reason it would be much sefer to use Channel ID and API Key together to upload data. Am I right ?
Thanks,
Br.
Istvan

采纳的回答

Christopher Stapels
Christopher Stapels 2019-11-13
You are correct. It is better for security reasons to provide both the API key and channel ID. Additionally it makes tracking your code easier. For example, I have several devices writing to different channels. It is hard to look up the channel by API key, but you can use the channel ID to easily find the channel in your ThingSpeak account.

更多回答(0 个)

社区

更多回答在  ThingSpeak Community

类别

Help CenterFile Exchange 中查找有关 Write Data to Channel 的更多信息

产品

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by