lib/client/crm/docs/AccountsApi.md

291 lines
7.8 KiB
Markdown

# Crm.AccountsApi
All URIs are relative to *http://crm.vernonkeenan.com:8080/v1*
Method | HTTP request | Description
------------- | ------------- | -------------
[**deleteAccount**](AccountsApi.md#deleteAccount) | **DELETE** /accounts | Delete An Account
[**getAccounts**](AccountsApi.md#getAccounts) | **GET** /accounts | Get a list of accounts
[**getAccountsObservable**](AccountsApi.md#getAccountsObservable) | **GET** /accounts/observable | Get Taxnexus Accounts in an observable array
[**postAccounts**](AccountsApi.md#postAccounts) | **POST** /accounts | Add a new account to Taxnexus
[**putAccount**](AccountsApi.md#putAccount) | **PUT** /accounts | Update a single account
## deleteAccount
> DeleteResponse deleteAccount(opts)
Delete An Account
Delete Taxnexus Account record
### Example
```javascript
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.AccountsApi();
let opts = {
'accountId': "accountId_example" // String | Taxnexus Record Id of an Account
};
apiInstance.deleteAccount(opts, (error, data, response) => {
if (error) {
console.error(error);
} else {
console.log('API called successfully. Returned data: ' + data);
}
});
```
### Parameters
Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
**accountId** | **String**| Taxnexus Record Id of an Account | [optional]
### Return type
[**DeleteResponse**](DeleteResponse.md)
### Authorization
[ApiKeyAuth](../README.md#ApiKeyAuth)
### HTTP request headers
- **Content-Type**: Not defined
- **Accept**: application/json
## getAccounts
> AccountResponse getAccounts(opts)
Get a list of accounts
Return a list of all available Accounts
### Example
```javascript
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.AccountsApi();
let opts = {
'limit': 789, // Number | How many objects to return at one time
'name': "name_example", // String | The Name of this Object
'offset': 789, // Number | How many objects to skip?
'active': true, // Boolean | Only retrieve active records?
'accountId': "accountId_example", // String | Taxnexus Record Id of an Account
'email': "email_example" // String | Email address used for identity lookup
};
apiInstance.getAccounts(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]
**name** | **String**| The Name of this Object | [optional]
**offset** | **Number**| How many objects to skip? | [optional]
**active** | **Boolean**| Only retrieve active records? | [optional]
**accountId** | **String**| Taxnexus Record Id of an Account | [optional]
**email** | **String**| Email address used for identity lookup | [optional]
### Return type
[**AccountResponse**](AccountResponse.md)
### Authorization
[ApiKeyAuth](../README.md#ApiKeyAuth)
### HTTP request headers
- **Content-Type**: Not defined
- **Accept**: application/json
## getAccountsObservable
> [Account] getAccountsObservable(opts)
Get Taxnexus Accounts in an observable array
A list of accounts in a simple JSON array
### Example
```javascript
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.AccountsApi();
let opts = {
'name': "name_example", // String | The Name of this Object
'active': true, // Boolean | Only retrieve active records?
'accountId': "accountId_example", // String | Taxnexus Record Id of an Account
'email': "email_example" // String | Email address used for identity lookup
};
apiInstance.getAccountsObservable(opts, (error, data, response) => {
if (error) {
console.error(error);
} else {
console.log('API called successfully. Returned data: ' + data);
}
});
```
### Parameters
Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
**name** | **String**| The Name of this Object | [optional]
**active** | **Boolean**| Only retrieve active records? | [optional]
**accountId** | **String**| Taxnexus Record Id of an Account | [optional]
**email** | **String**| Email address used for identity lookup | [optional]
### Return type
[**[Account]**](Account.md)
### Authorization
[ApiKeyAuth](../README.md#ApiKeyAuth)
### HTTP request headers
- **Content-Type**: Not defined
- **Accept**: application/json
## postAccounts
> AccountResponse postAccounts(accountRequest)
Add a new account to Taxnexus
Account record to be added
### Example
```javascript
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.AccountsApi();
let accountRequest = new Crm.AccountRequest(); // AccountRequest | An array of new Account records
apiInstance.postAccounts(accountRequest, (error, data, response) => {
if (error) {
console.error(error);
} else {
console.log('API called successfully. Returned data: ' + data);
}
});
```
### Parameters
Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
**accountRequest** | [**AccountRequest**](AccountRequest.md)| An array of new Account records |
### Return type
[**AccountResponse**](AccountResponse.md)
### Authorization
[ApiKeyAuth](../README.md#ApiKeyAuth)
### HTTP request headers
- **Content-Type**: application/json
- **Accept**: application/json
## putAccount
> AccountResponse putAccount(accountRequest)
Update a single account
Update a single account specified by accountId
### Example
```javascript
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.AccountsApi();
let accountRequest = new Crm.AccountRequest(); // AccountRequest | An array of new Account records
apiInstance.putAccount(accountRequest, (error, data, response) => {
if (error) {
console.error(error);
} else {
console.log('API called successfully. Returned data: ' + data);
}
});
```
### Parameters
Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
**accountRequest** | [**AccountRequest**](AccountRequest.md)| An array of new Account records |
### Return type
[**AccountResponse**](AccountResponse.md)
### Authorization
[ApiKeyAuth](../README.md#ApiKeyAuth)
### HTTP request headers
- **Content-Type**: application/json
- **Accept**: application/json