Dokumentation för API-funktioner
POST Interest/SendInterestOnEstate Skickar in intresseanmälan från en befintlig kontakt till en bostad. Request Information Body Parameters Intresseanmälan InterestOnEstate
NamnBeskrivningTypInformation
CustomerId KundId string Kundid krävs.
Kundid måste vara mellan 0 och 40 tecken
EstateId Objektid string Objektid krävs.
Objektid måste vara mellan 0 och 40 tecken
ContactId Kontaktid string Kontaktid krävs.
Note Anteckning string

InterestNote Intresseanteckning. string

PresentAccommodation Nuvarande boende PresentAccommodation

Task En uppgift som ska läggas till. Task

NotifyUser Notifiera handläggaren på bostaden att intresseanmälan inkommit boolean

Request Formats

{
  "customerId": "sample string 1",
  "estateId": "sample string 2",
  "contactId": "sample string 3",
  "note": "sample string 4",
  "interestNote": "sample string 5",
  "presentAccommodation": {
    "estateType": "House",
    "livingSpace": 1.1,
    "numberOfRooms": 1.1,
    "price": 1.1,
    "other": "sample string 1",
    "coordinate": {
      "longitud": 1.1,
      "latitud": 2.1
    }
  },
  "task": {
    "predefinedTaskId": "sample string 1",
    "note": "sample string 2",
    "estateId": "sample string 3",
    "assignedTo": "sample string 4"
  },
  "notifyUser": true
}
<InterestOnEstate xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://schemas.datacontract.org/2004/07/Vitec.Housing.Connect.Api.Models.Interest">
  <ContactId>sample string 3</ContactId>
  <CustomerId>sample string 1</CustomerId>
  <EstateId>sample string 2</EstateId>
  <InterestNote>sample string 5</InterestNote>
  <Note>sample string 4</Note>
  <NotifyUser>true</NotifyUser>
  <PresentAccommodation>
    <Coordinate xmlns:d3p1="http://schemas.datacontract.org/2004/07/Vitec.Housing.Connect.Api.Models">
      <d3p1:Latitud>2.1</d3p1:Latitud>
      <d3p1:Longitud>1.1</d3p1:Longitud>
    </Coordinate>
    <EstateType>House</EstateType>
    <LivingSpace>1.1</LivingSpace>
    <NumberOfRooms>1.1</NumberOfRooms>
    <Other>sample string 1</Other>
    <Price>1.1</Price>
  </PresentAccommodation>
  <Task xmlns:d2p1="http://schemas.datacontract.org/2004/07/Vitec.Housing.Connect.Api.Models.Task">
    <d2p1:AssignedTo>sample string 4</d2p1:AssignedTo>
    <d2p1:EstateId>sample string 3</d2p1:EstateId>
    <d2p1:Note>sample string 2</d2p1:Note>
    <d2p1:PredefinedTaskId>sample string 1</d2p1:PredefinedTaskId>
  </Task>
</InterestOnEstate>
Response Information Resource Description Skickar in intresseanmälan från en befintlig kontakt till en bostad.

Kodexempel

curl "https://connect.maklare.vitec.net/Interest/SendInterestOnEstate" -X POST -H "Content-Type: application/json" -H "Authorization: basic {Base64 kodad användarnamn och lösenord}" -d {\"customerId\":\"StringValue\",\"estateId\":\"StringValue\",\"contactId\":\"StringValue\"}
            

$URL = "https://connect.maklare.vitec.net/Interest/SendInterestOnEstate"
$data = "{`"customerId`":`"StringValue`",`"estateId`":`"StringValue`",`"contactId`":`"StringValue`"}"
Invoke-WebRequest -Uri $URL -Method POST -Headers @{"Content-Type" = "application/json"; "authorization" = "basic {Base64 kodad användarnamn och lösenord}"} -Body $data
                

// 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}")
//     }
// }
var json = "{\"customerId\":\"StringValue\",\"estateId\":\"StringValue\",\"contactId\":\"StringValue\"}";
using (var response = await HttpClientInstance.PostAsync("Interest/SendInterestOnEstate", new StringContent(json, Encoding.UTF8, "application/json"))) {
    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
    }
}

$URL = "https://connect.maklare.vitec.net/Interest/SendInterestOnEstate";

$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);
$data = "{\"customerId\":\"StringValue\",\"estateId\":\"StringValue\",\"contactId\":\"StringValue\"}";
curl_setopt($ch, CURLOPT_POST, true);

curl_setopt($ch, CURLOPT_POSTFIELDS, $data);
curl_setopt($ch, CURLOPT_HTTPHEADER, array(
    'Content-Type: application/json',
    'Content-Length: ' . strlen($data)
));

$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
}

Testformulär Text input