Dokumentation för API-funktioner
GET CRM/Report/{customerId}/ViewingParticipant Request Information URI Parameters
NamnBeskrivningTypInformation
customerId string Krävs
ViewingStartDate Visningar från och med date

ViewingEndDate Visningar till och med date

CustomerIds Kund-id lista separerade med komma string

PageSize Max antal rader i varje anrop, Max 300 integer

PageIndex Sidnummer som ska hämtas, 0-indexerat integer

Response Information Resource Description CrmViewingParticipantReport
NamnBeskrivningTypInformation
Rows Collection of CrmViewingParticipantReportRow

TotalPageCount integer

Kodexempel

curl "https://connect.maklare.vitec.net/CRM/Report/StringValue/ViewingParticipant?ViewingStartDate=2015-01-01T12:00:00&ViewingEndDate=2015-01-01T12:00:00&CustomerIds=StringValue&PageSize=0&PageIndex=0" -X GET -H "Authorization: basic {Base64 kodad användarnamn och lösenord}" 
            

$URL = "https://connect.maklare.vitec.net/CRM/Report/StringValue/ViewingParticipant?ViewingStartDate=2015-01-01T12:00:00&ViewingEndDate=2015-01-01T12:00:00&CustomerIds=StringValue&PageSize=0&PageIndex=0"
Invoke-WebRequest -Uri $URL -Method GET -Headers @{"authorization" = "basic {Base64 kodad användarnamn och lösenord}"} 
                

// HttpClientInstance ska deklareras som en singleton
// public static readonly HttpClient HttpClientInstance = new HttpClient {
//     BaseAddress = new Uri("https://connect.maklare.vitec.net"),
//     DefaultRequestHeaders = {
//         Authorization = new AuthenticationHeaderValue("Basic", "{Base64 kodad användarnamn och lösenord}")
//     }
// }
using (var response = await HttpClientInstance.GetAsync("CRM/Report/StringValue/ViewingParticipant?ViewingStartDate=2015-01-01T12:00:00&ViewingEndDate=2015-01-01T12:00:00&CustomerIds=StringValue&PageSize=0&PageIndex=0")) {
    if (response.StatusCode == HttpStatusCode.Unauthorized) {
        // Authorization headern är inte korrekt
    }
    if (response.StatusCode == HttpStatusCode.Forbidden) {
        // Begärt data som det saknas åtkomst till
    }
    if (response.StatusCode == HttpStatusCode.InternalServerError) {
        // Oväntat fel, kontakta Vitec
    }
    if (response.StatusCode == HttpStatusCode.BadRequest) {
        var json = await response.Content.ReadAsStringAsync();
        var result = JsonConvert.DeserializeObject<dynamic>(json);
        // Hantera valideringsfel, presenteras i resultatet
    }
    
    var json = await response.Content.ReadAsStringAsync();
    // JsonConvert finns i biblioteket Newtonsoft.Json
    var result = JsonConvert.DeserializeObject<dynamic>(json);
    
    var rows = result.rows.Value;
    // TODO: Gör något med resultatet
}

$URL = "https://connect.maklare.vitec.net/CRM/Report/StringValue/ViewingParticipant?ViewingStartDate=2015-01-01T12:00:00&ViewingEndDate=2015-01-01T12:00:00&CustomerIds=StringValue&PageSize=0&PageIndex=0";

$ch = curl_init();

curl_setopt($ch, CURLOPT_USERNAME, "{Användarnamn}");
curl_setopt($ch, CURLOPT_PASSWORD, "{Lösenord}");
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_URL, $URL);

$result = curl_exec($ch);

if (curl_errno($ch)) {
    die(curl_getinfo($ch));
}

$info = curl_getinfo($ch);
curl_close($ch);

$http_code = $info["http_code"];
if ($http_code == 401) {
    // Användarnamnet eller lösenordet är felaktigt
}
if ($http_code == 403) {
    // Begärt data som det saknas åtkomst till
}
if ($http_code == 500) {
    // Oväntat fel, kontakta Vitec
}
if ($http_code == 400) {
    $json = json_decode($result, true);
    // Hantera valideringsfel, presenteras i $json
}

