criso / fbgraph

NodeJs module to access the facebook graph api
http://criso.github.io/fbgraph/
1.09k stars 174 forks source link

Error processing request #108

Closed Bezdekm closed 7 years ago

Bezdekm commented 8 years ago

Hi everyone,

I need help with POST request for like a page. I have an web application where user is logged in over facebook login button - The application has permissions for all scopes I need.

I want to add own styled button for LIKE PAGE and I do this:

like() {
    const { user } = this.props.auth;
    graph.setAccessToken(user.accessToken);
    graph.post('/xxxx/likes', function(err, res) {
      console.log(err, res);
    });
  }

and

<button onClick={this.like.bind(this)}></button>

but I only get error:

{
   message: "Error processing request",
   exception: Error: Unsuccessful HTTP response at Request.eval ...
}

Can anyone help me? Thanks!

criso commented 7 years ago

Seems like you're using this on the Client side. This lib is for server side requests. https://developers.facebook.com/docs/javascript - that one is what you need :)