Graph API Version

Page Leadgen Draft Forms

Reading

A library of lead generation draft forms created for this page

Example

Graph API Explorer
GET /v2.11/{page-id}/leadgen_draft_forms HTTP/1.1
Host: graph.facebook.com
/* PHP SDK v5.0.0 */
/* make the API call */
try {
  // Returns a `Facebook\FacebookResponse` object
  $response = $fb->get(
    '/{page-id}/leadgen_draft_forms',
    '{access-token}'
  );
} catch(Facebook\Exceptions\FacebookResponseException $e) {
  echo 'Graph returned an error: ' . $e->getMessage();
  exit;
} catch(Facebook\Exceptions\FacebookSDKException $e) {
  echo 'Facebook SDK returned an error: ' . $e->getMessage();
  exit;
}
$graphNode = $response->getGraphNode();
/* handle the result */
/* make the API call */
FB.api(
    "/{page-id}/leadgen_draft_forms",
    function (response) {
      if (response && !response.error) {
        /* handle the result */
      }
    }
);
/* make the API call */
new GraphRequest(
    AccessToken.getCurrentAccessToken(),
    "/{page-id}/leadgen_draft_forms",
    null,
    HttpMethod.GET,
    new GraphRequest.Callback() {
        public void onCompleted(GraphResponse response) {
            /* handle the result */
        }
    }
).executeAsync();
// For more complex open graph stories, use `FBSDKShareAPI`
// with `FBSDKShareOpenGraphContent`
/* make the API call */
FBSDKGraphRequest *request = [[FBSDKGraphRequest alloc]
                               initWithGraphPath:@"/{page-id}/leadgen_draft_forms"
                                      parameters:params
                                      HTTPMethod:@"GET"];
[request startWithCompletionHandler:^(FBSDKGraphRequestConnection *connection,
                                      id result,
                                      NSError *error) {
    // Handle the result
}];

Parameters

This endpoint doesn't have any parameters.

Fields

Reading from this edge will return a JSON formatted result:

{ "data": [], "paging": {} }

data

A list of LeadGenDataDraft nodes.

paging

For more details about pagination, see the Graph API guide.

Validation Rules

ErrorDescription
100Invalid parameter
200Permissions error

Creating

Example

You can make a POST request to leadgen_draft_forms edge from the following paths:
When posting to this edge, no Graph object will be created.

Parameters

NameDescription
allow_organic_lead_retrieval
boolean
Default value: true

Whether to allow advertisers to retrieve organic leads

block_display_for_non_targeted_viewer
boolean

Whether to make the organic post invisible to viewers

context_card
Object

Optional context card shown as the intro page

Supports Emoji
title
UTF-8 string
Supports Emoji
style
enum {LIST_STYLE, PARAGRAPH_STYLE}
content
list<UTF-8 string>
button_text
string
format
enum {TEXT, CANVAS}
canvas_id
numeric string or integer
canvas_jump_to_form_button_text
string
context_card_id
string

ID of optional context card shown as the intro page

custom_disclaimer
Object

Customized disclaimer including title, body content with inline links, and consent checkboxes

title
string
body
Object
text
string
url_entities
list<Object>
offset
integer
length
integer
url
string
checkboxes
list<Object>
is_required
boolean
Default value: true
is_checked_by_default
boolean
Default value: false
text
string
key
string
follow_up_action_url
string

The final destination URL that user will go to when clicking view website button

legal_content_id
string

ID of EntLeadGenLegalContent

locale
enum {EN_US, IT_IT, FR_FR, ES_ES, ES_LA, DE_DE, EN_GB, PT_BR, ZH_TW, ZH_HK, TR_TR, AR_AR, CS_CZ, DA_DK, FI_FI, HE_IL, HI_IN, HU_HU, ID_ID, JA_JP, KO_KR, NB_NO, NL_NL, PL_PL, PT_PT, RO_RO, RU_RU, SV_SE, TH_TH, VI_VN, ZH_CN}

The locale of the form. Pre-defined questions renders in this locale

name
string

The name that will help identity the form

privacy_policy
Object

The url and link_text of the privacy policy of advertiser

url
string
link_text
string
question_page_custom_headline
string

The custom headline for the question page within the form

questions
list<Object>

An array of questions of the form

key
string
label
string
type
enum {CUSTOM, CITY, COMPANY_NAME, COUNTRY, DOB, EMAIL, GENDER, FIRST_NAME, FULL_NAME, JOB_TITLE, LAST_NAME, MARITIAL_STATUS, PHONE, POST_CODE, PROVINCE, RELATIONSHIP_STATUS, STATE, STREET_ADDRESS, ZIP, WORK_EMAIL, MILITARY_STATUS, WORK_PHONE_NUMBER, MESSENGER, STORE_LOOKUP, DATE_TIME, ID_CPF}
inline_context
string
options
list<Object>
key
string
value
string

Return Type

This endpoint supports read-after-write and will read the node represented by id in the return type.
Struct {
id: numeric string,
}

Validation Rules

ErrorDescription
100Invalid parameter
192Invalid phone number

Updating

You can't perform this operation on this endpoint.

Deleting

You can't perform this operation on this endpoint.