lib/client/crm/docs/LeadsApi.md

7.2 KiB

Crm.LeadsApi

All URIs are relative to http://crm.vernonkeenan.com:8080/v1

Method HTTP request Description
deleteLead DELETE /leads Delete a Contact
getLeads GET /leads Get a list of contacts
getLeadsObservable GET /leads/observable Get Taxnexus Leads in an observable array
postLeads POST /leads Add new Leads
putLeads PUT /leads Update Leads

deleteLead

DeleteResponse deleteLead(opts)

Delete a Contact

Delete Taxnexus Lead record

Example

import Crm from 'crm';
let defaultClient = Crm.ApiClient.instance;
// Configure API key authorization: ApiKeyAuth
let ApiKeyAuth = defaultClient.authentications['ApiKeyAuth'];
ApiKeyAuth.apiKey = 'YOUR API KEY';
// Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
//ApiKeyAuth.apiKeyPrefix = 'Token';

let apiInstance = new Crm.LeadsApi();
let opts = {
  'leadId': "leadId_example" // String | Taxnexus Lead record ID
};
apiInstance.deleteLead(opts, (error, data, response) => {
  if (error) {
    console.error(error);
  } else {
    console.log('API called successfully. Returned data: ' + data);
  }
});

Parameters

Name Type Description Notes
leadId String Taxnexus Lead record ID [optional]

Return type

DeleteResponse

Authorization

ApiKeyAuth

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

getLeads

LeadResponse getLeads(opts)

Get a list of contacts

Return a list of all available Leads

Example

import Crm from 'crm';
let defaultClient = Crm.ApiClient.instance;
// Configure API key authorization: ApiKeyAuth
let ApiKeyAuth = defaultClient.authentications['ApiKeyAuth'];
ApiKeyAuth.apiKey = 'YOUR API KEY';
// Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
//ApiKeyAuth.apiKeyPrefix = 'Token';

let apiInstance = new Crm.LeadsApi();
let opts = {
  'limit': 789, // Number | How many objects to return at one time
  'offset': 789, // Number | How many objects to skip?
  'leadId': "leadId_example", // String | Taxnexus Lead record ID
  'email': "email_example", // String | Email address used for identity lookup
  'name': "name_example" // String | The Name of this Object
};
apiInstance.getLeads(opts, (error, data, response) => {
  if (error) {
    console.error(error);
  } else {
    console.log('API called successfully. Returned data: ' + data);
  }
});

Parameters

Name Type Description Notes
limit Number How many objects to return at one time [optional]
offset Number How many objects to skip? [optional]
leadId String Taxnexus Lead record ID [optional]
email String Email address used for identity lookup [optional]
name String The Name of this Object [optional]

Return type

LeadResponse

Authorization

ApiKeyAuth

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

getLeadsObservable

[Lead] getLeadsObservable(opts)

Get Taxnexus Leads in an observable array

A list of leads in a simple JSON array

Example

import Crm from 'crm';
let defaultClient = Crm.ApiClient.instance;
// Configure API key authorization: ApiKeyAuth
let ApiKeyAuth = defaultClient.authentications['ApiKeyAuth'];
ApiKeyAuth.apiKey = 'YOUR API KEY';
// Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
//ApiKeyAuth.apiKeyPrefix = 'Token';

let apiInstance = new Crm.LeadsApi();
let opts = {
  'leadId': "leadId_example", // String | Taxnexus Lead record ID
  'email': "email_example", // String | Email address used for identity lookup
  'name': "name_example" // String | The Name of this Object
};
apiInstance.getLeadsObservable(opts, (error, data, response) => {
  if (error) {
    console.error(error);
  } else {
    console.log('API called successfully. Returned data: ' + data);
  }
});

Parameters

Name Type Description Notes
leadId String Taxnexus Lead record ID [optional]
email String Email address used for identity lookup [optional]
name String The Name of this Object [optional]

Return type

**[Lead]**

Authorization

ApiKeyAuth

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

postLeads

LeadResponse postLeads(leadRequest)

Add new Leads

Lead records to be added

Example

import Crm from 'crm';
let defaultClient = Crm.ApiClient.instance;
// Configure API key authorization: ApiKeyAuth
let ApiKeyAuth = defaultClient.authentications['ApiKeyAuth'];
ApiKeyAuth.apiKey = 'YOUR API KEY';
// Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
//ApiKeyAuth.apiKeyPrefix = 'Token';

let apiInstance = new Crm.LeadsApi();
let leadRequest = new Crm.LeadRequest(); // LeadRequest | An array of new Lead records
apiInstance.postLeads(leadRequest, (error, data, response) => {
  if (error) {
    console.error(error);
  } else {
    console.log('API called successfully. Returned data: ' + data);
  }
});

Parameters

Name Type Description Notes
leadRequest LeadRequest An array of new Lead records

Return type

LeadResponse

Authorization

ApiKeyAuth

HTTP request headers

  • Content-Type: application/json
  • Accept: application/json

putLeads

LeadResponse putLeads(leadRequest)

Update Leads

Update Lead records

Example

import Crm from 'crm';
let defaultClient = Crm.ApiClient.instance;
// Configure API key authorization: ApiKeyAuth
let ApiKeyAuth = defaultClient.authentications['ApiKeyAuth'];
ApiKeyAuth.apiKey = 'YOUR API KEY';
// Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
//ApiKeyAuth.apiKeyPrefix = 'Token';

let apiInstance = new Crm.LeadsApi();
let leadRequest = new Crm.LeadRequest(); // LeadRequest | An array of new Lead records
apiInstance.putLeads(leadRequest, (error, data, response) => {
  if (error) {
    console.error(error);
  } else {
    console.log('API called successfully. Returned data: ' + data);
  }
});

Parameters

Name Type Description Notes
leadRequest LeadRequest An array of new Lead records

Return type

LeadResponse

Authorization

ApiKeyAuth

HTTP request headers

  • Content-Type: application/json
  • Accept: application/json