mirror of https://github.com/vernonkeenan/lib
7.1 KiB
7.1 KiB
Crm.AssetsApi
All URIs are relative to http://crm.vernonkeenan.com:8080/v1
Method | HTTP request | Description |
---|---|---|
deleteAsset | DELETE /assets | Delete An Asset |
getAssets | GET /assets | Get a list of assets |
getAssetsObservable | GET /assets/observable | Get Taxnexus Assets in an observable array |
postAssets | POST /assets | Add a new asset to Taxnexus |
putAsset | PUT /assets | Update a single asset |
deleteAsset
DeleteResponse deleteAsset(opts)
Delete An Asset
Delete Taxnexus Asset 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.AssetsApi();
let opts = {
'assetId': "assetId_example" // String | Taxnexus Record Id of an Asset
};
apiInstance.deleteAsset(opts, (error, data, response) => {
if (error) {
console.error(error);
} else {
console.log('API called successfully. Returned data: ' + data);
}
});
Parameters
Name | Type | Description | Notes |
---|---|---|---|
assetId | String | Taxnexus Record Id of an Asset | [optional] |
Return type
Authorization
HTTP request headers
- Content-Type: Not defined
- Accept: application/json
getAssets
AssetResponse getAssets(opts)
Get a list of assets
Return a list of all available Assets
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.AssetsApi();
let opts = {
'limit': 789, // Number | How many objects to return at one time
'offset': 789, // Number | How many objects to skip?
'accountId': "accountId_example", // String | Taxnexus Record Id of an Account
'assetId': "assetId_example" // String | Taxnexus Record Id of an Asset
};
apiInstance.getAssets(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] |
accountId | String | Taxnexus Record Id of an Account | [optional] |
assetId | String | Taxnexus Record Id of an Asset | [optional] |
Return type
Authorization
HTTP request headers
- Content-Type: Not defined
- Accept: application/json
getAssetsObservable
[Asset] getAssetsObservable(opts)
Get Taxnexus Assets in an observable array
A list of assets 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.AssetsApi();
let opts = {
'accountId': "accountId_example", // String | Taxnexus Record Id of an Account
'assetId': "assetId_example" // String | Taxnexus Record Id of an Asset
};
apiInstance.getAssetsObservable(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] |
assetId | String | Taxnexus Record Id of an Asset | [optional] |
Return type
Authorization
HTTP request headers
- Content-Type: Not defined
- Accept: application/json
postAssets
AssetResponse postAssets(assetRequest)
Add a new asset to Taxnexus
Asset 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.AssetsApi();
let assetRequest = new Crm.AssetRequest(); // AssetRequest | An array of new Asset records
apiInstance.postAssets(assetRequest, (error, data, response) => {
if (error) {
console.error(error);
} else {
console.log('API called successfully. Returned data: ' + data);
}
});
Parameters
Name | Type | Description | Notes |
---|---|---|---|
assetRequest | AssetRequest | An array of new Asset records |
Return type
Authorization
HTTP request headers
- Content-Type: application/json
- Accept: application/json
putAsset
AssetResponse putAsset(assetRequest)
Update a single asset
Update a single asset specified by assetId
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.AssetsApi();
let assetRequest = new Crm.AssetRequest(); // AssetRequest | An array of new Asset records
apiInstance.putAsset(assetRequest, (error, data, response) => {
if (error) {
console.error(error);
} else {
console.log('API called successfully. Returned data: ' + data);
}
});
Parameters
Name | Type | Description | Notes |
---|---|---|---|
assetRequest | AssetRequest | An array of new Asset records |
Return type
Authorization
HTTP request headers
- Content-Type: application/json
- Accept: application/json