You can authenticate with ConnectWise to create your own instance of the ConnectWise CRM REST element through the UI or through APIs. Once authenticated, you can use the element instance to access the different functionality offered by the ConnectWise platform.
Authenticate Through the UI
Use the UI to authenticate with ConnectWise and create an element instance as described in Authenticate an Element Instance (UI). In addition to the base authentication parameters, you will need the connectwise server URL, company, public key, private key and the connectwise.clientID
as mandatory fields to provision an instance.
After successfully authenticating, we give you several options for next steps. Make requests using the API docs associated with the instance, map the instance to a virtual data resource, or use it in a formula template.
Authenticate Through API
Authenticating through API is similar to authenticating via the UI. Instead of clicking and typing through a series of buttons, text boxes, and menus, you will instead send a request to our /instances
endpoint. The end result is the same, though: an authenticated element instance with a token and id.
To authenticate an element instance:
Construct a JSON body as shown below (see Parameters):
{ "element": { "key": "connectwisecrmrest" }, "configuration": { "baseURL": "https://api-<MYCONNECTWISE.COM>/v4_6_release/apis/3.0", "company": "cloudelements", "public.key": "xxxxxxxxxxxxxxx", "private.key": "xxxxxxxxxxxxxxxxxxxxxxxx", "connectwise.clientID": "<CLIENT_ID>" }, "tags": [ "Docs" ], "name": "ConnectWise_Instance" }
Call the following, including the JSON body you constructed in the previous step:
POST /instances
Note: Make sure that you include the User and Organization keys in the header. For more information, see Authorization Headers, Organization Secret, and User Secret.Locate the
token
andid
in the response and save them for all future requests using the element instance.
Example cURL
curl -X POST \
https://api.cloud-elements.com/elements/api-v2/instances \
-H 'Authorization: User <INSERT>, Organization <INSERT>' \
-H 'content-type: application/json' \
-d '{
"element": {
"key": "connectwisecrmrest"
},
"configuration": {
"baseUrl": "https://api-<MYCONNECTWISE.COM/v4_6_release/apis/3.0>",
"company": "cloudelements",
"public.key": "xxxxxxxxxxxxxx",
"private.key": "xxxxxxxxxxxxxxxxxxxxxxxx",
"connectwise.clientID": "<CLIENT_ID>"
},
"tags": [
"Docs"
],
"name": "ConnectWise_Instance"
}
'
Parameters
API parameters not shown in Cloud Elements are in code formatting
.
Heading | Heading | Data Type |
---|---|---|
'key' | The element key.connectwisecrmrest | string |
Namename | The name for the element instance created during authentication. | Body |
Connectwise URLbaseUrl | The url of your ConnectWise site with api- appended.Be sure to add your url only to the siteURL section of the entire URL, so the entire value looks like: https://<api-myconnectwise.com>/v4_6_release/apis/3.0 .Where <api-myconnectwise.com> is one of the following:
| string |
Companycompany | The company name that you use to log in. | string |
Public Keyconnectwise.clientID | The Connectwise Client ID from ConnectWise. See API Provider Setup. | |
Public Keypublic.key | The Public Key from ConnectWise. See API Provider Setup. | string |
Private Keyprivate.key | The Private Key from ConnectWise. See API Provider Setup. | string |
Filter null values from the responsefilter.response.nulls | Optional. Determines if null values in the response JSON should be filtered from the response. Yes or true indicates that Cloud Elements will filter null values.Default: true | boolean |
Example Response for an Authenticated Element Instance
In this example, the instance ID is 12345
and the instance token starts with "ABC/D...". The actual values returned to you will be unique: make sure you save them for future requests to this new instance.
{
"id": 123456,
"name": "<INSTANCE_NAME>",
"createdDate": "2019-09-23T19:15:00Z",
"token": "<TOKEN>",
"elementId": 1234,
"tags": [],
"provisionInteractions": [],
"valid": true,
"disabled": false,
"maxCacheSize": 0,
"cacheTimeToLive": 0,
"configuration": {
"base.url": "{baseUrl}",
"bulk.add_metadata": null,
"event.notification.subscription.id": null,
"event.notification.basic.username": "",
"private.key": "********",
"event.vendor.type": "polling",
"filter.response.nulls": "true",
"bulk.query.date_mask": "yyyy-MM-dd'T'HH:mm:ss'Z'",
"bulk.attribute.created_time": "_info.lastUpdated",
"pagination.type": "page",
"bulk.relations": null,
"bulk_upload_recover": "true",
"company": "xxxxxxxxx",
"event.notification.enabled": "false",
"allow.select.fields": "false",
"default.select.fields.map": null,
"webhookId": "",
"bulk.query.field_name": "lastUpdated",
"pagination.max": "200",
"public.key": "xxxxxxxx",
"event.notification.basic.password": "********",
"bulk.query.operator": ">=",
"connectwise.clientid": "xxxxxxxxxxxxxxxxxxxx",
"baseUrl": "<BASE_URL>",
"bulk.query.download_format": "JSON",
"event.poller.refresh_interval": "15",
"event.notification.callback.url": "false",
"authentication.time": "",
"event.poller.configuration": "{\"contacts\":{\"url\":\"/hubs/crm/contacts?where=lastUpdated>'${gmtDate:yyyy-MM-dd'T'HH:mm:ss'Z'}'\",\"idField\":\"id\",\"datesConfiguration\":{\"updatedDateField\":\"_info.lastUpdated\",\"updatedDateFormat\":\"yyyy-MM-dd'T'HH:mm:ss'Z'\",\"updatedDateTimezone\":\"GMT\",\"createdDateField\":\"_info.lastUpdated\",\"createdDateFormat\":\"yyyy-MM-dd'T'HH:mm:ss'Z'\",\"createdDateTimezone\":\"GMT\"}},\"incidents\":{\"url\":\"/hubs/crm/incidents?where=lastUpdated>'${gmtDate:yyyy-MM-dd'T'HH:mm:ss'Z'}'\",\"idField\":\"id\",\"datesConfiguration\":{\"updatedDateField\":\"_info.lastUpdated\",\"updatedDateFormat\":\"yyyy-MM-dd'T'HH:mm:ss'Z'\",\"updatedDateTimezone\":\"GMT\",\"createdDateField\":\"dateEntered\",\"createdDateFormat\":\"yyyy-MM-dd'T'HH:mm:ss'Z'\",\"createdDateTimezone\":\"GMT\"}},\"organizations\":{\"url\":\"/hubs/crm/organizations?where=lastUpdated>'${gmtDate:yyyy-MM-dd'T'HH:mm:ss'Z'}'\",\"idField\":\"id\",\"datesConfiguration\":{\"updatedDateField\":\"_info.lastUpdated\",\"updatedDateFormat\":\"yyyy-MM-dd'T'HH:mm:ss'Z'\",\"updatedDateTimezone\":\"GMT\",\"createdDateField\":\"_info.lastUpdated\",\"createdDateFormat\":\"yyyy-MM-dd'T'HH:mm:ss'Z'\",\"createdDateTimezone\":\"GMT\"}},\"configurations\":{\"url\":\"/hubs/crm/configurations?where=lastUpdated>'${gmtDate:yyyy-MM-dd'T'HH:mm:ss'Z'}'\",\"idField\":\"\",\"datesConfiguration\":{\"updatedDateField\":\"_info.lastUpdated\",\"updatedDateFormat\":\"yyyy-MM-dd'T'HH:mm:ss'Z'\",\"updatedDateTimezone\":\"GMT\",\"createdDateField\":\"_info.lastUpdated\",\"createdDateFormat\":\"yyyy-MM-dd'T'HH:mm:ss'Z'\",\"createdDateTimezone\":\"GMT\"}},\"opportunities\":{\"url\":\"/hubs/crm/opportunities?where=lastUpdated>'${gmtDate:yyyy-MM-dd'T'HH:mm:ss'Z'}'\",\"idField\":\"id\",\"datesConfiguration\":{\"updatedDateField\":\"_info.lastUpdated\",\"updatedDateFormat\":\"yyyy-MM-dd'T'HH:mm:ss'Z'\",\"updatedDateTimezone\":\"GMT\",\"createdDateField\":\"_info.lastUpdated\",\"createdDateFormat\":\"yyyy-MM-dd'T'HH:mm:ss'Z'\",\"createdDateTimezone\":\"GMT\"}}}",
"pagination.page.startindex": "1"
}...,
"authenticationType": "custom",
"eventsEnabled": false,
"eventsNotificationCallbackUrl": "false",
"cachingEnabled": false,
"traceLoggingEnabled": false,
"organizationId": xxxxx,
"accountId": xxxxxxx,
"externalAuthentication": "none",
"userId": xxxxxxx,
"element": {
"id": xxxxxx,
"name": "ConnectWise CRM REST",
"key": "connectwisecrmrest",
"description": "Add a ConnectWise Instance to connect your existing ConnectWise account to the crm Hub, allowing you to manage contacts , organizations and incidents across multiple Elements. You will need your ConnectWise account and ConnectWise information to add an instance.",
"image": "elements/provider_connectwise.png",
"logo": "connectwisecrm",
"active": true,
"deleted": false,
"typeOauth": false,
"trialAccount": false,
"resources": [...],
"objects": [...],
"models": [...],
"transformationsEnabled": true,
"bulkDownloadEnabled": true,
"bulkUploadEnabled": true,
"cloneable": true,
"extendable": true,
"beta": false,
"authentication": {...},
"extended": false,
"useModelsForMetadata": true,
"hub": "crm",
"protocolType": "http",
"parameters": [...],
"private": false
},
"user": {}
}