lib/client/crm/docs/ContractsApi.md

283 lines
7.3 KiB
Markdown
Raw Permalink Normal View History

2022-09-03 21:10:56 +00:00
# Crm.ContractsApi
All URIs are relative to *http://crm.vernonkeenan.com:8080/v1*
Method | HTTP request | Description
------------- | ------------- | -------------
[**deleteContract**](ContractsApi.md#deleteContract) | **DELETE** /contracts | Delete An Contract
[**getContracts**](ContractsApi.md#getContracts) | **GET** /contracts | Get a list of contracts
[**getContractsObservable**](ContractsApi.md#getContractsObservable) | **GET** /contracts/observable | Get Taxnexus Contracts in an observable array
[**postContracts**](ContractsApi.md#postContracts) | **POST** /contracts | Add a new contract to Taxnexus
[**putContract**](ContractsApi.md#putContract) | **PUT** /contracts | Update a single contract
## deleteContract
> DeleteResponse deleteContract(opts)
Delete An Contract
Delete Taxnexus Contract 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.ContractsApi();
let opts = {
'contractId': "contractId_example" // String | Taxnexus Contact record ID
};
apiInstance.deleteContract(opts, (error, data, response) => {
if (error) {
console.error(error);
} else {
console.log('API called successfully. Returned data: ' + data);
}
});
```
### Parameters
Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
**contractId** | **String**| Taxnexus Contact record ID | [optional]
### Return type
[**DeleteResponse**](DeleteResponse.md)
### Authorization
[ApiKeyAuth](../README.md#ApiKeyAuth)
### HTTP request headers
- **Content-Type**: Not defined
- **Accept**: application/json
## getContracts
> ContractResponse getContracts(opts)
Get a list of contracts
Return a list of all available Contracts
### 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.ContractsApi();
let opts = {
'limit': 789, // Number | How many objects to return at one time
'offset': 789, // Number | How many objects to skip?
'active': true, // Boolean | Only retrieve active records?
'contractId': "contractId_example" // String | Taxnexus Contact record ID
};
apiInstance.getContracts(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]
**offset** | **Number**| How many objects to skip? | [optional]
**active** | **Boolean**| Only retrieve active records? | [optional]
**contractId** | **String**| Taxnexus Contact record ID | [optional]
### Return type
[**ContractResponse**](ContractResponse.md)
### Authorization
[ApiKeyAuth](../README.md#ApiKeyAuth)
### HTTP request headers
- **Content-Type**: Not defined
- **Accept**: application/json
## getContractsObservable
> [Contract] getContractsObservable(opts)
Get Taxnexus Contracts in an observable array
A list of contracts 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.ContractsApi();
let opts = {
'active': true, // Boolean | Only retrieve active records?
'contractId': "contractId_example" // String | Taxnexus Contact record ID
};
apiInstance.getContractsObservable(opts, (error, data, response) => {
if (error) {
console.error(error);
} else {
console.log('API called successfully. Returned data: ' + data);
}
});
```
### Parameters
Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
**active** | **Boolean**| Only retrieve active records? | [optional]
**contractId** | **String**| Taxnexus Contact record ID | [optional]
### Return type
[**[Contract]**](Contract.md)
### Authorization
[ApiKeyAuth](../README.md#ApiKeyAuth)
### HTTP request headers
- **Content-Type**: Not defined
- **Accept**: application/json
## postContracts
> ContractResponse postContracts(contractsRequest)
Add a new contract to Taxnexus
Contract 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.ContractsApi();
let contractsRequest = new Crm.ContractRequest(); // ContractRequest | An array of new Contract records
apiInstance.postContracts(contractsRequest, (error, data, response) => {
if (error) {
console.error(error);
} else {
console.log('API called successfully. Returned data: ' + data);
}
});
```
### Parameters
Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
**contractsRequest** | [**ContractRequest**](ContractRequest.md)| An array of new Contract records |
### Return type
[**ContractResponse**](ContractResponse.md)
### Authorization
[ApiKeyAuth](../README.md#ApiKeyAuth)
### HTTP request headers
- **Content-Type**: application/json
- **Accept**: application/json
## putContract
> ContractResponse putContract(contractsRequest)
Update a single contract
Update a single contract specified by contractId
### 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.ContractsApi();
let contractsRequest = new Crm.ContractRequest(); // ContractRequest | An array of new Contract records
apiInstance.putContract(contractsRequest, (error, data, response) => {
if (error) {
console.error(error);
} else {
console.log('API called successfully. Returned data: ' + data);
}
});
```
### Parameters
Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
**contractsRequest** | [**ContractRequest**](ContractRequest.md)| An array of new Contract records |
### Return type
[**ContractResponse**](ContractResponse.md)
### Authorization
[ApiKeyAuth](../README.md#ApiKeyAuth)
### HTTP request headers
- **Content-Type**: application/json
- **Accept**: application/json