API Payload field format for Lead Capture

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • crmclients
    Senior Member
    • Jul 2020
    • 254

    API Payload field format for Lead Capture

    Click image for larger version

Name:	https conn.png
Views:	900
Size:	40.0 KB
ID:	65377

    I just wanted to exhaust all reasons why this isn't working and confirm I should be using the camel case format (as is with the CSV export) when naming fields from external sources to pass into the Leads module

    The Lead Capture shows this:
    { salutationName: SALUTATION_NAME,
    firstName: FIRST_NAME,
    lastName: LAST_NAME,
    middleName: MIDDLE_NAME,
    emailAddress: EMAIL_ADDRESS }



    But I should be using
    firstName



    not
    FIRST_NAME



    correct?

    is there a reason both are listed?
    Last edited by crmclients; 12-09-2020, 05:02 AM.
  • Maximus
    Senior Member
    • Nov 2018
    • 2731

    #2
    Hi,
    Yes, I can confirm that you need to use the camel case format e.g. firstName. In the documentation you can find a lot of examples where this confirms https://docs.espocrm.com/administration/web-to-lead/. I guess the FIRST_NAME, it is like a pattern. Just take a look at the HTML form example:
    Code:
    var payloadData = {
        firstName: webToLeadFormElement.firstName.value,
        lastName: webToLeadFormElement.lastName.value,
        emailAddress: webToLeadFormElement.emailAddress.value
    };
    So here we have webToLeadFormElement.firstName.value, instead of FIRST_NAME.

    Comment

    • crmclients
      Senior Member
      • Jul 2020
      • 254

      #3
      OK so it's a guess of what another apps code could look like, in the Espo view one that uses ALL CAPS
      it could be

      firstName: firstname, or
      firstName: FirstName,
      etc.

      I was afraid of that but thanks for the clear direction

      Comment


      • esforim
        esforim commented
        Editing a comment
        So celebration time finally? You manage to get FA to work?
    • crmclients
      Senior Member
      • Jul 2020
      • 254

      #4
      No still can't get it to work - i think because i need to pass this from formassembly -- maybe?ahead of the remote URL with the API key and there doesn't appear to be a is no place to put that - or I can't figure out how to make it part of the URL (in the formassembly config above)
      • The only thing that comes close to no error is -not- using a key and using Authentication - i gives a 200 response but creates nothing -
      • i see "api user" in Admin with a username and key but FA wants username and password - tried it any way and also a no-go
      Contact7 form has this in its response (among many other lines)
      [x-powered-by] => PHP/7.2.34
      [content-type] => application/json
      [access-control-allow-origin] => *

      So it is giving Espo what it requires and works perfectly.

      Espo & formassembly for lead capture is still a no-go

      Comment

      Working...