To create alerts in AlertOps when a ticket is created in Connectwise, begin by creating a new Inbound Integration in AlertOps.  This will provide the URL needed to configure a Callback in ConnectWise.

Create a new Inbound Integration by choosing the Inbound Integration sub-menu from the Integrations menu.  On the API tab (default) select Add API Integration.  On the Detail screen, choose ConnectWise Manage.

On the resulting page, enter the header information, including Integration Name (or keep the default), select an Escalation Rule to define the delivery of notifications, and select a Recipient Group.  Press Save.

Once you save the Integration, the Advanced Settings tab becomes available.  Select that tab and you will see the API URL at the top of the page.  This will be used to configure the Callback in ConnectWise Manage.

Expand the URL Mapping section.  

The Open and Close conditions for the template are mapped to the Entity^TicketStatus field in the inbound data.  The values provided are common words used in ConnectWise Manage ticket statuses, but if you have modified your status values in ConnectWise Manage, be sure to add the appropriate key words to the Open and/or Close conditions.  Save if you made any changes.

Setup the Callback in ConnectWise Manage.

ConnectWise Manage no longer uses the Integrator Login method for configuring callbacks, and callbacks must now be managed through the API.  This requires the use of an external tool (such as Postman), as well as API keys and a ClientID from ConnectWise.  

The API key and ClientID are used in our Outbound Integration with ConnectWise Manage, so if you've set that up first you can skip forward to the Creating the Callback section below, as the next steps are a duplicate of that process.

Generate API Keys and ClientID in ConnectWise Manage.

In ConnectWise Manage, we will create an API Member, and generate public/private keys for that Member.  We will use those keys to generate an API key for our Authentication Header.  We will then create a ClientID for our ClientID Header.

From the System menu, select Members.

From the Members page, select the API Members tab

Add a new Member by pressing the + button.  Provide a MemberID, and a Member Name.  Populate the other required fields, but make sure the Business Unit contains the board you want to post to.  Save.

Once saved, additional tabs become available.  Select the API Keys tab.

Press the + to add a new set of keys.

Add a description and press save.  The fields for Public and Private Keys will be populated with your keys.  As noted, copy these out for reference, as the Private Key will no longer be visible once you leave the page.

Next, we must create our header.  Refer to the ConnectWise Authentication document here (a free login to the CW Develper Network is required).  We will be using Member Authentication.  To produce the header, we follow this format:

Method 1 - API Keys - Member Authentication
It is recommended to create API Members versus using API Keys tied to a specific member.
Authorization: Basic base64(companyid+publickey:privatekey)
(Authorization: Basic Y29tcGFueWlkK3B1YmxpY2tleTpwcml2YXRla2V5)

For the next step, there are a number of free web sites which can provide the necessary base 64 encoding. 

https://www.base64encode.net/

Use the described format explicitly, including the "+" and ":"

companyid+publickey:privatekey

You can find your companyid on your login page for ConnectWise Manage

Once you encode the keys, the result will look similar to this:

Y29tcGFueWlkK3B1YmxpY2tleTpwcml2YXRla2V5

What we will enter into the Header in AlertOps will be as follows:

Basic Y29tcGFueWlkK3B1YmxpY2tleTpwcml2YXRla2V5

Now, we need a ClientID for our other Header.  Use this link  (a free login to the CW Develper Network is required) to create a ClientID for your organization.  At the bottom of that page you can Create New Integration, which will produce a ClientID that can be used for all API interactions with ConnectWise Manage.  

Creating the Callback

From here, we will use Postman to send the calls to the ConnectWise API.  As callbacks tend to be relatively static, set and forget items, this represents a practical means by which we can interact with the API to create them, with the rest of the configuration taking place in the AlertOps interface.

We will use two GET requests and one POST to create the callback.  The first GET is to determine the ID of the board we wish to generate alerts from.  The second GET will display all current Callbacks.  The POST will create a Callback.

Within Postman, press the New button, and choose Request.  Provide a name for the request, choose or create a collection, and save the request.  Your new request should default to the GET function.  You will need to enter a URL, and two Headers. The Headers consist of an Authentication and a ClientID header.  These will be populated by the items above, the API key and the ClientID.  The URL is:

https://yourconnectwiseinstance/version/apis/3.0/service/boards?fields=id,name

for example:

https://staging.connectwisedev.com/v2020_1/apis/3.0/service/boards?fields=id,name

In the above example, the URL and Headers are present, and when the request runs the output shows the available boards and their IDs.  We are looking at the Integration board for this example, and it has an ID of 2.

To list the existing callbacks, right click on the request tab and choose Duplicate Tab. This will preserve the Headers in a new tab.  Change the URL, as we are now querying the callbacks table:

https://staging.connectwisedev.com/v2020_1/apis/3.0/system/callbacks

This is useful to check both before and after creating a callback.

Next, to create the callback, duplicate the tab again and change the method to POST. We will use the same URL as the one above, addressing the callbacks table.  This time, we will add data to the Body section of the request.  This data will define the callback:

{
     "id": 0,
     "description": "Integration Board Tickets",
     "url": "AlertOps Integration API URL from above",
     "objectId": 2,
     "type": "Ticket",
     "level":"board",
     "memberId": 0,
     "inactiveFlag": "false"
}

In the above example, you will need to edit the description, the URL, and the objectid.  The description is simply what you want to name the callback.  The URL is the API URL from the inbound integration in AlertOps created in the first steps of this guide. The objectid is the board ID from the first GET request above.  The request should look like this:

Once the callback has been posted, you can switch back to the previous tab, rerun the GET to list the callbacks, and your new callback should be visible. 

Now, when a ticket is created on the configured board, it will be sent to the AlertOps Integration to generate an alert.

Did this answer your question?