criso / fbgraph

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

? in params gives error #125

Closed LiveLikeCounter closed 7 years ago

LiveLikeCounter commented 7 years ago

When I use a ? in my request I get the following error:

{ message: 'Syntax error "Expected end of string instead of "?"." at character 22: fan_count,name,picture?type=large,cover,is_verified,verification_status,link,new_like_count,best_page',
  type: 'OAuthException',
  code: 2500,
  fbtrace_id: 'FOluL7VpKOa' }

My request looks like:

const params = { fields: 'fan_count,name,picture?type=large,cover,is_verified,verification_status,link,new_like_count,best_page' };
graph.get('/me/accounts', params, function(err, res) {
        console.log(res)
        //saveFacebookPages(res, firebaseID);
        if (err) {
          console.error(err)
        }
      });

Even when I make the following request:

graph.get('/me/accounts?fan_count,name,picture?type=large,cover,is_verified,verification_status,link,new_like_count,best_page, function(err, res) {
        console.log(res)
        //saveFacebookPages(res, firebaseID);
        if (err) {
          console.error(err)
        }
      });

Same result...

LiveLikeCounter commented 7 years ago

Ah, I found it. To get the large picture this have to be: picture.type(large)