Dokumentation för API-funktioner
PUT CRM/Contact/{customerId}/SearchProfile/Foreign/{id} Uppdatera en sökprofil av typen utlandsbostad Request Information URI Parameters
NamnBeskrivningTypInformation
customerId Kundid string Krävs
id Sökprofilens id string Krävs
Body Parameters Sökprofil SearchProfileForeignUpdate
NamnBeskrivningTypInformation
CountryCode Landskod string

Subtypes Typ av utlandsboende Collection of SubtypeForeign

Features Egenskaper för utlandsboende Collection of ForeignFeature

AreaIds Områdes id:n Collection of string

ShoppingCentreMaxDist Affärscentrum integer

CentreMaxDist Centrum integer

AirportMaxDist Flyplats integer

GolfCourceMaxDist Golfbana integer

SeaMaxDist Hav integer

SupermarketMaxDist Mataffär integer

PoolMaxDist Pool integer

HospitalMaxDist Sjukhus integer

BeachMaxDist Strand integer

LivingSpace Boarea min/max. Valbara värden finns i "LivingAreaSteps" som fås via anrop till GET CRM/Contact/{customerId}/SearchProfile/SearchProfileValues. RangeOfInt32

NumberOfRooms Antal rum min/max. Valbara värden finns i "RoomSteps" som fås via anrop till GET CRM/Contact/{customerId}/SearchProfile/SearchProfileValues. RangeOfInt32

Bedrooms Antal sovrum. Valbara värden finns i "RoomSteps" som fås via anrop till GET CRM/Contact/{customerId}/SearchProfile/SearchProfileValues. integer

PlotArea Tomtarea min/max anges i kvm. Valbara värden finns i "PlotAreaSteps" som fås via anrop till GET CRM/Contact/{customerId}/SearchProfile/SearchProfileValues. RangeOfInt32

MonthlyFee Månadsavgift. Valbara värden finns i "MonthlyFeeSteps" som fås via anrop till GET CRM/Contact/{customerId}/SearchProfile/SearchProfileValues. integer

IsAutomaticProfile Sökprofilen är automatskapad boolean

Price Pris min/max. Valbara värden för svenska objekt finns i "DomesticPriceSteps" som fås via anrop till GET CRM/Contact/{customerId}/SearchProfile/SearchProfileValues. För utlandsbostäder skall istället "ForeignPriceSteps" användas. RangeOfInt32

DrawnAreas Ritat område Collection of Polygon

DrawnAreasName Namn på ritat område string

IncreasedRequirementIds Utökade krav id:n (increased requirements) Valbara värden för olika objettyper fås via anrop till GET IncreasedRequirement/{customerId}. Collection of string

Request Formats

