Attempting to Mark multiple entries as Read
TimCadieux opened this issue · 2 comments
I'm attempting to pass multiple ID using the below from the docs
DELETE /v2/unread_entries.json will mark the specified entry_ids as read.
Request{
"unread_entries": [4089, 4090, 4091]
}
Using RestSharp, i'm doing the below....it returns httpCode 200 however the records are not Marked as unread...the josnbody being passed in looks like
{ "unread_entries": [2215599374,2215589372] }
var url = "https://api.feedbin.com/v2/unread_entries.json";
var pwd = "pwd";
var user = "user";
var client = new RestClient(url);
client.Authenticator = new HttpBasicAuthenticator(user, pwd);
var request = new RestRequest(url, Method.DELETE);
string body = "{ \"unread_entries\": [" + ids + "] }";
request.RequestFormat = DataFormat.Json;
request.AddParameter("application/json", body, ParameterType.RequestBody);
return client.Execute<HttpStatusCode>(request).StatusCode;
Hi @TimCadieux,
I'm not sure I'm following. Are you trying to mark entries as read or unread?
To mark as read, you would make a request like:
curl \
--request DELETE \
--user "example@example.com:password" \
--header "Content-Type: application/json" \
--data-ascii '{"unread_entries": [2221429186]}' \
https://api.feedbin.com/v2/unread_entries.json
To mark as unread, you would make a request like:
curl \
--request POST \
--user "example@example.com:password" \
--header "Content-Type: application/json" \
--data-ascii '{"unread_entries": [2221429186]}' \
https://api.feedbin.com/v2/unread_entries.json
Note that one is a DELETE
request and the other is a POST
request.
In general if you could express your examples as curl or raw HTTP, it would be easier to see what is happening and reproduce.
Thanks!
I was mistakenly passing the array of IDs like this
{"unread_entries": ['2221429186']}'