Search code examples
apitrello

Unauthorized notification requested when invoking notifications/all/read in Trello API


I've been doing some tinkering with the trello API and found myself getting stuck with the notifications part of it. In particular, the PUT requests and POST that are about marking notifications read or unread. I have no idea what direction to go in as it's really straightforward,

Javascript request with a post method to https://api.trello.com/1/notifications/all/read?key[mykey]&token=[userstoken]

And yes, I've made sure I have a read write token. Error I'm getting is as follows

key=[mykey]& token=[usertoken]HTTP/1.1 401 Unauthorized X-Powered-By: Express Cache-Control: max-age=0, must-revalidate, no-cache, no-store X-Content-Type-Options: nosniff Strict-Transport-Security: max-age=15768000 X-XSS-Protection: 1; mode=block X-FRAME-OPTIONS: DENY Content-Type: text/plain Expires: Thu, 01 Jan 1970 00:00:00 Content-Length: 37 Vary: Accept-Encoding Date: Tue, 26 Nov 2013 15:00:13 GMT


Solution

  • Try requesting the token with the read,write,account scope. (account is required to modify member notifications)