{
  "countryCode": "sample string 1",
  "subtypes": [
    "Apartment",
    "Apartment"
  ],
  "features": [
    "Balcony",
    "Balcony"
  ],
  "areaIds": [
    "sample string 1",
    "sample string 2"
  ],
  "shoppingCentreMaxDist": 1,
  "centreMaxDist": 1,
  "airportMaxDist": 1,
  "golfCourceMaxDist": 1,
  "seaMaxDist": 1,
  "supermarketMaxDist": 1,
  "poolMaxDist": 1,
  "hospitalMaxDist": 1,
  "beachMaxDist": 1,
  "livingSpace": {
    "maxValue": 1,
    "minValue": 1
  },
  "numberOfRooms": {
    "maxValue": 1,
    "minValue": 1
  },
  "bedrooms": 1,
  "plotArea": {
    "maxValue": 1,
    "minValue": 1
  },
  "monthlyFee": 1,
  "isAutomaticProfile": true,
  "price": {
    "maxValue": 1,
    "minValue": 1
  },
  "drawnAreas": [
    {
      "coordinates": [
        {
          "longitud": 1.1,
          "latitud": 2.1
        },
        {
          "longitud": 1.1,
          "latitud": 2.1
        }
      ]
    },
    {
      "coordinates": [
        {
          "longitud": 1.1,
          "latitud": 2.1
        },
        {
          "longitud": 1.1,
          "latitud": 2.1
        }
      ]
    }
  ],
  "drawnAreasName": "sample string 3",
  "increasedRequirementIds": [
    "sample string 1",
    "sample string 2"
  ]
}
<SearchProfileForeignUpdate xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://schemas.datacontract.org/2004/07/Express.Connect.Api.Models.SearchProfileV2">
  <DrawnAreas xmlns:d2p1="http://schemas.datacontract.org/2004/07/Vitec.Housing.Connect.Api.Models">
    <d2p1:Polygon>
      <d2p1:Coordinates>
        <d2p1:Coordinate>
          <d2p1:Latitud>2.1</d2p1:Latitud>
          <d2p1:Longitud>1.1</d2p1:Longitud>
        </d2p1:Coordinate>
        <d2p1:Coordinate>
          <d2p1:Latitud>2.1</d2p1:Latitud>
          <d2p1:Longitud>1.1</d2p1:Longitud>
        </d2p1:Coordinate>
      </d2p1:Coordinates>
    </d2p1:Polygon>
    <d2p1:Polygon>
      <d2p1:Coordinates>
        <d2p1:Coordinate>
          <d2p1:Latitud>2.1</d2p1:Latitud>
          <d2p1:Longitud>1.1</d2p1:Longitud>
        </d2p1:Coordinate>
        <d2p1:Coordinate>
          <d2p1:Latitud>2.1</d2p1:Latitud>
          <d2p1:Longitud>1.1</d2p1:Longitud>
        </d2p1:Coordinate>
      </d2p1:Coordinates>
    </d2p1:Polygon>
  </DrawnAreas>
  <DrawnAreasName>sample string 3</DrawnAreasName>
  <IncreasedRequirementIds xmlns:d2p1="http://schemas.microsoft.com/2003/10/Serialization/Arrays">
    <d2p1:string>sample string 1</d2p1:string>
    <d2p1:string>sample string 2</d2p1:string>
  </IncreasedRequirementIds>
  <IsAutomaticProfile>true</IsAutomaticProfile>
  <Price xmlns:d2p1="http://schemas.datacontract.org/2004/07/Vitec.Housing.Connect.Api.Models">
    <d2p1:MaxValue>1</d2p1:MaxValue>
    <d2p1:MinValue>1</d2p1:MinValue>
  </Price>
  <Bedrooms>1</Bedrooms>
  <LivingSpace xmlns:d2p1="http://schemas.datacontract.org/2004/07/Vitec.Housing.Connect.Api.Models">
    <d2p1:MaxValue>1</d2p1:MaxValue>
    <d2p1:MinValue>1</d2p1:MinValue>
  </LivingSpace>
  <MonthlyFee>1</MonthlyFee>
  <NumberOfRooms xmlns:d2p1="http://schemas.datacontract.org/2004/07/Vitec.Housing.Connect.Api.Models">
    <d2p1:MaxValue>1</d2p1:MaxValue>
    <d2p1:MinValue>1</d2p1:MinValue>
  </NumberOfRooms>
  <PlotArea xmlns:d2p1="http://schemas.datacontract.org/2004/07/Vitec.Housing.Connect.Api.Models">
    <d2p1:MaxValue>1</d2p1:MaxValue>
    <d2p1:MinValue>1</d2p1:MinValue>
  </PlotArea>
  <AirportMaxDist>1</AirportMaxDist>
  <AreaIds xmlns:d2p1="http://schemas.microsoft.com/2003/10/Serialization/Arrays">
    <d2p1:string>sample string 1</d2p1:string>
    <d2p1:string>sample string 2</d2p1:string>
  </AreaIds>
  <BeachMaxDist>1</BeachMaxDist>
  <CentreMaxDist>1</CentreMaxDist>
  <CountryCode>sample string 1</CountryCode>
  <Features>
    <ForeignFeature>Balcony</ForeignFeature>
    <ForeignFeature>Balcony</ForeignFeature>
  </Features>
  <GolfCourceMaxDist>1</GolfCourceMaxDist>
  <HospitalMaxDist>1</HospitalMaxDist>
  <PoolMaxDist>1</PoolMaxDist>
  <SeaMaxDist>1</SeaMaxDist>
  <ShoppingCentreMaxDist>1</ShoppingCentreMaxDist>
  <Subtypes>
    <SubtypeForeign>Apartment</SubtypeForeign>
    <SubtypeForeign>Apartment</SubtypeForeign>
  </Subtypes>
  <SupermarketMaxDist>1</SupermarketMaxDist>
</SearchProfileForeignUpdate>
Response Information Resource Description Uppdatera en sökprofil av typen utlandsbostad

Kodexempel

curl "https://connect.maklare.vitec.net/CRM/Contact/StringValue/SearchProfile/Foreign/StringValue" -X PUT -H "Content-Type: application/json" -H "Authorization: basic {Base64 kodad användarnamn och lösenord}" -d {\"countryCode\":\"StringValue\",\"subtypes\":[0],\"features\":[0]}
            

$URL = "https://connect.maklare.vitec.net/CRM/Contact/StringValue/SearchProfile/Foreign/StringValue"
$data = "{`"countryCode`":`"StringValue`",`"subtypes`":[0],`"features`":[0]}"
Invoke-WebRequest -Uri $URL -Method PUT -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 = "{\"countryCode\":\"StringValue\",\"subtypes\":[0],\"features\":[0]}";
using (var response = await HttpClientInstance.PutAsync("CRM/Contact/StringValue/SearchProfile/Foreign/StringValue", 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/CRM/Contact/StringValue/SearchProfile/Foreign/StringValue";

$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 = "{\"countryCode\":\"StringValue\",\"subtypes\":[0],\"features\":[0]}";
$headers = array( "Content-Type: application/json", "Content-Length: " . strlen($data) );
curl_setopt($ch, CURLOPT_HTTPHEADER, $headers);
curl_setopt($ch, CURLOPT_CUSTOMREQUEST, 'PUT');

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