Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

  1. You can add custom fields and they will appear on the lead on the lead information page

  2. Any fields that have an official CostCertified version (first name, last name, email, phone, city, postal/zip, description/request) must use our field naming format related to that field. Anything else that does not have a CostCertified field version can be named anything you like, and it will save and display on the lead.

    1. For example, if we are collecting a first name it must be in the format user_fname, because that is the only way CostCertified will register it as a first name. If you are adding a custom field that doesn’t relate to anything in CC, then you can call it whatever you want.

    2. Official fields:

      1. user_fname - first name

      2. user_lname - last name

      3. user_email - email

      4. user_phone - phone

      5. user_address - address line 1

      6. user_suite - address line 1 / unit / suite

      7. user_city - city

      8. user_postal - postal/zip

      9. activity_desc - request / description field / long text

    3. Note: if you build a form with an id or key of ‘firstName’, CostCertified will not register it as a first name and the lead will appear as if it has no first name. It must be sent as user_fname.

  3. To add a custom field, just add extra fields inside the <form> of the code snippet with descriptive id/names, they will automatically be bundled and added to the Requests tab on the Client panel when you open the client.

Submit a lead via API endpoint

  1. Get your endpoint URL. Every lead-rotation has its own endpoint URL so specifically for api-routed submissions. o it is important you get the one that is generated in the code snippet from the Generate code snippet tab from the lead rotation window. You can find it here:

    Image RemovedImage Removed

    underneath the generated form snippet on the lead rotation panel:

    Image Added
  2. Once you have the endpoint you can generate a curl request manually, or route to that address from Zapier or Integromate, or directly from your own code or platform. Here are some examples using curl (bash) or fetch (javascript).

    1. CURL - You can also just include other key:value pairs if sending the data via CURL. Replace {your endpoint url from form code snippet generated} with your endpoint url.

      Code Block
      curl '{your endpoint url from form code snippet generated}' --data-raw 'lead_rotation_id=2989995&activity_desc=New+request+comments&user_fname=John&user_lname=Smith&user_email=johnsmith%40smith.com&user_phone=4035555555'
    2. FETCH - From javascript you can programatically send a lead by copying the endpoint URL from the form snippet and implementing the following script using the official fields. Replace {your endpoint url from form code snippet generated} with your endpoint url.

      Code Block
      fetch("{your endpoint url from form code snippet generated}", {
        method: "POST", 
        body: JSON.stringify({
          user_fname: 'John',
          user_lname: 'Smith',
          user_address: '123 Pine Street',
          user_postal: '12345',
          user_city: 'City Name',
          user_email: 'email@email.com',
          user_phone: '12345678910',
          activity_desc: 'I would like a highly accurate quote on a renovation in record time!',
          customField1: 'My custom field value',
          customField2: 'My custom field value 2',
        })
      }).then(res => {
        console.log("Request complete! response:", res);
      });