How to Enrich an Input Lead with Additional Data Fields in Node.JS

Cloudmersive
2 min readMar 24, 2020

--

A great way to add some versatility to your project is to add more data fields to an input lead. That said, how do we go about dealing with this task from within Node.JS? While it certainly seems like a headscratcher on first glance, there is a much easier way to take care of this, one that bypasses all of the time-consuming coding and gets you straight to the finish line in a very short time. Let’s take a look.

So we begin with npm installing our API client through use of this command here:

npm install cloudmersive-validate-api-client --save

Right after that, we can call our function with this sample code here:

var CloudmersiveValidateApiClient = require('cloudmersive-validate-api-client');var defaultClient = CloudmersiveValidateApiClient.ApiClient.instance;// Configure API key authorization: Apikeyvar Apikey = defaultClient.authentications['Apikey'];Apikey.apiKey = 'YOUR API KEY';// Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)//Apikey.apiKeyPrefix = 'Token';var apiInstance = new CloudmersiveValidateApiClient.LeadEnrichmentApi();var request = new CloudmersiveValidateApiClient.LeadEnrichmentRequest(); // LeadEnrichmentRequest | Input lead with known fields set, and unknown fields left blank (null)var callback = function(error, data, response) {if (error) {console.error(error);} else {console.log('API called successfully. Returned data: ' + data);}};apiInstance.leadEnrichmentEnrichLead(request, callback);

Now specify your data fields and the rest will be handled on the API’s end. Easy!

--

--

Cloudmersive
Cloudmersive

Written by Cloudmersive

There’s an API for that. Cloudmersive is a leader in Highly Scalable Cloud APIs.

No responses yet