Skip to content

Latest commit

 

History

History
373 lines (238 loc) · 9.2 KB

LeadsApi.md

File metadata and controls

373 lines (238 loc) · 9.2 KB

crms.LeadsApi

All URIs are relative to https://api.saasgrids.com/apis/crms/

Method HTTP request Description
createLead POST /{userId}/leads Creates a new lead
deleteLeadById DELETE /{userId}/leads/{leadId} Delete lead by Id
getAllLeads GET /{userId}/leads Get all leads
getLeadById GET /{userId}/leads/{leadId} Get lead by Id
getLeadFilters GET /{userId}/leads/filters Get all lead filters
getLeadsByFilter GET /{userId}/leads/filters/{filterId} Get all leads by filter
updateLeadById PUT /{userId}/leads/{leadId} Update lead by Id

createLead

Lead createLead(userId, body)

Creates a new lead

Example

var crms = require('saasgrids');
var defaultClient = crms.ApiClient.instance;

// Configure HTTP basic authorization: basicAuth
var basicAuth = defaultClient.authentications['basicAuth'];
basicAuth.username = 'YOUR USERNAME';
basicAuth.password = 'YOUR PASSWORD';

var apiInstance = new crms.LeadsApi();

var userId = "userId_example"; // String | User instance id returned from saasgrids after authorization

var body = new crms.Lead(); // Lead | Lead object that needs to be created

apiInstance.createLead(userId, body).then(function(data) {
  console.log('API called successfully. Returned data: ' + data);
}, function(error) {
  console.error(error);
});

Parameters

Name Type Description Notes
userId String User instance id returned from saasgrids after authorization
body Lead Lead object that needs to be created

Return type

Lead

Authorization

basicAuth

HTTP request headers

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

deleteLeadById

deleteLeadById(userId)

Delete lead by Id

Example

var crms = require('saasgrids');
var defaultClient = crms.ApiClient.instance;

// Configure HTTP basic authorization: basicAuth
var basicAuth = defaultClient.authentications['basicAuth'];
basicAuth.username = 'YOUR USERNAME';
basicAuth.password = 'YOUR PASSWORD';

var apiInstance = new crms.LeadsApi();

var userId = "userId_example"; // String | User instance id returned from saasgrids after authorization

apiInstance.deleteLeadById(userId).then(function() {
  console.log('API called successfully.');
}, function(error) {
  console.error(error);
});

Parameters

Name Type Description Notes
userId String User instance id returned from saasgrids after authorization

Return type

null (empty response body)

Authorization

basicAuth

HTTP request headers

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

getAllLeads

InlineResponse2001 getAllLeads(userId, email)

Get all leads

Example

var crms = require('saasgrids');
var defaultClient = crms.ApiClient.instance;

// Configure HTTP basic authorization: basicAuth
var basicAuth = defaultClient.authentications['basicAuth'];
basicAuth.username = 'YOUR USERNAME';
basicAuth.password = 'YOUR PASSWORD';

var apiInstance = new crms.LeadsApi();

var userId = "userId_example"; // String | User instance id returned from saasgrids after authorization

var email = "email_example"; // String | Email id of the lead

apiInstance.getAllLeads(userId, email).then(function(data) {
  console.log('API called successfully. Returned data: ' + data);
}, function(error) {
  console.error(error);
});

Parameters

Name Type Description Notes
userId String User instance id returned from saasgrids after authorization
email String Email id of the lead

Return type

InlineResponse2001

Authorization

basicAuth

HTTP request headers

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

getLeadById

Lead getLeadById(userId, leadId)

Get lead by Id

Example

var crms = require('saasgrids');
var defaultClient = crms.ApiClient.instance;

// Configure HTTP basic authorization: basicAuth
var basicAuth = defaultClient.authentications['basicAuth'];
basicAuth.username = 'YOUR USERNAME';
basicAuth.password = 'YOUR PASSWORD';

var apiInstance = new crms.LeadsApi();

var userId = "userId_example"; // String | User instance id returned from saasgrids after authorization

var leadId = "leadId_example"; // String | ObjectId of lead

apiInstance.getLeadById(userId, leadId).then(function(data) {
  console.log('API called successfully. Returned data: ' + data);
}, function(error) {
  console.error(error);
});

Parameters

Name Type Description Notes
userId String User instance id returned from saasgrids after authorization
leadId String ObjectId of lead

Return type

Lead

Authorization

basicAuth

HTTP request headers

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

getLeadFilters

InlineResponse2002 getLeadFilters(userId)

Get all lead filters

Example

var crms = require('saasgrids');
var defaultClient = crms.ApiClient.instance;

// Configure HTTP basic authorization: basicAuth
var basicAuth = defaultClient.authentications['basicAuth'];
basicAuth.username = 'YOUR USERNAME';
basicAuth.password = 'YOUR PASSWORD';

var apiInstance = new crms.LeadsApi();

var userId = "userId_example"; // String | User instance id returned from saasgrids after authorization

apiInstance.getLeadFilters(userId).then(function(data) {
  console.log('API called successfully. Returned data: ' + data);
}, function(error) {
  console.error(error);
});

Parameters

Name Type Description Notes
userId String User instance id returned from saasgrids after authorization

Return type

InlineResponse2002

Authorization

basicAuth

HTTP request headers

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

getLeadsByFilter

InlineResponse2001 getLeadsByFilter(userId, filterId)

Get all leads by filter

Example

var crms = require('saasgrids');
var defaultClient = crms.ApiClient.instance;

// Configure HTTP basic authorization: basicAuth
var basicAuth = defaultClient.authentications['basicAuth'];
basicAuth.username = 'YOUR USERNAME';
basicAuth.password = 'YOUR PASSWORD';

var apiInstance = new crms.LeadsApi();

var userId = "userId_example"; // String | User instance id returned from saasgrids after authorization

var filterId = "filterId_example"; // String | ObjectId of  filter

apiInstance.getLeadsByFilter(userId, filterId).then(function(data) {
  console.log('API called successfully. Returned data: ' + data);
}, function(error) {
  console.error(error);
});

Parameters

Name Type Description Notes
userId String User instance id returned from saasgrids after authorization
filterId String ObjectId of filter

Return type

InlineResponse2001

Authorization

basicAuth

HTTP request headers

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

updateLeadById

updateLeadById(userId, body)

Update lead by Id

Example

var crms = require('saasgrids');
var defaultClient = crms.ApiClient.instance;

// Configure HTTP basic authorization: basicAuth
var basicAuth = defaultClient.authentications['basicAuth'];
basicAuth.username = 'YOUR USERNAME';
basicAuth.password = 'YOUR PASSWORD';

var apiInstance = new crms.LeadsApi();

var userId = "userId_example"; // String | User instance id returned from saasgrids after authorization

var body = new crms.Lead(); // Lead | Lead object that needs to be updated

apiInstance.updateLeadById(userId, body).then(function() {
  console.log('API called successfully.');
}, function(error) {
  console.error(error);
});

Parameters

Name Type Description Notes
userId String User instance id returned from saasgrids after authorization
body Lead Lead object that needs to be updated

Return type

null (empty response body)

Authorization

basicAuth

HTTP request headers

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