Dokumentation för API-funktioner
POST Interest/SendInterestAndContactOnEstate Skickar in intresseanmälan från en ny kontakt till en bostad. Innan nya personer läggs in i mäklarsystemet, görs alltid en dubblettkontroll. Request Information Body Parameters InterestAndContact InterestOnEstateAndContact
NamnBeskrivningTypInformation
UpdatePerson Person UpdatePerson Uppgift om personen krävs
EstateId Objektid string Objektid krävs
Objektid måste vara mellan 0 och 40 tecken
PresentAccommodation Nuvarande boende PresentAccommodation

InterestNote Intresseanteckning. string

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

Request Formats

{
  "updatePerson": {
    "firstName": "sample string 1",
    "lastName": "sample string 2",
    "socialSecurityNumber": "sample string 3",
    "isForeignSocialSecurityNumber": true,
    "telePhone": "sample string 4",
    "workPhone": "sample string 5",
    "cellPhone": "sample string 6",
    "approval": true,
    "approvalDate": "2024-11-21T11:19:25.1119695+01:00",
    "gdprApprovalDate": "2024-11-21T11:19:25.1119695+01:00",
    "obtainThrough": "Interest",
    "contactId": "sample string 7",
    "customerId": "sample string 8",
    "categoryIds": [
      "sample string 1",
      "sample string 2"
    ],
    "address": {
      "streetAddress": "sample string 1",
      "zipCode": "sample string 2",
      "city": "sample string 3",
      "countryCode": "sample string 4"
    },
    "email": {
      "emailAddress": "sample string 1",
      "emailAddress2": "sample string 2"
    },
    "userId": "sample string 9",
    "otherPhone": "sample string 10",
    "wishAdvertising": true,
    "note": "sample string 11",
    "coordinate": {
      "longitud": 1.1,
      "latitud": 2.1
    },
    "task": {
      "predefinedTaskId": "sample string 1",
      "note": "sample string 2",
      "estateId": "sample string 3",
      "assignedTo": "sample string 4"
    },
    "customField": {
      "name": "sample string 1",
      "value": "sample string 2"
    },
    "leadScore": 1
  },
  "estateId": "sample string 1",
  "presentAccommodation": {
    "estateType": "House",
    "livingSpace": 1.1,
    "numberOfRooms": 1.1,
    "price": 1.1,
    "other": "sample string 1",
    "coordinate": {
      "longitud": 1.1,
      "latitud": 2.1
    }
  },
  "interestNote": "sample string 2",
  "notifyUser": true
}
<InterestOnEstateAndContact xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://schemas.datacontract.org/2004/07/Vitec.Housing.Connect.Api.Models.Interest">
  <EstateId>sample string 1</EstateId>
  <InterestNote>sample string 2</InterestNote>
  <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>
  <UpdatePerson xmlns:d2p1="http://schemas.datacontract.org/2004/07/Vitec.Housing.Connect.Api.Models.Contact.Update">
    <d2p1:Address xmlns:d3p1="http://schemas.datacontract.org/2004/07/Vitec.Housing.Connect.Api.Models">
      <d3p1:City>sample string 3</d3p1:City>
      <d3p1:CountryCode>sample string 4</d3p1:CountryCode>
      <d3p1:StreetAddress>sample string 1</d3p1:StreetAddress>
      <d3p1:ZipCode>sample string 2</d3p1:ZipCode>
    </d2p1:Address>
    <d2p1:CategoryIds xmlns:d3p1="http://schemas.microsoft.com/2003/10/Serialization/Arrays">
      <d3p1:string>sample string 1</d3p1:string>
      <d3p1:string>sample string 2</d3p1:string>
    </d2p1:CategoryIds>
    <d2p1:ContactId>sample string 7</d2p1:ContactId>
    <d2p1: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>
    </d2p1:Coordinate>
    <d2p1:CustomField xmlns:d3p1="http://schemas.datacontract.org/2004/07/Vitec.Housing.Connect.Api.Models.CustomField">
      <d3p1:Name>sample string 1</d3p1:Name>
      <d3p1:Value>sample string 2</d3p1:Value>
    </d2p1:CustomField>
    <d2p1:CustomerId>sample string 8</d2p1:CustomerId>
    <d2p1:Email xmlns:d3p1="http://schemas.datacontract.org/2004/07/Vitec.Housing.Connect.Api.Models">
      <d3p1:EmailAddress>sample string 1</d3p1:EmailAddress>
      <d3p1:EmailAddress2>sample string 2</d3p1:EmailAddress2>
    </d2p1:Email>
    <d2p1:LeadScore>1</d2p1:LeadScore>
    <d2p1:Note>sample string 11</d2p1:Note>
    <d2p1:OtherPhone>sample string 10</d2p1:OtherPhone>
    <d2p1:Task xmlns:d3p1="http://schemas.datacontract.org/2004/07/Vitec.Housing.Connect.Api.Models.Task">
      <d3p1:AssignedTo>sample string 4</d3p1:AssignedTo>
      <d3p1:EstateId>sample string 3</d3p1:EstateId>
      <d3p1:Note>sample string 2</d3p1:Note>
      <d3p1:PredefinedTaskId>sample string 1</d3p1:PredefinedTaskId>
    </d2p1:Task>
    <d2p1:UserId>sample string 9</d2p1:UserId>
    <d2p1:WishAdvertising>true</d2p1:WishAdvertising>
    <d2p1:Approval>true</d2p1:Approval>
    <d2p1:ApprovalDate>2024-11-21T11:19:25.1119695+01:00</d2p1:ApprovalDate>
    <d2p1:CellPhone>sample string 6</d2p1:CellPhone>
    <d2p1:FirstName>sample string 1</d2p1:FirstName>
    <d2p1:GDPRApprovalDate>2024-11-21T11:19:25.1119695+01:00</d2p1:GDPRApprovalDate>
    <d2p1:IsForeignSocialSecurityNumber>true</d2p1:IsForeignSocialSecurityNumber>
    <d2p1:LastName>sample string 2</d2p1:LastName>
    <d2p1:ObtainThrough>Interest</d2p1:ObtainThrough>
    <d2p1:SocialSecurityNumber>sample string 3</d2p1:SocialSecurityNumber>
    <d2p1:TelePhone>sample string 4</d2p1:TelePhone>
    <d2p1:WorkPhone>sample string 5</d2p1:WorkPhone>
  </UpdatePerson>
