0

When I use postman application or Graph API explorer then i get complete information or all fields of posts as explained in https://developers.facebook.com/docs/graph-api/reference/v2.0/post

enter image description here

I have not use fields attribute in above image even then it is showing all fields so i am looking for the answer to pass field attribute in query string.

But when i use SDK i get only 3 fields created_time, id and message, please refer following image:

enter image description here

Kindly tell how to get all fields of the posts using facebook sdk c#?

Sundar Singh
  • 654
  • 5
  • 15
  • Possible duplicate of [Facebook JS SDK's FB.api('/me') method doesn't return the fields i expect in Graph API v2.4+](http://stackoverflow.com/questions/32584850/facebook-js-sdks-fb-api-me-method-doesnt-return-the-fields-i-expect-in-gra) – CBroe Jul 20 '16 at 14:16
  • how can you say it is duplicate? I am accessing Posts information not Profile information. – Sundar Singh Jul 20 '16 at 23:36
  • Yes, but the _answer_ to that question is general, and not limited to a specific endpoint. Plus, this has been asked countless times before, and it is also mentioned in the API changelog and documentation. – CBroe Jul 21 '16 at 07:43
  • Okay, thanks for your help. But I got to know that i was using older version in api explorer which doesn't requires field parameters and returned all fields but in the api version 2.7 (which SDK using) needs to mention all fields in parameters, – Sundar Singh Jul 21 '16 at 08:58

1 Answers1

1

You need to specify the fields parameter, it´s called "Declarative Fields" and came with v2.4 of the Graph API: /me/posts?fields=field1,field2,field3,...

The possible fields can be found in the docs, you should use the latest version though: https://developers.facebook.com/docs/graph-api/reference/v2.7/post

Make sure you are using a newer Version of the API, you are trying to use v1.0 in Postman (which does not exist anymore).

andyrandy
  • 72,880
  • 8
  • 113
  • 130
  • But you can see I have not mention any fields in Postman app , then why i need to mention in SDK? – Sundar Singh Jul 20 '16 at 23:40
  • you are most likely using an app that can use api versions below v2.4, and you are calling the api in postman with "v1.0" - which is gone for good, but i assume it jumps to the version of the app. either way, i would omit the version flag in postman. – andyrandy Jul 21 '16 at 07:39