mirror of https://github.com/vernonkeenan/lib
7.7 KiB
7.7 KiB
Crm.ContactsApi
All URIs are relative to http://crm.vernonkeenan.com:8080/v1
| Method | HTTP request | Description |
|---|---|---|
| deleteContact | DELETE /contacts | Delete a Contact |
| getContacts | GET /contacts | Get a list of contacts |
| getContactsObservable | GET /contacts/observable | Get Taxnexus Contacts in an observable array |
| postContacts | POST /contacts | Add new contacts |
| putContacts | PUT /contacts | Update Contact |
deleteContact
DeleteResponse deleteContact(opts)
Delete a Contact
Delete Taxnexus Contact 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.ContactsApi();
let opts = {
'contactId': "contactId_example" // String | Taxnexus Contact record ID
};
apiInstance.deleteContact(opts, (error, data, response) => {
if (error) {
console.error(error);
} else {
console.log('API called successfully. Returned data: ' + data);
}
});
Parameters
| Name | Type | Description | Notes |
|---|---|---|---|
| contactId | String | Taxnexus Contact record ID | [optional] |
Return type
Authorization
HTTP request headers
- Content-Type: Not defined
- Accept: application/json
getContacts
ContactResponse getContacts(opts)
Get a list of contacts
Return a list of all available Contacts
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.ContactsApi();
let opts = {
'limit': 789, // Number | How many objects to return at one time
'offset': 789, // Number | How many objects to skip?
'contactId': "contactId_example", // String | Taxnexus Contact record ID
'active': true, // Boolean | Only retrieve active records?
'email': "email_example", // String | Email address used for identity lookup
'name': "name_example" // String | The Name of this Object
};
apiInstance.getContacts(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] |
| contactId | String | Taxnexus Contact record ID | [optional] |
| active | Boolean | Only retrieve active records? | [optional] |
| String | Email address used for identity lookup | [optional] | |
| name | String | The Name of this Object | [optional] |
Return type
Authorization
HTTP request headers
- Content-Type: Not defined
- Accept: application/json
getContactsObservable
[Contact] getContactsObservable(opts)
Get Taxnexus Contacts in an observable array
A list of contacts 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.ContactsApi();
let opts = {
'contactId': "contactId_example", // String | Taxnexus Contact record ID
'active': true, // Boolean | Only retrieve active records?
'email': "email_example", // String | Email address used for identity lookup
'name': "name_example" // String | The Name of this Object
};
apiInstance.getContactsObservable(opts, (error, data, response) => {
if (error) {
console.error(error);
} else {
console.log('API called successfully. Returned data: ' + data);
}
});
Parameters
| Name | Type | Description | Notes |
|---|---|---|---|
| contactId | String | Taxnexus Contact record ID | [optional] |
| active | Boolean | Only retrieve active records? | [optional] |
| String | Email address used for identity lookup | [optional] | |
| name | String | The Name of this Object | [optional] |
Return type
Authorization
HTTP request headers
- Content-Type: Not defined
- Accept: application/json
postContacts
ContactResponse postContacts(contactsRequest)
Add new contacts
Contact 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.ContactsApi();
let contactsRequest = new Crm.ContactRequest(); // ContactRequest | An array of new Contact records
apiInstance.postContacts(contactsRequest, (error, data, response) => {
if (error) {
console.error(error);
} else {
console.log('API called successfully. Returned data: ' + data);
}
});
Parameters
| Name | Type | Description | Notes |
|---|---|---|---|
| contactsRequest | ContactRequest | An array of new Contact records |
Return type
Authorization
HTTP request headers
- Content-Type: application/json
- Accept: application/json
putContacts
ContactResponse putContacts(contactsRequest)
Update Contact
Update Contact records
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.ContactsApi();
let contactsRequest = new Crm.ContactRequest(); // ContactRequest | An array of new Contact records
apiInstance.putContacts(contactsRequest, (error, data, response) => {
if (error) {
console.error(error);
} else {
console.log('API called successfully. Returned data: ' + data);
}
});
Parameters
| Name | Type | Description | Notes |
|---|---|---|---|
| contactsRequest | ContactRequest | An array of new Contact records |
Return type
Authorization
HTTP request headers
- Content-Type: application/json
- Accept: application/json