skip to Main Content

Documentation and Code Sample

In the documentation above there are only two parameters.
However, in the code example they are using fields as parameters.

I tried searching the docs but I’m still unclear on how fields and params are different.
Are they completely interchangeable or are there specific times to use each?

2

Answers


  1. Chosen as BEST ANSWER

    I reached out to Facebook Support and this was their answer:

    Parameters are inputs to an API that specify constraints on the range of data that will be returned (time ranges, specific ids etc.). Fields are what are returned by the API, if you want specific fields to be returned, these can be specified by adding something like "fields=id,name..." to an API.

    Parameters and fields are not interchangeable.


  2. I tried searching the docs but I’m still unclear on how fields and params are different. Are they completely interchangeable or are there specific times to use each?

    Fields are the specific data elements you can request about an object.

    A user’s e-mail address, a post’s message, a page’s cover photo – those are fields.

    Parameters allow you to limit the selection of data, based on specific criteria.

    You request a page’s feed, but you only want posts from a specific time frame – then you use parameters like since and until, for example.


    If you are familiar with basic SQL, you could use this as an analogy: Fields would be the column names you specify after SELECT; Parameters would be the WHERE clause.

    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search