Dokumentation för API-funktioner
POST Interest/SendInterestOnArea Skickar in intresseanmälan till mäklarsystemet för ett eller flera områden. Request Information Body Parameters InterestOnArea
NamnBeskrivningTypInformation
CustomerId KundId string Kundid krävs
Kundid måste vara mellan 0 och 40 tecken
ContactId Kontaktid string Kontaktid krävs
Note Anteckning string

LookingForAccommodations Sökpreferenser Collection of LookingForAccommodation Minst en sökpreferens måste anges
PresentAccommodation Nuvarande boende PresentAccommodation

Task En uppgift som ska läggas till. Task

NotifyUser Notifiera handläggaren på kontakten att ett intresse för ett område inkommit boolean

Watched Ska matchas/bevakas MatchingWatched

Request Formats

{
  "customerId": "sample string 1",
  "contactId": "sample string 2",
  "note": "sample string 3",
  "lookingForAccommodations": [
    {
      "id": "sample string 1",
      "areaIds": [
        "sample string 1",
        "sample string 2"
      ],
      "countys": [
        "sample string 1",
        "sample string 2"
      ],
      "countryCode": "sample string 2",
      "polygon": [
        {
          "longitud": 1.1,
          "latitud": 2.1
        },
        {
          "longitud": 1.1,
          "latitud": 2.1
        }
      ],
      "foreignProperty": true,
      "house": true,
      "rowHouse": true,
      "housingCooperative": true,
      "cottage": true,
      "premises": true,
      "plot": true,
      "farm": true,
      "tenancy": true,
      "otherHousing": true,
      "livingSpace": {
        "min": 1.1,
        "max": 1.1
      },
      "numberOfRooms": {
        "min": 1.1,
        "max": 1.1
      },
      "price": {
        "min": 1.1,
        "max": 1.1
      },
      "plotArea": {
        "min": 1.1,
        "max": 1.1
      },
      "specialRequset": "sample string 13",
      "increasedRequirementIDs": [
        "sample string 1",
        "sample string 2"
      ],
      "active": true
    },
    {
      "id": "sample string 1",
      "areaIds": [
        "sample string 1",
        "sample string 2"
      ],
      "countys": [
        "sample string 1",
        "sample string 2"
      ],
      "countryCode": "sample string 2",
      "polygon": [
        {
          "longitud": 1.1,
          "latitud": 2.1
        },
        {
          "longitud": 1.1,
          "latitud": 2.1
        }
      ],
      "foreignProperty": true,
      "house": true,
      "rowHouse": true,
      "housingCooperative": true,
      "cottage": true,
      "premises": true,
      "plot": true,
      "farm": true,
      "tenancy": true,
      "otherHousing": true,
      "livingSpace": {
        "min": 1.1,
        "max": 1.1
      },
      "numberOfRooms": {
        "min": 1.1,
        "max": 1.1
      },
      "price": {
        "min": 1.1,
        "max": 1.1
      },
      "plotArea": {
        "min": 1.1,
        "max": 1.1
      },
      "specialRequset": "sample string 13",
      "increasedRequirementIDs": [
        "sample string 1",
        "sample string 2"
      ],
      "active": true
    }
  ],
  "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,
  "watched": "Yes"
}
<InterestOnArea 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 2</ContactId>
  <CustomerId>sample string 1</CustomerId>
  <LookingForAccommodations>
    <LookingForAccommodation>
      <Active>true</Active>
      <AreaIds xmlns:d4p1="http://schemas.microsoft.com/2003/10/Serialization/Arrays">
        <d4p1:string>sample string 1</d4p1:string>
        <d4p1:string>sample string 2</d4p1:string>
      </AreaIds>
      <Cottage>true</Cottage>
      <CountryCode>sample string 2</CountryCode>
      <Countys xmlns:d4p1="http://schemas.microsoft.com/2003/10/Serialization/Arrays">
        <d4p1:string>sample string 1</d4p1:string>
        <d4p1:string>sample string 2</d4p1:string>
      </Countys>
      <Farm>true</Farm>
      <ForeignProperty>true</ForeignProperty>
      <House>true</House>
      <HousingCooperative>true</HousingCooperative>
      <Id>sample string 1</Id>
      <IncreasedRequirementIDs xmlns:d4p1="http://schemas.microsoft.com/2003/10/Serialization/Arrays">
        <d4p1:string>sample string 1</d4p1:string>
        <d4p1:string>sample string 2</d4p1:string>
      </IncreasedRequirementIDs>
      <LivingSpace>
        <Max>1.1</Max>
        <Min>1.1</Min>
      </LivingSpace>
      <NumberOfRooms>
        <Max>1.1</Max>
        <Min>1.1</Min>
      </NumberOfRooms>
      <OtherHousing>true</OtherHousing>
      <Plot>true</Plot>
      <PlotArea>
        <Max>1.1</Max>
        <Min>1.1</Min>
      </PlotArea>
      <Polygon xmlns:d4p1="http://schemas.datacontract.org/2004/07/Vitec.Housing.Connect.Api.Models">
        <d4p1:Coordinate>
          <d4p1:Latitud>2.1</d4p1:Latitud>
          <d4p1:Longitud>1.1</d4p1:Longitud>
        </d4p1:Coordinate>
        <d4p1:Coordinate>
          <d4p1:Latitud>2.1</d4p1:Latitud>
          <d4p1:Longitud>1.1</d4p1:Longitud>
        </d4p1:Coordinate>
      </Polygon>
      <Premises>true</Premises>
      <Price>
        <Max>1.1</Max>
        <Min>1.1</Min>
      </Price>
      <RowHouse>true</RowHouse>
      <SpecialRequset>sample string 13</SpecialRequset>
      <Tenancy>true</Tenancy>
    </LookingForAccommodation>
    <LookingForAccommodation>
      <Active>true</Active>
      <AreaIds xmlns:d4p1="http://schemas.microsoft.com/2003/10/Serialization/Arrays">
        <d4p1:string>sample string 1</d4p1:string>
        <d4p1:string>sample string 2</d4p1:string>
      </AreaIds>
      <Cottage>true</Cottage>
      <CountryCode>sample string 2</CountryCode>
      <Countys xmlns:d4p1="http://schemas.microsoft.com/2003/10/Serialization/Arrays">
        <d4p1:string>sample string 1</d4p1:string>
        <d4p1:string>sample string 2</d4p1:string>
      </Countys>
      <Farm>true</Farm>
      <ForeignProperty>true</ForeignProperty>
      <House>true</House>
      <HousingCooperative>true</HousingCooperative>
      <Id>sample string 1</Id>
      <IncreasedRequirementIDs xmlns:d4p1="http://schemas.microsoft.com/2003/10/Serialization/Arrays">
        <d4p1:string>sample string 1</d4p1:string>
        <d4p1:string>sample string 2</d4p1:string>
      </IncreasedRequirementIDs>
      <LivingSpace>
        <Max>1.1</Max>
        <Min>1.1</Min>
      </LivingSpace>
      <NumberOfRooms>
        <Max>1.1</Max>
        <Min>1.1</Min>
      </NumberOfRooms>
      <OtherHousing>true</OtherHousing>
      <Plot>true</Plot>
      <PlotArea>
        <Max>1.1</Max>
        <Min>1.1</Min>
      </PlotArea>
      <Polygon xmlns:d4p1="http://schemas.datacontract.org/2004/07/Vitec.Housing.Connect.Api.Models">
        <d4p1:Coordinate>
          <d4p1:Latitud>2.1</d4p1:Latitud>
          <d4p1:Longitud>1.1</d4p1:Longitud>
        </d4p1:Coordinate>
        <d4p1:Coordinate>
          <d4p1:Latitud>2.1</d4p1:Latitud>
          <d4p1:Longitud>1.1</d4p1:Longitud>
        </d4p1:Coordinate>
      </Polygon>
      <Premises>true</Premises>
      <Price>
        <Max>1.1</Max>
        <Min>1.1</Min>
      </Price>
      <RowHouse>true</RowHouse>
      <SpecialRequset>sample string 13</SpecialRequset>
      <Tenancy>true</Tenancy>
    </LookingForAccommodation>
  </LookingForAccommodations>
  <Note>sample string 3</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>
  <Watched>Yes</Watched>
</InterestOnArea>
Response Information Resource Description Skickar in intresseanmälan till mäklarsystemet för ett eller flera områden.

Kodexempel

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

$URL = "https://connect.maklare.vitec.net/Interest/SendInterestOnArea"
$data = "{`"customerId`":`"StringValue`",`"contactId`":`"StringValue`",`"note`":`"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\",\"contactId\":\"StringValue\",\"note\":\"StringValue\"}";
using (var response = await HttpClientInstance.PostAsync("Interest/SendInterestOnArea", 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/SendInterestOnArea";

$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\",\"contactId\":\"StringValue\",\"note\":\"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