mirror of https://github.com/vernonkeenan/lib
7.8 KiB
7.8 KiB
Crm.AccountsApi
All URIs are relative to http://crm.vernonkeenan.com:8080/v1
Method | HTTP request | Description |
---|---|---|
deleteAccount | DELETE /accounts | Delete An Account |
getAccounts | GET /accounts | Get a list of accounts |
getAccountsObservable | GET /accounts/observable | Get Taxnexus Accounts in an observable array |
postAccounts | POST /accounts | Add a new account to Taxnexus |
putAccount | PUT /accounts | Update a single account |
deleteAccount
DeleteResponse deleteAccount(opts)
Delete An Account
Delete Taxnexus Account 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.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
Authorization
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
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] |
String | Email address used for identity lookup | [optional] |
Return type
Authorization
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
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] |
String | Email address used for identity lookup | [optional] |
Return type
Authorization
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
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 | An array of new Account records |
Return type
Authorization
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
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 | An array of new Account records |
Return type
Authorization
HTTP request headers
- Content-Type: application/json
- Accept: application/json