Emilis
Emilis

Reputation: 162

Facebook graph how to set parameters for picture?

I want to get user picture URL, but instead i get image download. In facebook developer guide It says to set redirect parameter to 0 but i don't know how to set parameters in graph, i tried it in JavaScript to but i still get picture downloaded not the URL any example, how to set parameters?

Here is what i tried:

/me?fields=id,name,picture?redirect=0

It returns syntax error.

The simple request returns image download

me?fields=id,name,picture

This is the example result:

"picture": {
    "data": {
      "height": 50,
      "is_silhouette": false,
      "url": "https://platform-lookaside.fbsbx.com/platform/profilepic/?asid=3008732859171455&height=50&width=50&ext=1587125741&hash=AeSgpchLcdbLL1Mt",
      "width": 50
    }
  }

Upvotes: 0

Views: 470

Answers (2)

Andres Gonzales
Andres Gonzales

Reputation: 1

"data": {
      "height": 100,
      "is_silhouette": false,
      "url": "https://scontent.fjal3-1.fna.fbcdn.net/v/t39.30808-1/380700650_10162533193146729_2379134611963304810_n.jpg?stp=dst-jpg_p100x100&_nc_cat=1&ccb=1-7&_nc_sid=5f2048&_nc_ohc=6_TLKrwbOEoQ7kNvgGOt_vu&_nc_ht=scontent.fjal3-1.fna&edm=AKsJ254EAAAA&oh=00_AYBy4X-vLeh04u0jVyOFckZavrh4ygToqBVnQ4a8ug3Q9g&oe=666D9E4E",
      "width":

Upvotes: 0

andyrandy
andyrandy

Reputation: 74014

/me/picture would be the correct endpoint, or /me/picture?redirect=false if you do not want to redirect.

Source: https://developers.facebook.com/docs/graph-api/reference/user/picture/

Upvotes: 1

Related Questions