$field_on_result = $result["rows"];
// TODO: Gör något med resultatet
Testformulär Text input
Response Formats
{
  "rows": [
    {
      "contact": {
        "id": null,
        "firstName": "sample string 1",
        "lastName": "sample string 2",
        "cellPhone": "sample string 3",
        "email": "sample string 4"
      },
      "viewing": {
        "date": "2024-04-27T10:44:48.3876013+02:00"
      },
      "followedUp": "Completed",
      "estate": {
        "id": null,
        "streetAddress": "sample string 1",
        "zipCode": "sample string 2",
        "city": "sample string 3",
        "area": "sample string 4"
      },
      "office": {
        "customerId": "sample string 1",
        "name": "sample string 2"
      },
      "responsibleBroker": {
        "name": "sample string 1"
      }
    },
    {
      "contact": {
        "id": null,
        "firstName": "sample string 1",
        "lastName": "sample string 2",
        "cellPhone": "sample string 3",
        "email": "sample string 4"
      },
      "viewing": {
        "date": "2024-04-27T10:44:48.3876013+02:00"
      },
      "followedUp": "Completed",
      "estate": {
        "id": null,
        "streetAddress": "sample string 1",
        "zipCode": "sample string 2",
        "city": "sample string 3",
        "area": "sample string 4"
      },
      "office": {
        "customerId": "sample string 1",
        "name": "sample string 2"
      },
      "responsibleBroker": {
        "name": "sample string 1"
      }
    }
  ],
  "totalPageCount": 1
}
<CrmViewingParticipantReport xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://schemas.datacontract.org/2004/07/Express.Connect.Api.Models.Reports">
  <Rows>
    <CrmViewingParticipantReportRow>
      <Contact>
        <CellPhone>sample string 3</CellPhone>
        <Email>sample string 4</Email>
        <FirstName>sample string 1</FirstName>
        <Id xmlns:d5p1="http://schemas.datacontract.org/2004/07/Vitec.BusinessModel" i:nil="true" />
        <LastName>sample string 2</LastName>
      </Contact>
      <Estate>
        <Area>sample string 4</Area>
        <City>sample string 3</City>
        <Id xmlns:d5p1="http://schemas.datacontract.org/2004/07/Vitec.BusinessModel" i:nil="true" />
        <StreetAddress>sample string 1</StreetAddress>
        <ZipCode>sample string 2</ZipCode>
      </Estate>
      <FollowedUp>Completed</FollowedUp>
      <Office>
        <CustomerId>sample string 1</CustomerId>
        <Name>sample string 2</Name>
      </Office>
      <ResponsibleBroker>
        <Name>sample string 1</Name>
      </ResponsibleBroker>
      <Viewing>
        <Date>2024-04-27T10:44:48.3876013+02:00</Date>
      </Viewing>
    </CrmViewingParticipantReportRow>
    <CrmViewingParticipantReportRow>
      <Contact>
        <CellPhone>sample string 3</CellPhone>
        <Email>sample string 4</Email>
        <FirstName>sample string 1</FirstName>
        <Id xmlns:d5p1="http://schemas.datacontract.org/2004/07/Vitec.BusinessModel" i:nil="true" />
        <LastName>sample string 2</LastName>
      </Contact>
      <Estate>
        <Area>sample string 4</Area>
        <City>sample string 3</City>
        <Id xmlns:d5p1="http://schemas.datacontract.org/2004/07/Vitec.BusinessModel" i:nil="true" />
        <StreetAddress>sample string 1</StreetAddress>
        <ZipCode>sample string 2</ZipCode>
      </Estate>
      <FollowedUp>Completed</FollowedUp>
      <Office>
        <CustomerId>sample string 1</CustomerId>
        <Name>sample string 2</Name>
      </Office>
      <ResponsibleBroker>
        <Name>sample string 1</Name>
      </ResponsibleBroker>
      <Viewing>
        <Date>2024-04-27T10:44:48.3876013+02:00</Date>
      </Viewing>
    </CrmViewingParticipantReportRow>
  </Rows>
  <TotalPageCount>1</TotalPageCount>
</CrmViewingParticipantReport>