Leads API - How to Edit Lead Data with API Calls

Link: https://support.brilliantdirectories.com/support/solutions/articles/12000091106-leads-api-how-to-edit-lead-data-with-api-calls

It is possible to update a members information using the api, only member can be updated at a time.


Using the API there are 5 lead actions that can be achieved:


  1. api/v2/leads/get/{id}
  2. api/v2/leads/create
  3. api/v2/leads/update
  4. api/v2/leads/match
  5. api/v2/leads/delete/{id}



We will break down these actions and explain how to achieve an end results with each one. The examples shown in this article are completed using https://www.postman.com/


  • api/v2/leads/get/{id}

    Using this action is simple, add the url above but replace {id} with the actual lead ID. This will fetch the lead information from the website.



  • api/v2/leads/create

    To use this action it should have the same variables found within the Website - Lead Form - Get Matched form.

    There are two additional variables that can be used to Auto-Match and auto Geocode the lead. When using these variables "1" will enable the action and "0: disables the action. However these fields are already automatically enabled:



    auto_match:
    automatch with possible members

    auto_geocode:
    geocode the lead location

    In order for the system to auto-geocode the lead, this Advanced Setting needs to be set up following the instructions in this article:

    google_maps_server_side_api_key


    Note: In order for a lead to be auto-matched, it must have either category information (top category or top and sub category), geocoded location information including the "lat" and "lon" values for the location, or both. Using the "auto_geocode" functionality will work to provide a geocoded location as long as Google Maps can provide that information based on the name of the location submitted with the lead.

  • api/v2/leads/update


    With this action, within the spreadsheet add the lead ID and the variables for the information the needs to be updated.



  • api/v2/leads/match

    This action requires the lead ID and either the ID's or emails of the members that the lead will be matched to.


  • api/v2/leads/delete/{id}

    Use this action URL to delete a lead, replace {id} with the lead ID that will be removed from the website.



Important Note: Include in the Query Params send_lead_email_notification = 1 to activate Lead Email Notifications.