6. Retrieve Lead Gen Forms Copy

GET {{baseUrl}}/adForms?q=account&account=urn%3Ali%3AsponsoredAccount%3A{{sponsoredaccount_id}}&totals=true&count=10&start=0

Fetch all forms for an Ad Account (sponsoredAccount)


7. Map Lead Gen Form fields to destination fields

Using the response data from the previous step, your application should ask the user to map questions, consents, and hidden fields to the appropriate fields in the destination system (e.g. a CRM). All questions, consents, and hidden fields from the form should be mappable. predefinedFields may be mapped automatically for the user, but all others will require the user to map them manually. Optionally, allow the user to map the ad account id, ad account name, campaign id, campaign name, creative id, creative name, form id, and form name (this additional metadata can be pulled back via the adFormResponses endpoint in the next step). This additional metadata helps your customers with lead attribution.

Quick tip: When it comes to mapping the predefined fields that are auto populated from the member’s profile, it's important to understand that the localized language of the form could be a language other than English. Due to this, we recommend using the predefinedField field so the user doesn't have to map the same field in different form languages separately. For custom questions you will need to use the question field as there is no predefinedField for custom questions.

Request Params

KeyDatatypeRequiredDescription
qstring
accountstring
totalsboolean
countnumber
startnumber

HEADERS

KeyDatatypeRequiredDescription
X-Restli-Protocol-Versionstring
LinkedIn-versionstring

RESPONSES

status: OK

{"paging":{"start":0,"count":10,"links":[],"total":1},"elements":[{"reviewInfo":{"rejectionReasons":["TEST_ADS"],"reviewedAt":1627913743285,"reviewStatus":"REJECTED"},"form":{"hiddenFields":[{"name":"myhiddenfield","value":"abc123"}],"thankYouPageCallToAction":"VISIT_COMPANY_WEBSITE","privacyPolicy":"http://example.com/privacy","landingPage":"https://www.linkedin.com","consents":[{"consentRequired":true,"consentId":0,"content":"You are providing consent by checking this box"}],"questions":[{"name":"First name","predefinedField":"FIRST_NAME","questionId":1,"question":"First name","memberProfileField":"FIRST_NAME","typeSpecificQuestionDetails":{"com.linkedin.ads.TextQuestionDetails":{}}},{"name":"Last name","predefinedField":"LAST_NAME","questionId":2,"question":"Last name","memberProfileField":"LAST_NAME","typeSpecificQuestionDetails":{"com.linkedin.ads.TextQuestionDetails":{}}},{"name":"Email address","predefinedField":"EMAIL","questionId":3,"question":"Email address","memberProfileField":"EMAIL","typeSpecificQuestionDetails":{"com.linkedin.ads.TextQuestionDetails":{}}},{"name":"Company name","predefinedField":"COMPANY_NAME","questionId":4,"question":"Company name","memberProfileField":"COMPANY_NAME","typeSpecificQuestionDetails":{"com.linkedin.ads.TextQuestionDetails":{}}},{"name":"Custom question 0","questionId":5,"question":"This is a custom question - single input","typeSpecificQuestionDetails":{"com.linkedin.ads.TextQuestionDetails":{}}},{"name":"Custom question 1","questionId":6,"question":"This is a custom question - multiple choice","typeSpecificQuestionDetails":{"com.linkedin.ads.MultipleChoiceQuestionDetails":{"options":[{"com.linkedin.ads.TextOptionQuestion":{"text":"Pink"}},{"com.linkedin.ads.TextOptionQuestion":{"text":"Blue"}}]}}}],"name":"testing ads lead gen","thankYouMessage":"thanks!","headline":"check it out!","legalDisclaimer":"this is where I put my legal/privacy disclaimer text"},"changeAuditStamps":{"created":{"time":1627075713000},"lastModified":{"time":1627913743000}},"created":{"time":1627075713000},"versionTag":"6","id":4655776,"lastModified":{"time":1627913743000},"locale":{"country":"US","language":"en"},"version":{"versionTag":"6"},"account":"urn:li:sponsoredAccount:123456","status":"SUBMITTED"}]}