3CX Integration Issues with Dentally

Status
Not open for further replies.
Hoping you can help me again! my SMS Chats aren't logging which is a pain. I also can't find the requests in my phone system log to see what might be going wrong.

<Scenario Id="ReportChat" Type="REST">
<Request SkipIf="[ReportChatEnabled]!=True" Url="https://app.loxo.co/api/the-comm-guys/person_events" MessagePasses="0" RequestContentType="x-www-form-urlencoded" RequestEncoding="UrlEncoded" RequestType="Post" ResponseType="Json">
<Headers>
<Value Key="Authorization">Bearer d0cf2ebc6170b32023d852721daa0e2355b3c2064502a347b13dd6ec15c533f63fab849923b4bc38bdb2d1a7f0d97c9ca3fe459dbd35159a82d50dc164e0ea992828621131aafbbe99c42fd99bbeaccdbe9b2826f48471798b7e580e71b638684974ebc2423ce9dece862f6fe3859acb3dbfc61e384f18720ab8e0d77ba77c5c</Value>
</Headers>
<PostValues Key="">
<Value Key="person_event[activity_type_id]" Passes="1" Type="Integer"> 1539711</Value>
<Value Key="person_event[notes]" Passes="1" Type="String">[[ChatMessages].Replace("","").Replace("","&lt;br/&gt;").Replace("\","")]</Value>
<Value Key="person_event[person_id]" Passes="1" Type="Integer"> "[EntityId]"</Value>
</PostValues>
</Request>
<Variables />
<Outputs AllowEmpty="false" />
</Scenario>
</Scenarios>
</Crm>
 
Found the Logs!

2024/08/23 15:52:13.478|0022|Debg| CRM: Obtained 1 pending chat conversations, processing them.
2024/08/23 15:52:13.482|0022|Info| CRM: Start reporting chat with ConversationID=65
2024/08/23 15:52:13.486|0022|Debg| [Integration.Crm.Engine.ResultVariableScenarioProcessor] CRM: Processing scenario 'ReportChat'.
2024/08/23 15:52:13.486|0022|Debg| [Integration.Crm.Engine.NoAuthHttpClientProvider] CRM: Creating new HttpClient with no authentication
2024/08/23 15:52:13.487|0022|Debg| [Integration.Crm.Engine.ResultVariableScenarioProcessor] CRM: Performing POST request to 'https://app.loxo.co' with following form values:
2024/08/23 15:52:13.487|0022|Debg| [Integration.Crm.Engine.ResultVariableScenarioProcessor] CRM: 'person_event[activity_type_id]' = ' 1539711'
2024/08/23 15:52:13.492|0022|Erro| [Integration.Crm.Engine.CrmProcessor] CRM: Exception during chat reporting
System.Reflection.TargetInvocationException: Exception has been thrown by the target of an invocation.
---> System.ArgumentException: The value cannot be an empty string. (Parameter 'oldValue')
at System.ArgumentException.ThrowNullOrEmptyException(String argument, String paramName)
at System.String.Replace(String oldValue, String newValue)
at System.RuntimeMethodHandle.InvokeMethod(Object target, Void** arguments, Signature sig, Boolean isConstructor)
at System.Reflection.MethodBaseInvoker.InvokeDirectByRefWithFewArgs(Object obj, Span`1 copyOfArgs, BindingFlags invokeAttr)
--- End of inner exception stack trace ---
 
Hi, just having a go but this isnt my day job!! :oops:

Not surw what to do next, or how to test properly in the 3CX template tool before uploading - only need contact mathing and telephone numbers...

Also not sure how to link the API token to complete auth in the config?

Can you help pls?? thanks
 

Attachments

Looks like you're trying to replace an empty string with another empty string, here:
[ChatMessages].Replace("","")
 
Hi, just having a go but this isnt my day job!! :oops:

Not surw what to do next, or how to test properly in the 3CX template tool before uploading - only need contact mathing and telephone numbers...

Also not sure how to link the API token to complete auth in the config?

Can you help pls?? thanks
Hi!

Looks like you're attempting to use 0Auth but you should set the authorisation to none on the wizard (if using the wizard) and then add the API Key as a header in your Get request. Example Below. Hope this helps!

<Request Url="https://api.dentally.co/v1/patients?query=[Number]" MessagePasses="0" RequestEncoding="UrlEncoded" RequestType="Get" ResponseType="Json">
<Headers>
<Value Key="Authorization"> Bearer YOUR_BEARER_TOKEN</Value>
<Value Key="User-Agent"> 3cxintegration</Value>
</Headers>
</Request>
 
  • Like
Reactions: Evolute IT
  • Like
Reactions: ReeceWallace
Status
Not open for further replies.

Latest Posts

Forum statistics

Threads
111,893
Messages
589,598
Members
164,763
Latest member
Techmansam