• Attempting to get new leads submitted to Insightly. I’ve been successful for the most part, but I have 3 custom fields setup on Insightly and I can’t figure out how to map them.

    From the Insightly API documentation it looks like this:

     "CUSTOMFIELDS": [
        {
          "CUSTOM_FIELD_ID": "LEAD_FIELD_1",
          "FIELD_VALUE": "How Found Text"
        },
        {
          "CUSTOM_FIELD_ID": "LEAD_FIELD_2",
          "FIELD_VALUE": "Best Contact Text"
        },
        {
          "CUSTOM_FIELD_ID": "LEAD_FIELD_3",
          "FIELD_VALUE": "Questions Text"
        },
        {
          "CUSTOM_FIELD_ID": "LEAD_FIELD_4",
          "FIELD_VALUE": "No"
        },
        {
          "CUSTOM_FIELD_ID": "LEAD_FIELD_5",
          "FIELD_VALUE": "No"
        },
        {
          "CUSTOM_FIELD_ID": "LEAD_FIELD_9",
          "FIELD_VALUE": "No - Contacted"
        }
      ],

    It looks like this is an array under CUSTOMFIELDS. The “FIELD_VALUE” for LEAD_FIELD_1, LEAD_FIELD_2 and LEAD_FIELD_3 are the fields I want to update. I tried to map the correct fields just to LEAD_FIELD_1, LEAD_FIELD_2 and LEAD_FIELD_3, but that doesn’t work. How can I map these so they are added?

    Below is my debug output.

    Thanks!

    Bob

    *** Service ***
    Array
    (
        [name] => service1
        [url] => https://api.insight.ly/v2.1/Leads
        [forms] => Array
            (
                [0] => cf7_29514
            )
    
        [success] =>
        [failure] =>
        [timeout] => 10
        [as-xpost] => json
        [xpost-wrapper] =>
        [xpost-header] => Authorization=Basic [base64]38fc600f-603b-4278-a505-5b4b69172505[/base64]&Accept-Encoding=gzip
        [xpostac] => 1
        [mapping] => Array
            (
                [0] => Array
                    (
                        [lbl] =>
                        [src] => first-name
                        [3rd] => FIRST_NAME
                    )
    
                [1] => Array
                    (
                        [lbl] =>
                        [src] => your-name
                        [3rd] => LAST_NAME
                    )
    
                [2] => Array
                    (
                        [lbl] =>
                        [src] => tel-980
                        [3rd] => PHONE_NUMBER
                    )
    
                [3] => Array
                    (
                        [lbl] =>
                        [src] => your-email
                        [3rd] => EMAIL_ADDRESS
                    )
    
                [4] => Array
                    (
                        [lbl] =>
                        [src] => street-name
                        [3rd] => ADDRESS_STREET
                    )
    
                [5] => Array
                    (
                        [lbl] =>
                        [src] => city
                        [3rd] => ADDRESS_CITY
                    )
    
                [6] => Array
                    (
                        [lbl] =>
                        [src] => state
                        [3rd] => ADDRESS_STATE
                    )
    
                [7] => Array
                    (
                        [lbl] =>
                        [src] => zip
                        [3rd] => ADDRESS_POSTCODE
                    )
    
                [1481916780572] => Array
                    (
                        [lbl] =>
                        [src] => lead-source
                        [3rd] => LEAD_SOURCE_ID
                    )
    
                [1481916789431] => Array
                    (
                        [lbl] => How Found Us
                        [src] => menu-0
                        [3rd] => LEAD_FIELD_1
                    )
    
                [1481917007102] => Array
                    (
                        [lbl] => Best Way to Contact
                        [src] => menu-53
                        [3rd] => LEAD_FIELD_2
                    )
    
                [1481917008344] => Array
                    (
                        [lbl] => Questions
                        [src] => Checkbox-707
                        [3rd] => LEAD_FIELD_3
                    )
    
            )
    
    )
    
    *** Post (Form) ***
    http://www.trulogsiding.com/insightly-testing/
    Array
    (
        [_wpcf7] => 29514
        [_wpcf7_version] => 4.6
        [_wpcf7_locale] => en_US
        [_wpcf7_unit_tag] => wpcf7-f29514-p29513-o1
        [lead-source] => 878701
        [first-name] => Test
        [your-name] => Smith
        [your-email] => test@trulogsiding.com
        [tel-980] => 970-555-5555
        [street-name] => 123 Main St
        [city] => Loveland
        [state] => CO
        [zip] => 80537
        [menu-0] => TV Commercial
        [menu-53] => Mail
        [checkbox-707] => Array
            (
                [0] => Warranty/Durability
                [1] => How is it installed
            )
    
        [textarea-513] => test
        [opt-in] => Array
            (
                [0] => Sign up for our free newsletter
            )
    
        [referer-page] => http://www.trulogsiding.com/wp-admin/post.php?post=29513&action=edit
        [_wpcf7_is_ajax_call] => 1
    )
    
    *** Post (to Service) ***
    Array
    (
        [timeout] => 10
        [body] => {"FIRST_NAME":"Test","LAST_NAME":"Smith","PHONE_NUMBER":"970-555-5555","EMAIL_ADDRESS":"test@trulogsiding.com","ADDRESS_STREET":"123 Main St","ADDRESS_CITY":"Loveland","ADDRESS_STATE":"CO","ADDRESS_POSTCODE":"80537","LEAD_SOURCE_ID":"878701","LEAD_FIELD_1":"TV Commercial","LEAD_FIELD_2":"Mail"}
        [headers] => Array
            (
                [Authorization] => Basic MzhmYzYwMGYtNjAzYi00Mjc4LWE1MDUtNWI0YjY5MTcyNTA1
                [Accept-Encoding] => gzip
                [Content-Type] => application/json
            )
    
    )
    
    *** Response ***
    WP_HTTP_Requests_Response Object
    (
        [response:protected] => Requests_Response Object
            (
                [body] => {"LEAD_ID":14297574,"SALUTATION":null,"TITLE":null,"FIRST_NAME":"Test","LAST_NAME":"Smith","ORGANIZATION_NAME":null,"PHONE_NUMBER":"970-555-5555","MOBILE_PHONE_NUMBER":null,"FAX_NUMBER":null,"EMAIL_ADDRESS":"test@trulogsiding.com","WEBSITE_URL":null,"OWNER_USER_ID":566073,"DATE_CREATED_UTC":"2016-12-16 20:28:48","DATE_UPDATED_UTC":"2016-12-16 20:28:48","CONVERTED":false,"CONVERTED_DATE_UTC":null,"CONVERTED_CONTACT_ID":null,"CONVERTED_ORGANIZATION_ID":null,"CONVERTED_OPPORTUNITY_ID":null,"VISIBLE_TO":"EVERYONE","RESPONSIBLE_USER_ID":566073,"INDUSTRY":null,"LEAD_STATUS_ID":95513,"LEAD_SOURCE_ID":878701,"VISIBLE_TEAM_ID":null,"EMPLOYEE_COUNT":null,"LEAD_RATING":null,"LEAD_DESCRIPTION":null,"VISIBLE_USER_IDS":null,"CUSTOMFIELDS":[],"ADDRESS_STREET":"123 Main St","ADDRESS_CITY":"Loveland","ADDRESS_STATE":"CO","ADDRESS_POSTCODE":"80537","ADDRESS_COUNTRY":null,"TAGS":[],"EMAIL_LINKS":[],"EVENT_LINKS":[],"TASK_LINKS":[],"NOTE_LINKS":[],"FILE_ATTACHMENTS":[],"IMAGE_URL":"http://s3.amazonaws.com/insightly.userfiles/313479/"}
                [raw] => HTTP/1.1 201 Created
    Cache-Control: no-cache
    Pragma: no-cache
    Content-Type: application/json; charset=utf-8
    Expires: -1
    Location: https://api.insight.ly/v2.1/Leads/14297574
    Date: Fri, 16 Dec 2016 20:28:48 GMT
    Connection: close
    Content-Length: 1030
    Set-Cookie: snaptid=sac1prdc01ut04; path=/; HttpOnly; Secure
    
    {"LEAD_ID":14297574,"SALUTATION":null,"TITLE":null,"FIRST_NAME":"Test","LAST_NAME":"Smith","ORGANIZATION_NAME":null,"PHONE_NUMBER":"970-555-5555","MOBILE_PHONE_NUMBER":null,"FAX_NUMBER":null,"EMAIL_ADDRESS":"test@trulogsiding.com","WEBSITE_URL":null,"OWNER_USER_ID":566073,"DATE_CREATED_UTC":"2016-12-16 20:28:48","DATE_UPDATED_UTC":"2016-12-16 20:28:48","CONVERTED":false,"CONVERTED_DATE_UTC":null,"CONVERTED_CONTACT_ID":null,"CONVERTED_ORGANIZATION_ID":null,"CONVERTED_OPPORTUNITY_ID":null,"VISIBLE_TO":"EVERYONE","RESPONSIBLE_USER_ID":566073,"INDUSTRY":null,"LEAD_STATUS_ID":95513,"LEAD_SOURCE_ID":878701,"VISIBLE_TEAM_ID":null,"EMPLOYEE_COUNT":null,"LEAD_RATING":null,"LEAD_DESCRIPTION":null,"VISIBLE_USER_IDS":null,"CUSTOMFIELDS":[],"ADDRESS_STREET":"123 Main St","ADDRESS_CITY":"Loveland","ADDRESS_STATE":"CO","ADDRESS_POSTCODE":"80537","ADDRESS_COUNTRY":null,"TAGS":[],"EMAIL_LINKS":[],"EVENT_LINKS":[],"TASK_LINKS":[],"NOTE_LINKS":[],"FILE_ATTACHMENTS":[],"IMAGE_URL":"http://s3.amazonaws.com/insightly.userfiles/313479/"}
                [headers] => Requests_Response_Headers Object
                    (
                        [data:protected] => Array
                            (
                                [cache-control] => Array
                                    (
                                        [0] => no-cache
                                    )
    
                                [pragma] => Array
                                    (
                                        [0] => no-cache
                                    )
    
                                [content-type] => Array
                                    (
                                        [0] => application/json; charset=utf-8
                                    )
    
                                [expires] => Array
                                    (
                                        [0] => -1
                                    )
    
                                [location] => Array
                                    (
                                        [0] => https://api.insight.ly/v2.1/Leads/14297574
                                    )
    
                                [date] => Array
                                    (
                                        [0] => Fri, 16 Dec 2016 20:28:48 GMT
                                    )
    
                                [content-length] => Array
                                    (
                                        [0] => 1030
                                                [creation] => 1481920093
                                                [last-access] => 1481920093
                                                [persistent] =>
                                                [host-only] => 1
                                            )
    
                                        [reference_time] => 1481920093
Viewing 2 replies - 1 through 2 (of 2 total)
  • Plugin Author zaus

    (@zaus)

    Is that unsightly API example how it’s supposed to be submitted? If so, I think the only way to get the value nested next to the correct label will be to use the mask or replacement style in xpost, and write out the json.

    Plugin Author zaus

    (@zaus)

    Haha, autocorrect… *Insightly

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Insightly CF7 sending Custom Fields’ is closed to new replies.