Home > database >  How to include Group cover photo in Group Info Endpoint on Facebook Graph API
How to include Group cover photo in Group Info Endpoint on Facebook Graph API

Time:07-14

I have the following endpoint to retrieve the details of a Facebook group via its id

let groupInfoUrl = `https://graph.facebook.com/${group_id}?access_token=${accessToken}`;

Below is an example of the response I got:

{
  "name": "Group Name",
  "privacy": "OPEN",
  "id": "012345678901234"
}

How can I make the response to also include the Group Cover photo or icon?

Thank you.

CodePudding user response:

You just have to add fields=cover to your query:

let groupInfoUrl = `https://graph.facebook.com/${group_id}?fields=cover&access_token=${accessToken}`;
  • Related