Why is the Graph API for querying a group URL simply returning the group ID?

71 views Asked by At

When I GET /{group-id}?fields=link I get just get back {group-id}, rather than a full URL like in the case of /{album-id}?fields=link, /{photo-id}?fields=link, etc. Sample request and response for a group:

GET /v2.5/1685218945065439?fields=link
{
  "id": "1685218945065439"
}

whereas an album looks like this:

GET /v2.5/1685219628398704?fields=link
{
  "link": "https://www.facebook.com/media/set/?set=oa.1685219628398704&type=1",
  "id": "1685219628398704"
}

According to the docs link is a valid field on the Group object. I'm using a token that has user_managed_groups. I see the same result when querying OPEN and CLOSED groups.

Just looking at the URLs of my groups by loading them in my web browser, I see that they all use the format https://www.facebook.com/groups/{group-id}/, so it's easy enough to build a URL from the {group-id}, but is that URL format something I can actually count on?

Using Graph API v2.5.

2

There are 2 answers

0
mgalgs On BEST ANSWER

I filed a bug report to which the Facebook team responded that this is the intended behavior (also noted by Bjorn in his answer). See Bjorn's answer for more details.

The good news is that, according to the Facebook dev on that bug report, the format of the Group URL will always be https://www.facebook.com/groups/GROUP_ID, so there's really no need to query the API for the Group URL anyways.

1
Björn Kaiser On

This is a field that is kept around for historical reasons. Back in the day you were able to actually set a website for a group, for example https://example.com.

This functionality has since been removed from the UI on facebook.com but the field in the API is present as older groups might have this value set, but newer groups won't have it anymore.

There has been a bug report about this as well which has been closed as 'By Design' for the reasons mentioned above https://developers.facebook.com/bugs/1495489670770155/