Help please with XML for CRM integration

Status
Not open for further replies.

Darryl123

Joined
Oct 26, 2023
Messages
7
Reaction score
1
Hi guys,

I have an XML file with headers within the request but when I upload it the headers disappear. Would someone kindly help point me in the right direction?


Here is my XML file:


actual.PNG



This is what it looks like when uploaded. No headers within the request :)

uploaded.PNG
 
Up front I've never done CRM integrations in 3CX.

But are you sure you're using the correct syntax?

https://www.3cx.com/docs/crm-template-xml-description/
is telling me the syntax is
<Header>
<Value Key="Accept">application/vnd.api+json</Value>
<Value Key="Authorization">Bearer ...</Value>
</Headers>

maybe I'm also wrong but it looks like the wrong syntax.
 
Hi Guys,

Getting somewhere with this. My XML now makes the call and we get the error that:

CRM Integration is working OK but contact number does not exist. Check log for more info or try a different number.


The number does exist but I think we have a differing format when trying to match? Here is the output (with sensitve data xxxxx'd):


Started scenario with empty id
Request text: https://street.co.uk/open-api/v1/people?filter[telephone_number]=+447944693251
Response text: {"data":[{"type":"person","id":"f6b48e8f-6931-4865-a0a4-c5b478f96046","attributes":{"full_name":"xxxxxxxxx","title":null,"first_name":"xxxxxxxx","last_name":"xxxxxxxx","address":{"single_line":"Canterbury Road, Colchester, CO2 7RY","anon_single_line":"Canterbury Road, Colchester, CO2","building_number":"","building_name":null,"line_1":"97 Canterbury Road","line_2":"Colchester","line_3":null,"line_4":null,"country":"United Kingdom","postcode":"CO2 7RY","geo":{"lat":51.8797019,"lng":0.911709}},"telephone_numbers":[{"value":"07944 693251","notes":"","primary":true}],"email_addresses":[{"value":"xxxxxxxxxxxxxxxxx","notes":null,"primary":true}],"marketing_consent":true,"contact_preferences":{"email":true,"phone":true,"text":true,"post":true},"created_at":"2022-11-19T12:46:45+00:00","updated_at":"2023-10-13T16:53:20+01:00"},"links":{"self":"https:\/\/street.co.uk\/open-api\/person\/f6b48e8f-6931-4865-a0a4-c5b478f96046"},"relationships":{"ownedProperties":{"links":{"self":"https:\/\/street.co.uk\/open-api\/person\/f6b48e8f-6931-4865-a0a4-c5b478f96046\/relationships\/ownedProperties","related":"https:\/\/street.co.uk\/open-api\/person\/f6b48e8f-6931-4865-a0a4-c5b478f96046\/ownedProperties"}},"applicants":{"links":{"self":"https:\/\/street.co.uk\/open-api\/person\/f6b48e8f-6931-4865-a0a4-c5b478f96046\/relationships\/applicants","related":"https:\/\/street.co.uk\/open-api\/person\/f6b48e8f-6931-4865-a0a4-c5b478f96046\/applicants"}}}}],"meta":{"pagination":{"total":1,"count":1,"per_page":30,"current_page":1,"total_pages":1}},"links":{"self":"https:\/\/street.co.uk\/open-api\/v1\/people?filter%5Btelephone_number%5D=%2B447944693251&page%5Bnumber%5D=1","first":"https:\/\/street.co.uk\/open-api\/v1\/people?filter%5Btelephone_number%5D=%2B447944693251&page%5Bnumber%5D=1","last":"https:\/\/street.co.uk\/open-api\/v1\/people?filter%5Btelephone_number%5D=%2B447944693251&page%5Bnumber%5D=1"}}
Response finished
Variable ContactID set to f6b48e8f-6931-4865-a0a4-c5b478f96046
Variable FirstName set to xxxxxxxx
Variable LastName set to xxxxxxxx
Variable CompanyName set to Canterbury Road, Colchester, CO2 7RY
Variable Email set to xxxxxxxxxxxxxxxx
Variable PhoneBusiness set to
Variable PhoneBusiness2 set to
Variable PhoneMobile set to
Variable PhoneMobile2 set to
Finished scenario with empty id
 
The problem is that you're searching with the number in E164 format +447944693251, but then the response contains the number with a different prefix: 07944 693251

That will cause that the returned contact record is discarded. You need the phone number being searched returned by the CRM.

Also, the path you're using is incorrect:
data[0].attributes.telephone_numbers[0].value

To match that, you will need:
XML:
<Variable Name="PhoneBusiness" Path="data.attributes.telephone_numbers.value">
    <Filter>
        <Rule Type="Equals" Ethalon="true">data.attributes.telephone_numbers.primary</Rule>
    </Filter>
</Variable>
 
  • Like
Reactions: Evolute IT
Status
Not open for further replies.

Latest Posts

Forum statistics

Threads
112,322
Messages
591,886
Members
165,469
Latest member
footandankle.my3fcx.us