3

We are using restFB 1.6.12 and I get this error while trying to access the FB end point searching for messages. This is happening for an OAuth token which was recently created and also for older ones.

If I search friendsCount, publicEvents seems to work properly. But I search publicMessages, it doesn't work throws an error.

com.restfb.exception.FacebookOAuthException: Received Facebook error response of type OAuthException: (#200) Must have a valid access_token to access this endpoint
    at com.restfb.DefaultFacebookClient$DefaultGraphFacebookExceptionMapper.exceptionForTypeAndMessage(DefaultFacebookClient.java:766)
    at com.restfb.DefaultFacebookClient.throwFacebookResponseStatusExceptionIfNecessary(DefaultFacebookClient.java:688)
    at com.restfb.DefaultFacebookClient.makeRequestAndProcessResponse(DefaultFacebookClient.java:630)
    at com.restfb.DefaultFacebookClient.makeRequest(DefaultFacebookClient.java:592)
    at com.restfb.DefaultFacebookClient.makeRequest(DefaultFacebookClient.java:556)
    at com.restfb.DefaultFacebookClient.fetchConnection(DefaultFacebookClient.java:219)

How do I resolve this issue?

AVM
  • 243
  • 3
  • 8

1 Answers1

0

I'm not familiar with this facebook library and it's OAuth authentication but as the error says you don't have a valid access_token. Did you acquire one from facebook (https://developers.facebook.com/docs/facebook-login/access-tokens/)?

Do you need an oauth access token to access the publicEvents? if you do is that access token only valid for the plublicEvents and do you need an other for publicMessages.

Sorry I can't give you a straight answer but may these suggestion will help pointing you in the right direction.

ceasaro
  • 595
  • 6
  • 11