In this blog, we will show how to get ConnectWise to send ticket details to Power Automate automatically, allowing for a more cohesive flow between ConnectWise and Power Automate. The ConnectWise Callbacks are fairly straightforward, however, when linking into Power Automate, we encountered a few caveats we will show along the way.
Callbacks
As part of a recent project, I started to review the ConnectWise Manage Callbacks. If you don’t know what a Callback is, it is a way for ConnectWise to push a particular record to a specified website. Why is this important? It eliminates the need for querying the database or searching for new or updated records, as when a record is saved, the information is automatically sent.
Here is a link to the ConnectWise Manage Callback site: Manage Callbacks – Developer Network (connectwise.com)
- Please note that you will need a login to ConnectWise Developer
Create Power Automate HTML Request
Creating the Power Automate HTML Request is important to get the URL that will be utilized within the ConnectWise API Callback. When you add the action to the Automate package:
1. First create a new Automate Flow
2. Select Manually Trigger a Flow
- This will be replaced
3. Once the Automate is created, you can remove the Manually Trigger Flow and replace it with the following:
4. Before you can save, you will need to add an action. Many times for simplicity purposes, I just send an email to myself, so I added another step to send an email:
5. Now, once we save, the HTTP POST URL will appear
6. Once you have the URL showing, you can save it by clicking the copy button either now or later when we use it.
Create ConnectWise API Callback
There are probably many ways to create the ConnectWise API Callback, but the easiest way I found was through Postman.
By using Postman, we can easily set the Headers, along with the Body that will be sent to ConnectWise to set the Callback type and other details:
1. Here is what the Headers look like (Please note there are other articles on obtaining the Authorization, including one provided by Opal for Power BI Connection to REST API)
2. After the Headers are set up, we can then get the Body set up. The Body is in JSON format and there is a sample on the ConnectWise Developer site (link above), but for reference, here is the one that we utilized.
- URL – This is the URL from Power Automate
- NOTE: At the end of the URL, you need to add &. Otherwise, Power Automate will not pick up the information.
- Thanks to this forum for the details: Power Automate Webhook : ConnectWise (reddit.com)
- Description – This is the description that will be shown in the listing of API Callbacks in ConnectWise
- ObjectID – This is the Record ID that will be tracked based on the Type and Level
- Note that if Level is Owner – this would need to be a 1
- Type – This is the Type
- Level – This is the level of granularity that will be queried
3. Once everything is set up, you can click on the Send button and it will create the Callback in CW
- Response from Postman:
- Here is the line within ConnectWise:
- Zoomed:
4. Now that you have the above, your Power Automate should receive results. Let’s test.
Test the Callback
1. Let’s go back to the Power Automate and populate the Body of the HTTP Request.
[/av_textblock]
[av_textblock size=” font_color=” color=” av-medium-font-size=” av-small-font-size=” av-mini-font-size=” av_uid=’av-lcjflx6n’ id=” custom_class=” admin_preview_bg=”]
{
"type": "object"
"properties": {
"FromUrl": {
"type": "string"
},
"CompanyId": {
"type": "string"
},
"MemberId": {
"type": "string"
},
"Action": {
"type": "string"
},
"Type": {
"type": "string"
},
"ID": {
"type": "integer"
},
"Entity": {
"type": "string"
},
"Metadata": {
"type": "object",
"properties": {
"key_url": {
"type": "string"
}
}
},
"CallbackObjectRecId": {
"type": "integer"
}
}
}
[/av_textblock]
[av_textblock size=” font_color=” color=” av-medium-font-size=” av-small-font-size=” av-mini-font-size=” av_uid=’av-l0mifgvu’ id=” custom_class=” admin_preview_bg=’rgb(255, 255, 255)’]
2. Once the Body is populated, you can turn on the Flow and click Test.
3. Next, go to the Service Board you specified in the ObjectID above, and create a ticket.
4. When doing the Test, you should get the following results:
- Success
- Results from the HTTP Request
- Email in your mailbox
Conclusion
Now that we have successfully completed the Webhook/Callback from ConnectWise into Power Automate, you can start to develop new tools and capabilities.
One of the items we are working on, which should be released soon, is fixing the Catchall company within ConnectWise when a ticket is from a Vendor, but truly for a specific company. We are using the Callbacks for new tickets and have a Microsoft List that we track the logic and can then change the company through a Custom Connector, Ticket Patch.
As always, if you have questions or need assistance, please don’t hesitate to contact Opal. We are a consulting company, but we are also part of the community and are always willing to help companies get over hurdles.