SearchContacts liefert kein Ergebnis

o.steiner

Silver Partner
Basic Certified
Mitglied seit
23. Oktober 2023
Beiträge
8
Hallo,
ich bin etwas am Verzweifeln mit meinem CRM-Template. Die Name/Nummeranzeige bei eingehenden Anrufen funktioniert einwandfrei. Die Kontakte werden auch im 3CX Telefonbuch gespeichert.

Bei SearchContacts sehe ich im API-Log auch die Suche und die Rückgabe der Daten. Mit Postman klappt die Abfrage auch - also muss es wohl irgendwie an der Zuordnung der Outputs liegen. Da hab ich schon meiner Meinung nach alle Varianten ausprobiert - leider ohne Erfolg. Hat jemand einen Tipp was nicht passt?

Vielen Dank

Oliver

Postman Ausgabe:
JSON:
{
    "results": [
        {
            "type": "company",
            "id": 32,
            "firstname": "Lustig",
            "lastname": "GmbH",
            "address": null,
            "zip": null,
            "city": null,
            "phone": "0123456789",
            "mobile": null,
            "email": null,
            "url": "https://test.test/company/32"
        },
        {
            "type": "company",
            "id": 33,
            "firstname": "Lustig AG",
            "lastname": null,
            "address": null,
            "zip": null,
            "city": null,
            "phone": "098765432",
            "mobile": null,
            "email": null,
            "url": "https://test.test/company/33"
        },
        {
            "type": "company",
            "id": 34,
            "firstname": "Lustig GmbH & Co. KG",
            "lastname": null,
            "address": null,
            "zip": null,
            "city": null,
            "phone": "11223344",
            "mobile": null,
            "email": null,
            "url": "https://test.test/company/34"
        }
    ]
}

mein Scenario:
XML:
<Scenario Id="SearchContacts" Type="REST">
      <Request SkipIf="" Url="[Domain]/api/lookup/search?search=[SearchText]" MessagePasses="0" Message="" RequestContentType="" RequestEncoding="UrlEncoded" RequestType="Get" ResponseType="Json">
        <Headers>
          <Value Key="Authorization" Passes="0" Type="String">Bearer [APIkey]</Value>
        </Headers>
      </Request>
      <Rules>
        <Rule Type="Any">id</Rule>
      </Rules>
      <Variables>
        <Variable Name="ContactID" Path="id"><Filter /></Variable>
        <Variable Name="FirstName" Path="firstname"><Filter /></Variable>
        <Variable Name="LastName" Path="lastname"><Filter /></Variable>
        <Variable Name="CompanyName" Path="company"><Filter /></Variable>
        <Variable Name="Email" Path="email"><Filter /></Variable>
        <Variable Name="PhoneBusiness" Path="phone"><Filter /></Variable>
        <Variable Name="PhoneMobile" Path="mobile"><Filter /></Variable>
        <Variable Name="ContactUrl" Path="url"><Filter /></Variable>
      </Variables>
      <Outputs AllowEmpty="false">
        <Output Type="ContactID" Passes="0" Value="[results.id]" />
        <Output Type="FirstName" Passes="0" Value="[results.firstname]" />
        <Output Type="LastName" Passes="0" Value="[results.lastname]" />
        <Output Type="Email" Passes="0" Value="[results.email]" />
        <Output Type="PhoneBusiness" Passes="0" Value="[results.phone]" />
        <Output Type="PhoneMobile" Passes="0" Value="[results.mobile]" />
        <Output Type="ContactUrl" Passes="0" Value="[results.url]" />
        <Output Type="EntityId" Passes="0" Value="[results.id]" />
        <Output Type="EntityType" Passes="0" Value="Contacts" />
      </Outputs>
    </Scenario>
 
Ich habe es gelöst. Falls mal jemand auch so ein Problem hat hier die Lösung:
XML:
    <Scenario Id="SearchContacts" Type="REST">
      <Request SkipIf="" Url="[Domain]/api/lookup/search?search=[SearchText]" MessagePasses="0" Message="" RequestContentType="" RequestEncoding="UrlEncoded" RequestType="Get" ResponseType="Json">
        <Headers>
          <Value Key="Authorization" Passes="0" Type="String">Bearer [APIkey]</Value>
        </Headers>
      </Request>
  <Rules>
    <Rule Type="Any">results.id</Rule>
  </Rules>
  <Variables>
    <Variable Name="ContactID" Path="results.id"><Filter /></Variable>
    <Variable Name="FirstName" Path="results.firstname"><Filter /></Variable>
    <Variable Name="LastName" Path="results.lastname"><Filter /></Variable>
    <Variable Name="CompanyName" Path="results.company"><Filter /></Variable>
    <Variable Name="Email" Path="results.email"><Filter /></Variable>
    <Variable Name="PhoneBusiness" Path="results.phone"><Filter /></Variable>
    <Variable Name="PhoneMobile" Path="results.mobile"><Filter /></Variable>
    <Variable Name="ContactUrl" Path="results.url"><Filter /></Variable>
  </Variables>
  <Outputs AllowEmpty="true">
    <Output Type="ContactID" Passes="0" Value="[ContactID]" />
    <Output Type="FirstName" Passes="0" Value="[FirstName]" />
    <Output Type="LastName" Passes="0" Value="[LastName]" />
    <Output Type="CompanyName" Passes="0" Value="[FirstName] [LastName]" />
    <Output Type="Email" Passes="0" Value="[Email]" />
    <Output Type="PhoneBusiness" Passes="0" Value="[PhoneBusiness]" />
    <Output Type="PhoneMobile" Passes="0" Value="[PhoneMobile]" />
    <Output Type="ContactUrl" Passes="0" Value="[ContactUrl]" />
    <Output Type="EntityId" Passes="0" Value="[ContactID]" />
    <Output Type="EntityType" Passes="0" Value="Contacts" />
  </Outputs>
    </Scenario>
 

Statistik des Forums

Themen
44.414
Beiträge
232.721
Mitglieder
78.331
Neuestes Mitglied
b2daniel