Autotask CRM & 3CX - Call Journaling

Status
Not open for further replies.

bnichols_

Silver Partner
Basic Certified
Joined
Jul 19, 2022
Messages
3
Reaction score
1
In relation to the forum post: https://www.3cx.com/community/threads/autotask-new-rest-api-integration.74665/#post-342347
Shout out to Chris Ellsaesser for sharing the template and notes.

Regarding post 9:
  1. This script uses user impersonation based on the extension listed in the Autotask Resource list. For best results, populate these as well as enable API impersonation rights in the security level permissions. The default API security level will not have enough permissions.
    Confirmed and have added the relevant extension for each resource.
  2. The ATActionType is set to '1' but for some reason is not visible in the CRM integration. This integer represents what kind of Autotask note action is created (e.g. 'Phone call', 'Email' etc.) and can affect whether or not calendar items or to dos get created. Make sure to set this to an integer that suits what you require.
    I've confirmed that the ATActionType ID of 1 is showing a as phone call.
    Code:
    {  "item": {
        "id": 1,
        "name": "Phone Call",
        "isActive": true,
        "isSystemActionType": true,
        "view": 3
      }
    }
  3. The integration should auto-detect your Autotask zone so it should only require you create an API user within Autotask for it to work.
    API User created, with the adjusted default security level to allow for impersonation of resources.
  4. This is still a work in progress and does not offer contact creation as of yet. Any feedback or recommendations would be appreciated :)
    This is a fantastic resource for MSPs!

The client lookup and new ticket is working perfectly. The issue is with Call Journalling which is enabled in CRM settings.
I'm getting an error in log file (with Verbose enabled) - 3cxSystemServer.log
Code:
2022/07/20 17:45:05.267|2330|0064|Verb|CRM: Processing scenario 'ReportCallInbound'.
2022/07/20 17:45:05.267|2330|0064|Verb|CRM: Creating new HttpClient with no authentication
2022/07/20 17:45:05.269|2330|0064|Erro|CRM: Exception during call reporting: System.FormatException: Input string was not in a correct format.
   at System.Number.ThrowOverflowOrFormatException(ParsingStatus status, TypeCode type)
   at CrmIntegration.ScenarioProcessorBase.CreateJsonFromPostValues(RequestItem requestItem, IValueManager customManager)
   at CrmIntegration.ScenarioProcessorBase.ProcessRequest(ScenarioRequest request, IValueManager customManager, HttpClient client, CancellationToken token)
   at CrmIntegration.ScenarioProcessorBase.ProcessScenario(ProtocolScenario scenario, IValueManager customManager, CancellationToken token)
   at CrmIntegration.ScenarioProcessorBase.ProcessMatching(ProtocolScenario scenario, MatchingPath matching, ResponseMatcher responseMatcher, IValueManager customManager, HashSet`1 distinctMatchings, CancellationToken token)
   at CrmIntegration.ScenarioProcessorBase.ProcessFoundMatchings(ProtocolScenario scenario, IValueManager customManager, List`1 matchings, ResponseMatcher responseMatcher, CancellationToken token)
   at CrmIntegration.ScenarioProcessorBase.ProcessScenario(ProtocolScenario scenario, IValueManager customManager, CancellationToken token)
   at CrmIntegration.ScenarioProcessorBase.ProcessMatching(ProtocolScenario scenario, MatchingPath matching, ResponseMatcher responseMatcher, IValueManager customManager, HashSet`1 distinctMatchings, CancellationToken token)
   at CrmIntegration.ScenarioProcessorBase.ProcessFoundMatchings(ProtocolScenario scenario, IValueManager customManager, List`1 matchings, ResponseMatcher responseMatcher, CancellationToken token)
   at CrmIntegration.ScenarioProcessorBase.ProcessScenario(ProtocolScenario scenario, IValueManager customManager, CancellationToken token)
   at CrmIntegration.ScenarioProcessorBase.Execute(ProtocolScenario scenario, CancellationToken token)
   at CrmIntegration.CrmProcessor.ExecuteScenarioByName(String scenarioName, IEnumerable`1 parameters, Boolean useNoAuthProvider, CancellationToken token)
   at CrmIntegration.CrmProcessor.ExecuteScenarioWithRetries(String scenarioId, Dictionary`2 parameters, CancellationToken token)
   at CrmIntegration.CrmProcessor.ReportCall(CallEndedEvent callEndedEvent, CancellationToken token)
2022/07/20 17:45:15.808|2330|0009|Verb|Enqueue Updated.REGISTRAR.1

Would anyone be able to comment on which field is trying to be parsed as an input string that is NOT the correct format based on the above error?

Thanks again to all who have worked on the integration with Autotask
 
I will be honest, we had a client using that base template for integration, and it never worked correctly.

Autotask API is crap and doesn't work half the time with this template. Also, it would require modifications to make it work with v18.
 
  • Like
Reactions: Marconi
Autotask API is crap and doesn't work half the time with this template. Also, it would require modifications to make it work with v18.
I have written software that accesses the Autotask API (both REST and the old SOAP API) and it is not an easy process. The REST API is significantly easier to use than the SOAP one but is severely limited in many areas. That, plus the fact that the Autotask documentation really needs to be re-written, means that integrating Autotask and 3CX is going to be a difficult process.

To @bnichols_, I would start by looking at what your formatting/definitions are for "CompletedDateTime", "EndDateTime" and "StartDateTime" as those appear to be the only ones passed to the Autotask API as strings. Remember, the Autotask REST API expects DateTime values to be in UTC format and (last time I used it) with no timezone offset specified.

Good luck.
 
  • Like
Reactions: Evolute IT

@bnichols_

I will be honest, we had a client using that base template for integration, and it never worked correctly.

Autotask API is crap and doesn't work half the time with this template. Also, it would require modifications to make it work with v18.
Did you come right?
I've got the same error and am using 18.0 Update 7.

Does anybody have this working and would be willing to help me troubleshoot my setup?
 

@bnichols_


Did you come right?
I've got the same error and am using 18.0 Update 7.

Does anybody have this working and would be willing to help me troubleshoot my setup?
We haven't touched it in a long time, but maybe things have changed and we could make it work somehow. We have done a lot of workarounds with time since then.
 
We had an example a year ago. The customer implemented integration based on Webhook Generator. But for a very long time he adjusted events through his own middleware
 
  • Like
Reactions: dananon
Status
Not open for further replies.

Forum statistics

Threads
111,973
Messages
590,077
Members
164,896
Latest member
sameage