- Joined
- Sep 12, 2020
- Messages
- 9
- Reaction score
- 2
I had an integration working with Pipedrive before the upgrade to V18 and still works until the point in Call Journaling where I need to do a POST with JSON. This works on the CRM template generator and logs the call but when running an actual call on the system I get this message on the 3cxSystemService.log:
Now, I already checked all my variables and I can't find what is this String that is not formatted correctly - Is there any change on the new version of 3CX that changes how these are sent? I don't see a way to check the actual body sent from the system but if I try sending this to the CRM API via Insomnia I don't get that error back
Here is the code for that scenario, I would appreciate the help.
2021/08/19 13:33:32.118|5657|0046|Verb|Processing scenario 'ReportCall-LogCall'.
2021/08/19 13:33:32.118|5657|0046|Verb|Creating new HttpClient for Basic authentication
2021/08/19 13:33:32.122|5657|0046|Erro|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.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)
Now, I already checked all my variables and I can't find what is this String that is not formatted correctly - Is there any change on the new version of 3CX that changes how these are sent? I don't see a way to check the actual body sent from the system but if I try sending this to the CRM API via Insomnia I don't get that error back
{"user_id":10673437,"to_phone_number":"521234567890","deal_id":10447,"outcome":"connected","start_time":"2021-08-19T18:29:19.6464384Z","end_time":"2021-08-19T18:34:19.6464663Z"}
Here is the code for that scenario, I would appreciate the help.
Code:
<Scenario Id="ReportCall-LogCall" Type="REST">
<Request SkipIf="[ReportCallEnabled]!=True" Url="https://api.pipedrive.com/v1/callLogs?api_token=[APIkey]" MessagePasses="0" RequestContentType="application/json" RequestEncoding="Json" RequestType="Post" ResponseType="Json">
<PostValues Key="">
<Value Key="user_id" Passes="1" Type="Integer">[CRMUserID]</Value>
<Value Key="to_phone_number" Passes="1" Type="String">[Number]</Value>
<Value Key="deal_id" Passes="1" Type="Integer">[Contact::DealId]</Value>
<Value Key="outcome" Passes="1" Type="String">"connected"</Value>
<Value Key="start_time" Passes="1" Type="String">[[CallStartTimeUTC].ToUniversalTime().ToString("o")]</Value>
<Value Key="end_time" Passes="1" Type="String">[[CallEndTimeUTC].ToUniversalTime().ToString("o")]</Value>
</PostValues>
</Request>
<Outputs AllowEmpty="false" />
</Scenario>



