Problem clear field data

Andrew on 2 Jan 2024 (Edited on 2 Jan 2024)
Latest activity Edit by Christopher Stapels on 3 Jan 2024

I get the following error message when using a DELETE command.
Using: DELETE https://api.thingspeak.com/channels/2392108/feeds.json api_key=xxxxxxxxxxxxxxxx
I am using the correct api_key and channel ID Error Response: { "status": "401", "error": { "error_code": "error_auth_required", "message": "Authorization Required", "details": "Please provide proper authentication details." } }
I just cannot find out what I'm doing wrong. I've used Postman and Curl apps.
Can anyone help?
Andrew
Andrew on 2 Jan 2024
Just tried it from Postmand and it works, now I'm confused,
Checked and all the data has been cleared.
Thank you so much for your help.
Andrew
Andrew on 2 Jan 2024 (Edited on 3 Jan 2024)
FYI I have no problem issuing the two commands below with Curl of Postman:
curl -v --request GET https://api.thingspeak.com/channels.json?api_key=xxxxxxxxxxxxxxxx
curl -v --request GET https://api.thingspeak.com/channels.json?api_key=xxxxxxxxxxxxxxxx
Andrew
Andrew on 2 Jan 2024 (Edited on 2 Jan 2024)
Thank you for your prompt response Christopher but I am aware of thet issue.
This is the command as defined on the ThingSpeak webpage
api_key=xxxxxxxxxxxxxxxx
Here is the API key from the My Profile Page
API Keys
User API Key
xxxxxxxxxxxxxxxx
Alerts API Key
<no API key>
and here are my read and write keys
Write API Key
Key
xxxxxxxxxxxxxxxx
Read API Keys
Key
xxxxxxxxxxxxxxxx
I know I must have missed something obvious but I cannot spot it after trying all day :-(
Trust you can show me the error of my ways.
Thank you
Andrew
Christopher Stapels
Christopher Stapels on 2 Jan 2024
Thanks for the clarification. Can you try this format with the '?' ?
Christopher Stapels
Christopher Stapels on 2 Jan 2024
I suspect you are using the channel API key, but delete operations require the User API key.
See the Clear Channel API page for details, especially the note in the body parameters section.
Ive redacted your API key for security though.
Andrew
1
Post
3
Replies