Error 401 Matlab Analysis | ThingSpeak Apps | Forum

The ThingSpeak community site has been upgraded to a new site. This site is currently in read-only mode. You can ask questions or post and read discussions on the new site.

Lost password?
Advanced Search

— Forum Scope —

— Match —

— Forum Options —

Minimum search word length is 3 characters - maximum search word length is 84 characters

sp_Feed sp_TopicIcon
Error 401 Matlab Analysis
No permission to create posts
December 15, 2020
10:58 am
New Member
Forum Posts: 1
Member Since:
December 15, 2020
sp_UserOfflineSmall Offline

I am trying to use this app to clean the channels, I found this code:

ChannelID = "MY Channel
I've already changed it"
UserAPIKey = "My API
I've already changed it"
url = sprintf('',num2str(ChannelID),UserAPIKey)
response = webwrite(url, weboptions('RequestMethod','delete'))

Which supposedly does but at the time of making it work gives me the following error:

Error using matlab.internal.webservices.HTTPConnector/copyContentToByteArray (line 373)
The server returned the status 401 with message "" in response to the request to URL

Error in readContentFromWebService (line 46)
byteArray = copyContentToByteArray(connection);

Error in webwrite (line 139)
[varargout{1:nargout}] = readContentFromWebService(connection, options);

Error in Custom (no starter code) 1 (line 4)
response = webwrite(url, weboptions('RequestMethod','delete'))

My channel is public, so it should not be due to any access restriction.Yell

December 16, 2020
6:10 pm

Forum Posts: 885
Member Since:
March 7, 2017
sp_UserOfflineSmall Offline

FYI, MATLAB answers is the preferred location for ThingSpeak Community support.

Looks like you have the format correct.

Clearing and deleting both private and public channels requires the user API key, so the access restriction is the same in both cases. Are you using the user API key or the write API key?

Forum Timezone: America/New_York

Most Users Ever Online: 166

Currently Online:
33 Guest(s)

Currently Browsing this Page:
1 Guest(s)

Top Posters:

rw950431: 272

Vinod: 240

piajola: 95

turgo: 70

vespapierre: 63

Adarsh_Murthy: 62

Member Stats:

Guest Posters: 1

Members: 8665

Moderators: 1

Admins: 2

Forum Stats:

Groups: 3

Forums: 14

Topics: 1600

Posts: 5760

Newest Members:

kusmumichael, petersmith99, Rambant, blakeharriss09, optisol, Niyonzima Fils

Moderators: cstapels: 460

Administrators: Hans: 405, lee: 457