403 Error while trying to retrieve Reddit User's saved posts using JRAW

229
February 04, 2018, at 09:01 AM

I'm currently trying to get a users saved posts using the JRAW reddit api wrapper using this code:

val helper = App.get().accountHelper
val paginator = helper.reddit.me()
                    .history("saved")
                    .build()
val saved = paginator.next()

Context for App class

Which always results in a 403 - Forbidden. I log in and get the oauth token by using JRAW-Android new user example then switch to the user accountHelper.switchToUser(userName) which shows the account is authenticated..

Any ideas why i'm not able to authenticate?

Answer 1

Didn't realize Reddit had scopes. I had to add the history scope to the strings array when requesting getAuthorizationUrl

String[] scopes = new String[]{ "read", "identity", "account", "save", "history"};
String authUrl = helper.getAuthorizationUrl(requestRefreshToken, useMobileSite, scopes);
Rent Charter Buses Company
READ ALSO
Run wifi p2p app in online devices

Run wifi p2p app in online devices

My question is near this question: how to run wifi peer to peer application in android emulator?

236
Restrict the Firebase Database to accept only unique email IDs on Android

Restrict the Firebase Database to accept only unique email IDs on Android

I have a list of authenticated users and I want the Firebase to accept email ID only if that email ID isn't in use or does not exist in my Firebase Database

196
How to communicate between an Activity and Service in Android?

How to communicate between an Activity and Service in Android?

We have two apps: My Android app that I developed and the Facebook appAlso, I have an Android Service that is implemented inside my app, and it does the following: It keeps listening and once it receives a message from a client (i

247
How to get one value from sqlite database android? [duplicate]

How to get one value from sqlite database android? [duplicate]

This question already has an answer here:

218