</InterestOnEstateAndContact>
Response Information Resource Description Skickar in intresseanmälan från en ny kontakt till en bostad. Innan nya personer läggs in i mäklarsystemet, görs alltid en dubblettkontroll.

Kodexempel

curl "https://connect.maklare.vitec.net/Interest/SendInterestAndContactOnEstate" -X POST -H "Content-Type: application/json" -H "Authorization: basic {Base64 kodad användarnamn och lösenord}" -d {\"updatePerson\":{\"firstName\":\"StringValue\",\"lastName\":\"StringValue\",\"socialSecurityNumber\":\"StringValue\"},\"estateId\":\"StringValue\",\"presentAccommodation\":{\"estateType\":0,\"livingSpace\":0.0,\"numberOfRooms\":0.0}}
            

$URL = "https://connect.maklare.vitec.net/Interest/SendInterestAndContactOnEstate"
$data = "{`"updatePerson`":{`"firstName`":`"StringValue`",`"lastName`":`"StringValue`",`"socialSecurityNumber`":`"StringValue`"},`"estateId`":`"StringValue`",`"presentAccommodation`":{`"estateType`":0,`"livingSpace`":0.0,`"numberOfRooms`":0.0}}"
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 = "{\"updatePerson\":{\"firstName\":\"StringValue\",\"lastName\":\"StringValue\",\"socialSecurityNumber\":\"StringValue\"},\"estateId\":\"StringValue\",\"presentAccommodation\":{\"estateType\":0,\"livingSpace\":0.0,\"numberOfRooms\":0.0}}";
using (var response = await HttpClientInstance.PostAsync("Interest/SendInterestAndContactOnEstate", 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/SendInterestAndContactOnEstate";

$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 = "{\"updatePerson\":{\"firstName\":\"StringValue\",\"lastName\":\"StringValue\",\"socialSecurityNumber\":\"StringValue\"},\"estateId\":\"StringValue\",\"presentAccommodation\":{\"estateType\":0,\"livingSpace\":0.0,\"numberOfRooms\":0.0}}";
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