How to get form fields in Facebook Lead Ads API?

后端 未结 2 1998
长情又很酷
长情又很酷 2021-02-09 17:31

I\'m using Facebook Lead Ads API. I need to retrieve all fields from a form by ID. I know I can:

  • get all forms by calling //leadgen_forms
相关标签:
2条回答
  • 2021-02-09 18:14

    Just a warning since this answer comes first on google search.

    Since Facebook API v5.0 field "qualifiers" is removed and will throw an error.

    Replace it with "questions" which is similar (if not exact) syntax as qualifiers. Found out the hard way on production server...

    0 讨论(0)
  • 2021-02-09 18:18

    You can get these by adding non-default field qualifiers, so the url becomes /<form_id>?fields=id,name,qualifiers.

    I haven't found it anywhere in the official docs though. But it is quite common for new FB features to be poorly documented.

    Example output

    {
      "id": "1234567890000",
      "name": "test form",
      "qualifiers": [
        {
          "field_key": "first_name",
          "label": "First Name",
          "question": "First name",
          "id": "777888999000111"
        },
        {
          "field_key": "last_name",
          "label": "Last Name",
          "question": "Last name",
          "id": "111222333444555"
        }
      ]
    }
    
    0 讨论(0)
提交回复
热议问题