# saasgrids

crms - JavaScript client for saasgrids
Saasgrids CRM grid
This SDK is automatically generated by the [Swagger Codegen](https://github.com/swagger-api/swagger-codegen) project:

- API version: 1.0.0
- Package version: 1.0.0
- Build package: io.swagger.codegen.languages.JavascriptClientCodegen

## Installation

### For [Node.js](https://nodejs.org/)

#### npm

To publish the library as a [npm](https://www.npmjs.com/),
please follow the procedure in ["Publishing npm packages"](https://docs.npmjs.com/getting-started/publishing-npm-packages).

Then install it via:

```shell
npm install saasgrids --save
```

##### Local development

To use the library locally without publishing to a remote npm registry, first install the dependencies by changing 
into the directory containing `package.json` (and this README). Let's call this `JAVASCRIPT_CLIENT_DIR`. Then run:

```shell
npm install
```

Next, [link](https://docs.npmjs.com/cli/link) it globally in npm with the following, also from `JAVASCRIPT_CLIENT_DIR`:

```shell
npm link
```

Finally, switch to the directory you want to use your saasgrids from, and run:

```shell
npm link /path/to/<JAVASCRIPT_CLIENT_DIR>
```

You should now be able to `require('saasgrids')` in javascript files from the directory you ran the last 
command above from.

#### git
#
If the library is hosted at a git repository, e.g.
https://github.com/GIT_USER_ID/GIT_REPO_ID
then install it via:

```shell
    npm install GIT_USER_ID/GIT_REPO_ID --save
```

### For browser

The library also works in the browser environment via npm and [browserify](http://browserify.org/). After following
the above steps with Node.js and installing browserify with `npm install -g browserify`,
perform the following (assuming *main.js* is your entry file, that's to say your javascript file where you actually 
use this library):

```shell
browserify main.js > bundle.js
```

Then include *bundle.js* in the HTML pages.

### Webpack Configuration

Using Webpack you may encounter the following error: "Module not found: Error:
Cannot resolve module", most certainly you should disable AMD loader. Add/merge
the following section to your webpack config:

```javascript
module: {
  rules: [
    {
      parser: {
        amd: false
      }
    }
  ]
}
```

## Getting Started

Please follow the [installation](#installation) instruction and execute the following JS code:

```javascript
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 api = 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

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


```

## Documentation for API Endpoints

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

Class | Method | HTTP request | Description
------------ | ------------- | ------------- | -------------
*crms.AccountsApi* | [**createAccount**](docs/AccountsApi.md#createAccount) | **POST** /{userId}/accounts | Creates a new account
*crms.AccountsApi* | [**deleteAccountById**](docs/AccountsApi.md#deleteAccountById) | **DELETE** /{userId}/account/{accountId} | Delete account by Id
*crms.AccountsApi* | [**getAccountById**](docs/AccountsApi.md#getAccountById) | **GET** /{userId}/account/{accountId} | Get account by Id
*crms.AccountsApi* | [**getAccountFilters**](docs/AccountsApi.md#getAccountFilters) | **GET** /{userId}/accounts/filters | Get all account filters
*crms.AccountsApi* | [**getAccountsByFilter**](docs/AccountsApi.md#getAccountsByFilter) | **GET** /{userId}/accounts/filters/{filterId} | Get all accounts by filter
*crms.AccountsApi* | [**getAllAccounts**](docs/AccountsApi.md#getAllAccounts) | **GET** /{userId}/accounts | Get all accounts
*crms.AccountsApi* | [**updateAccountById**](docs/AccountsApi.md#updateAccountById) | **PUT** /{userId}/account/{accountId} | Update account by Id
*crms.AppointmentsApi* | [**createAppointment**](docs/AppointmentsApi.md#createAppointment) | **POST** /{userId}/appointments | Creates a new appointment
*crms.AppointmentsApi* | [**deleteAppointmentsById**](docs/AppointmentsApi.md#deleteAppointmentsById) | **DELETE** /{userId}/appointments/{appointmentId} | Delete appointments by Id
*crms.AppointmentsApi* | [**getAllAppointments**](docs/AppointmentsApi.md#getAllAppointments) | **GET** /{userId}/appointments | Get all appointments
*crms.AppointmentsApi* | [**getAppointmentById**](docs/AppointmentsApi.md#getAppointmentById) | **GET** /{userId}/appointments/{appointmentId} | Get appointment by Id
*crms.AppointmentsApi* | [**updateAppointmentById**](docs/AppointmentsApi.md#updateAppointmentById) | **PUT** /{userId}/appointments/{appointmentId} | Update appointment by Id
*crms.CallsApi* | [**createCall**](docs/CallsApi.md#createCall) | **POST** /{userId}/calls | Creates a new call
*crms.CallsApi* | [**deleteCallById**](docs/CallsApi.md#deleteCallById) | **DELETE** /{userId}/calls/{callId} | Delete call by Id
*crms.CallsApi* | [**getAllCalls**](docs/CallsApi.md#getAllCalls) | **GET** /{userId}/calls | Get all calls
*crms.CallsApi* | [**getCallById**](docs/CallsApi.md#getCallById) | **GET** /{userId}/calls/{callId} | Get call by Id
*crms.CallsApi* | [**updateCallById**](docs/CallsApi.md#updateCallById) | **PUT** /{userId}/calls/{callId} | Update call by Id
*crms.ContactsApi* | [**createContact**](docs/ContactsApi.md#createContact) | **POST** /{userId}/contacts | Creates a new contact
*crms.ContactsApi* | [**deleteContactById**](docs/ContactsApi.md#deleteContactById) | **DELETE** /{userId}/contacts/{contactId} | Delete contact by Id
*crms.ContactsApi* | [**getContactByFilter**](docs/ContactsApi.md#getContactByFilter) | **GET** /{userId}/contacts/filters/{filterId} | Get all contacts by filter
*crms.ContactsApi* | [**getContactById**](docs/ContactsApi.md#getContactById) | **GET** /{userId}/contacts/{contactId} | Get contact by Id
*crms.ContactsApi* | [**getContactFilters**](docs/ContactsApi.md#getContactFilters) | **GET** /{userId}/contacts/filters | Get all contact filters
*crms.ContactsApi* | [**getContactProperties**](docs/ContactsApi.md#getContactProperties) | **GET** /{userId}/contacts/properties | Get all contact properties
*crms.ContactsApi* | [**getContacts**](docs/ContactsApi.md#getContacts) | **GET** /{userId}/contacts | Get contacts
*crms.ContactsApi* | [**getContactsByEmail**](docs/ContactsApi.md#getContactsByEmail) | **GET** /{userId}/contacts/email/{email} | Get all contacts by email
*crms.ContactsApi* | [**updateContactById**](docs/ContactsApi.md#updateContactById) | **PUT** /{userId}/contacts/{contactId} | Update contact by Id
*crms.DealsApi* | [**createDeals**](docs/DealsApi.md#createDeals) | **POST** /{userId}/deals | Creates a new deals
*crms.DealsApi* | [**deleteDealById**](docs/DealsApi.md#deleteDealById) | **DELETE** /{userId}/deal/{dealId} | Delete deal by Id
*crms.DealsApi* | [**getAllDeal**](docs/DealsApi.md#getAllDeal) | **GET** /{userId}/deals | Get all deal
*crms.DealsApi* | [**getDealById**](docs/DealsApi.md#getDealById) | **GET** /{userId}/deal/{dealId} | Get deal by Id
*crms.DealsApi* | [**updateDealById**](docs/DealsApi.md#updateDealById) | **PUT** /{userId}/deal/{dealId} | Update deal by Id
*crms.EmailsApi* | [**createEmail**](docs/EmailsApi.md#createEmail) | **POST** /{userId}/emails | Creates a new email
*crms.EmailsApi* | [**deleteEmailById**](docs/EmailsApi.md#deleteEmailById) | **DELETE** /{userId}/emails/{emailObjectId} | Delete email by Id
*crms.EmailsApi* | [**getAllEmails**](docs/EmailsApi.md#getAllEmails) | **GET** /{userId}/emails | Get all emails
*crms.EmailsApi* | [**getEmailById**](docs/EmailsApi.md#getEmailById) | **GET** /{userId}/emails/{emailObjectId} | Get email by Id
*crms.EmailsApi* | [**updateEmailById**](docs/EmailsApi.md#updateEmailById) | **PUT** /{userId}/emails/{emailObjectId} | Update email by Id
*crms.LeadsApi* | [**createLead**](docs/LeadsApi.md#createLead) | **POST** /{userId}/leads | Creates a new lead
*crms.LeadsApi* | [**deleteLeadById**](docs/LeadsApi.md#deleteLeadById) | **DELETE** /{userId}/leads/{leadId} | Delete lead by Id
*crms.LeadsApi* | [**getAllLeads**](docs/LeadsApi.md#getAllLeads) | **GET** /{userId}/leads | Get all leads
*crms.LeadsApi* | [**getLeadById**](docs/LeadsApi.md#getLeadById) | **GET** /{userId}/leads/{leadId} | Get lead by Id
*crms.LeadsApi* | [**getLeadFilters**](docs/LeadsApi.md#getLeadFilters) | **GET** /{userId}/leads/filters | Get all lead filters
*crms.LeadsApi* | [**getLeadsByFilter**](docs/LeadsApi.md#getLeadsByFilter) | **GET** /{userId}/leads/filters/{filterId} | Get all leads by filter
*crms.LeadsApi* | [**updateLeadById**](docs/LeadsApi.md#updateLeadById) | **PUT** /{userId}/leads/{leadId} | Update lead by Id
*crms.NotesApi* | [**createNote**](docs/NotesApi.md#createNote) | **POST** /{userId}/notes | Creates a new note
*crms.NotesApi* | [**deleteNoteById**](docs/NotesApi.md#deleteNoteById) | **DELETE** /{userId}/note/{noteId} | Delete note by Id
*crms.NotesApi* | [**getAllNotes**](docs/NotesApi.md#getAllNotes) | **GET** /{userId}/notes | Get all notes
*crms.NotesApi* | [**getNoteById**](docs/NotesApi.md#getNoteById) | **GET** /{userId}/note/{noteId} | Get note by Id
*crms.NotesApi* | [**updateNoteById**](docs/NotesApi.md#updateNoteById) | **PUT** /{userId}/note/{noteId} | Update note by Id
*crms.TasksApi* | [**createTask**](docs/TasksApi.md#createTask) | **POST** /{userId}/tasks | Creates a new task
*crms.TasksApi* | [**deleteTaskById**](docs/TasksApi.md#deleteTaskById) | **DELETE** /{userId}/tasks/{taskId} | Delete task by Id
*crms.TasksApi* | [**getAllTasks**](docs/TasksApi.md#getAllTasks) | **GET** /{userId}/tasks | Get all tasks
*crms.TasksApi* | [**getTaskById**](docs/TasksApi.md#getTaskById) | **GET** /{userId}/tasks/{taskId} | Get task by Id
*crms.TasksApi* | [**updateTaskById**](docs/TasksApi.md#updateTaskById) | **PUT** /{userId}/tasks/{taskId} | Update task by Id
*crms.UsersApi* | [**getUsers**](docs/UsersApi.md#getUsers) | **GET** /{userId}/users/{email} | Get all users


## Documentation for Models

 - [crms.Account](docs/Account.md)
 - [crms.Appointment](docs/Appointment.md)
 - [crms.Call](docs/Call.md)
 - [crms.Contact](docs/Contact.md)
 - [crms.Customfield](docs/Customfield.md)
 - [crms.Deal](docs/Deal.md)
 - [crms.Email](docs/Email.md)
 - [crms.Field](docs/Field.md)
 - [crms.Filter](docs/Filter.md)
 - [crms.InlineResponse200](docs/InlineResponse200.md)
 - [crms.InlineResponse2001](docs/InlineResponse2001.md)
 - [crms.InlineResponse2002](docs/InlineResponse2002.md)
 - [crms.InlineResponse2003](docs/InlineResponse2003.md)
 - [crms.InlineResponse2004](docs/InlineResponse2004.md)
 - [crms.InlineResponse2005](docs/InlineResponse2005.md)
 - [crms.InlineResponse2006](docs/InlineResponse2006.md)
 - [crms.InlineResponse2007](docs/InlineResponse2007.md)
 - [crms.Lead](docs/Lead.md)
 - [crms.Note](docs/Note.md)
 - [crms.Task](docs/Task.md)
 - [crms.User](docs/User.md)


## Documentation for Authorization


### basicAuth

- **Type**: HTTP basic authentication

