Salama
Salama

Reputation: 65

Facebook Graph OAuthException - #2500 Unknown path components error when fetching page posts

{
"error": {
"message": "Unknown path components: /$PAGE_ID,
"type": "OAuthException",
"code": 2500
}

I got the error above after trying to fetch a page posts using C# Facebook SDK 7.0.6

Here is my Request.

var downloadPostsTask = fb.GetTaskAsync(@"/" + PageId + @"?fields=posts{type,description,name,full_picture,source,caption,link,status_type,message}", ctsToken);

and

var downloadPostsTask = fb.GetTaskAsync(PageId + @"?fields=posts{type,description,name,full_picture,source,caption,link,status_type,message}", ctsToken);

both are resulting same error

How to solve this problem? I tried to search but it doesn't work at all.

Upvotes: 0

Views: 3009

Answers (1)

Salama
Salama

Reputation: 65

I solved the problem by explicitly specifying Graph API Version in the Facebook object

var fb = new FacebookClient
                {
                    AccessToken = token,
                    IsSecureConnection = true,
                    Version = "v2.6"
                };

Upvotes: 1

Related Questions