Skip to content

Latest commit

 

History

History
373 lines (238 loc) · 9.47 KB

AccountsApi.md

File metadata and controls

373 lines (238 loc) · 9.47 KB

crms.AccountsApi

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

Method HTTP request Description
createAccount POST /{userId}/accounts Creates a new account
deleteAccountById DELETE /{userId}/account/{accountId} Delete account by Id
getAccountById GET /{userId}/account/{accountId} Get account by Id
getAccountFilters GET /{userId}/accounts/filters Get all account filters
getAccountsByFilter GET /{userId}/accounts/filters/{filterId} Get all accounts by filter
getAllAccounts GET /{userId}/accounts Get all accounts
updateAccountById PUT /{userId}/account/{accountId} Update account by Id

createAccount

createAccount(userId, body)

Creates a new account

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.AccountsApi();

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

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

apiInstance.createAccount(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 Account Account object that needs to be created

Return type

null (empty response body)

Authorization

basicAuth

HTTP request headers

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

deleteAccountById

deleteAccountById(userId)

Delete account 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.AccountsApi();

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

apiInstance.deleteAccountById(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

getAccountById

Account getAccountById(userId, accountId)

Get account 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.AccountsApi();

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

var accountId = "accountId_example"; // String | ObjectId of acount

apiInstance.getAccountById(userId, accountId).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
accountId String ObjectId of acount

Return type

Account

Authorization

basicAuth

HTTP request headers

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

getAccountFilters

InlineResponse2002 getAccountFilters(userId)

Get all account 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.AccountsApi();

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

apiInstance.getAccountFilters(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

getAccountsByFilter

InlineResponse2007 getAccountsByFilter(userId, filterId)

Get all accounts 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.AccountsApi();

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

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

apiInstance.getAccountsByFilter(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

InlineResponse2007

Authorization

basicAuth

HTTP request headers

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

getAllAccounts

InlineResponse2007 getAllAccounts(userId, email)

Get all accounts

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.AccountsApi();

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

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

apiInstance.getAllAccounts(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 account

Return type

InlineResponse2007

Authorization

basicAuth

HTTP request headers

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

updateAccountById

updateAccountById(userId, body)

Update account 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.AccountsApi();

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

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

apiInstance.updateAccountById(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 Account Account object that needs to be updated

Return type

null (empty response body)

Authorization

basicAuth

HTTP request headers

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