What is the url to a Facebook open graph post?

前端 未结 5 711
醉话见心
醉话见心 2020-12-28 17:40

Given a post id returned by a graph search, for example: 186173001411937

is there a url to link to the post in facebook? The following url does not work: http://www.

5条回答
  •  长发绾君心
    2020-12-28 18:05

     public getPagePosts(string pageId, string access_token, int limit)
            {
                var client = new RestClient("https://graph.facebook.com");
                var request = new RestRequest(Method.GET);
                var fields = "posts{permalink_url,picture,message,story,created_time,id}";
                request.Resource = "{version}/{object_id}/";
                request.RequestFormat = DataFormat.Json;
                request.JsonSerializer.ContentType = "application/json;";
                request.AddParameter("access_token", access_token);
                request.AddParameter("version", "v2.10", ParameterType.UrlSegment);
                request.AddParameter("object_id", pageId, ParameterType.UrlSegment);
                request.AddParameter("limit", limit);
                request.AddParameter("fields", fields);
                var response = client.Execute(request);
                var result = JsonConvert.DeserializeObject(response.Content);
                return result;
            }
    

提交回复
热议问题