8. [PULL] Schedule periodic form response (lead) pulls

GET {{baseUrl}}/leadFormResponses?q=owner&owner=(sponsoredAccount:urn%3Ali%3AsponsoredAccount%3A{{sponsoredaccount_id}})&leadType=(leadType:{{leadtype_sponsored}})&limitedToTestLeads=false&submittedAtTimeRange=(start:{{timerange_start}},end:{{timerange_end}})&fields=ownerInfo,associatedEntityInfo,leadMetadataInfo,owner,leadType,versionedLeadGenFormUrn,id,submittedAt,testLead,formResponse,form:(hiddenFields,creationLocale,name,id,content)&count=10&start=0

This example pulls back all form responses (leads) for the chosen sponsored account. It also uses field projection to pull back specific fields in the response and the submittedAtTimeRange field to pull back leads up to 365 days in the past.

Currently the only sponsored leadType is SPONSORED

LinkedIn will store form response (lead) data for up to 365 days. It is a best practice to allow the user to do a one time pull upon integration setup to ensure no leads are missed.

Refer to Lead Form Responses documentation for more information.

Request Params

KeyDatatypeRequiredDescription
qstring
ownerstring
leadTypestring
limitedToTestLeadsboolean
submittedAtTimeRangestring
fieldsstring
countnumber
startnumber

HEADERS

KeyDatatypeRequiredDescription
LinkedIn-Versionstring
X-Restli-Protocol-Versionstring

RESPONSES

status: OK

{"paging":{"start":0,"count":10,"links":[],"total":3},"elements":[{"owner":{"sponsoredAccount":"urn:li:sponsoredAccount:11223344"},"form":{"name":"Form with written spanish","hiddenFields":[{"name":"hidden_field","value":"abc678"},{"name":"campo_escondido","value":"def789"}],"id":7234246,"content":{"questions":[{"questionId":107234246,"question":{"localized":{"es_ES":"Nombre"}},"responseEditable":true,"name":"First name","questionDetails":{"textQuestionDetails":{"maxResponseLength":300}},"predefinedField":"FIRST_NAME","responseRequired":true},{"questionId":207234246,"question":{"localized":{"es_ES":"Apellidos"}},"responseEditable":true,"name":"Last name","questionDetails":{"textQuestionDetails":{"maxResponseLength":300}},"predefinedField":"LAST_NAME","responseRequired":true},{"questionId":307234246,"question":{"localized":{"es_ES":"Correo electrónico"}},"responseEditable":true,"name":"Email address","questionDetails":{"textQuestionDetails":{"maxResponseLength":300}},"predefinedField":"EMAIL","responseRequired":true},{"questionId":407234246,"question":{"localized":{"es_ES":"Cargo"}},"responseEditable":true,"name":"Job title","questionDetails":{"textQuestionDetails":{"maxResponseLength":300}},"predefinedField":"JOB_TITLE","responseRequired":true},{"questionId":507234246,"question":{"localized":{"es_ES":"Función"}},"responseEditable":true,"name":"Function","questionDetails":{"textQuestionDetails":{"maxResponseLength":300}},"predefinedField":"JOB_FUNCTION","responseRequired":true},{"questionId":607234246,"question":{"localized":{"es_ES":"Correo electrónico del trabajo"}},"responseEditable":true,"name":"Work email","questionDetails":{"textQuestionDetails":{"maxResponseLength":300}},"predefinedField":"WORK_EMAIL","responseRequired":true},{"name":"Custom question 0","questionDetails":{"multipleChoiceQuestionDetails":{"options":[{"text":{"localized":{"es_ES":"Rojo"}},"id":0},{"text":{"localized":{"es_ES":"Azul"}},"id":1}]}},"questionId":707234246,"question":{"localized":{"es_ES":"Cuál es tu color favorito"}},"responseEditable":true,"responseRequired":true},{"name":"Custom question 1","questionDetails":{"textQuestionDetails":{"maxResponseLength":300}},"questionId":807234246,"question":{"localized":{"es_ES":"¿Dónde creciste?"}},"responseEditable":true,"responseRequired":true}],"description":{"localized":{"es_ES":"Mis detalles de súper gran oferta!"}},"postSubmissionInfo":{"message":{"localized":{"es_ES":"muchas gracias!"}},"callToAction":{"callToActionTarget":{"landingPageUrl":"https://www.linkedin.com"},"callToActionLabel":"VISIT_COMPANY_WEBSITE"}},"legalInfo":{"consents":[{"consent":{"localized":{"es_ES":" marque mi casilla de verificación personalizada!"}},"checkRequired":true,"id":0}],"legalInfoId":107234246,"privacyPolicyUrl":"http://example.com/privacy","legalDisclaimer":{"localized":{"es_ES":"tanto texto de política"}}},"headline":{"localized":{"es_ES":"mi super gran titular"}}},"creationLocale":{"country":"ES","language":"es"}},"leadType":"SPONSORED","leadMetadataInfo":{"sponsoredLeadMetadataInfo":{"campaign":{"type":"SPONSORED_UPDATES","name":"Spain campaign","id":"urn:li:sponsoredCampaign:198356826"}}},"associatedEntityInfo":{"associatedCreative":{"intendedStatus":"DRAFT","content":{"reference":"urn:li:share:6904869836015464450"},"id":"urn:li:sponsoredCreative:241257736"}},"versionedLeadGenFormUrn":"urn:li:versionedLeadGenForm:(urn:li:leadGenForm:7234246,1)","ownerInfo":{"sponsoredAccountInfo":{"name":"Christa's Updated Ad Acount"}},"id":"249592fc-d272-44ba-a7db-c2bdce579507-6","submittedAt":1689894599288,"testLead":true,"formResponse":{"consentResponses":[{"accepted":true,"consentId":0}],"answers":[{"answerDetails":{"textQuestionAnswer":{"answer":"kelly@email.com"}},"questionId":307234246},{"answerDetails":{"textQuestionAnswer":{"answer":"kelly@workemail.com"}},"questionId":607234246},{"answerDetails":{"multipleChoiceAnswer":{"options":[0]}},"questionId":707234246},{"answerDetails":{"textQuestionAnswer":{"answer":"Mexico"}},"questionId":807234246},{"answerDetails":{"textQuestionAnswer":{"answer":"kelly"}},"questionId":107234246},{"answerDetails":{"textQuestionAnswer":{"answer":"Stanton"}},"questionId":207234246},{"answerDetails":{"textQuestionAnswer":{"answer":"Senior Partner Engineer"}},"questionId":407234246},{"answerDetails":{"textQuestionAnswer":{"answer":"Ingeniería"}},"questionId":507234246}]}},{"owner":{"sponsoredAccount":"urn:li:sponsoredAccount:11223344"},"form":{"name":"christascranberryform","hiddenFields":[{"name":"ad_cranberries","value":"yes"}],"id":4679966,"content":{"questions":[{"questionId":104679966,"question":{"localized":{"en_US":"First name"}},"responseEditable":true,"name":"First name","questionDetails":{"textQuestionDetails":{"maxResponseLength":300}},"predefinedField":"FIRST_NAME","responseRequired":true},{"questionId":204679966,"question":{"localized":{"en_US":"Last name"}},"responseEditable":true,"name":"Last name","questionDetails":{"textQuestionDetails":{"maxResponseLength":300}},"predefinedField":"LAST_NAME","responseRequired":true},{"questionId":304679966,"question":{"localized":{"en_US":"Email address"}},"responseEditable":true,"name":"Email address","questionDetails":{"textQuestionDetails":{"maxResponseLength":300}},"predefinedField":"EMAIL","responseRequired":true},{"questionId":404679966,"question":{"localized":{"en_US":"Degree"}},"responseEditable":true,"name":"Degree","questionDetails":{"textQuestionDetails":{"maxResponseLength":300}},"predefinedField":"DEGREE","responseRequired":true},{"name":"Custom question 0","questionDetails":{"textQuestionDetails":{"maxResponseLength":300}},"questionId":504679966,"question":{"localized":{"en_US":"What is the best way to eat cranberries?"}},"responseEditable":true,"responseRequired":true},{"name":"Custom question 1","questionDetails":{"multipleChoiceQuestionDetails":{"options":[{"text":{"localized":{"en_US":"raw"}},"id":1},{"text":{"localized":{"en_US":"juice"}},"id":2},{"text":{"localized":{"en_US":"craisen"}},"id":3}]}},"questionId":604679966,"question":{"localized":{"en_US":"What kind of cranberries do you prefer to eat?"}},"responseEditable":true,"responseRequired":true}],"postSubmissionInfo":{"message":{"localized":{"en_US":"thank you!"}},"callToAction":{"callToActionTarget":{"landingPageUrl":"https://www.oceanspray.com/"},"callToActionLabel":"VISIT_COMPANY_WEBSITE"}},"legalInfo":{"consents":[{"consent":{"localized":{"en_US":"by checking this box you agree to loving cranberries!"}},"checkRequired":true,"id":0}],"privacyPolicyUrl":"http://example.com/privacy","legalInfoId":104679966},"headline":{"localized":{"en_US":"cranberries are healthy!"}}},"creationLocale":{"country":"US","language":"en"}},"leadType":"SPONSORED","leadMetadataInfo":{"sponsoredLeadMetadataInfo":{"campaign":{"type":"SPONSORED_UPDATES","name":"new leads","id":"urn:li:sponsoredCampaign:168056916"}}},"associatedEntityInfo":{"associatedCreative":{"intendedStatus":"ACTIVE","content":{"reference":"urn:li:share:6826590508119404544"},"id":"urn:li:sponsoredCreative:132987526"}},"versionedLeadGenFormUrn":"urn:li:versionedLeadGenForm:(urn:li:leadGenForm:4679966,1)","ownerInfo":{"sponsoredAccountInfo":{"name":"Christa's Updated Ad Acount"}},"id":"0db37541-8c0c-49a7-b9f4-833c10b5a1d5-6","submittedAt":1689894505048,"testLead":true,"formResponse":{"consentResponses":[{"accepted":true,"consentId":0}],"answers":[{"answerDetails":{"textQuestionAnswer":{"answer":"linus@email.com"}},"questionId":304679966},{"answerDetails":{"textQuestionAnswer":{"answer":"raw"}},"questionId":504679966},{"answerDetails":{"multipleChoiceAnswer":{"options":[0]}},"questionId":604679966},{"answerDetails":{"textQuestionAnswer":{"answer":"Linus"}},"questionId":104679966},{"answerDetails":{"textQuestionAnswer":{"answer":"McAdams"}},"questionId":204679966},{"answerDetails":{"textQuestionAnswer":{"answer":"Bachelor of Science - BS"}},"questionId":404679966}]}}]}