{
"plotArea": {
"maxValue": 1,
"minValue": 1
},
"sumArea": {
"maxValue": 1,
"minValue": 1
},
"subtypes": [
"Residential",
"Residential"
],
"areaIds": [
"sample string 1",
"sample string 2"
],
"municipalityCodes": [
"sample string 1",
"sample string 2"
],
"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 2",
"increasedRequirementIds": [
"sample string 1",
"sample string 2"
]
}
Dokumentation för API-funktioner
PUT CRM/Contact/{customerId}/SearchProfile/Commercial/{id}
Uppdatera en sökprofil av typen kommersiell fastighet
Request Information
URI Parameters
Body Parameters
Sökprofil SearchProfileCommercialUpdate
Response Information
Resource Description
Uppdatera en sökprofil av typen kommersiell fastighet
Kodexempel
Testformulär
Text input
| Namn | Beskrivning | Typ | Information |
| customerId | Kundid | string |
Krävs |
| id | Sökprofilens id | string |
Krävs |
| Namn | Beskrivning | Typ | Information |
| PlotArea | Tomtarea i kvm Valbara värden finns i "PlotAreaSteps" som fås via anrop till GET CRM/Contact/{customerId}/SearchProfile/SearchProfileValues. | RangeOfInt32 | |
| SumArea | Summa areor i kvm min/max. Valbara värden finns i "PlotAreaSteps" som fås via anrop till GET CRM/Contact/{customerId}/SearchProfile/SearchProfileValues. | RangeOfInt32 | |
| Subtypes | Typ av kommersiell fastighet | Collection of SubtypeCommercial | |
| AreaIds | Områdes id:n | Collection of string | |
| MunicipalityCodes | Kommunkoder | Collection of string | |
| 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
<SearchProfileCommercialUpdate 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 2</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>
<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>
<MunicipalityCodes xmlns:d2p1="http://schemas.microsoft.com/2003/10/Serialization/Arrays">
<d2p1:string>sample string 1</d2p1:string>
<d2p1:string>sample string 2</d2p1:string>
</MunicipalityCodes>
<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>
<Subtypes>
<SubtypeCommercial>Residential</SubtypeCommercial>
<SubtypeCommercial>Residential</SubtypeCommercial>
</Subtypes>
<SumArea xmlns:d2p1="http://schemas.datacontract.org/2004/07/Vitec.Housing.Connect.Api.Models">
<d2p1:MaxValue>1</d2p1:MaxValue>
<d2p1:MinValue>1</d2p1:MinValue>
</SumArea>
</SearchProfileCommercialUpdate>
curl "https://connect.maklare.vitec.net/CRM/Contact/StringValue/SearchProfile/Commercial/StringValue" -X PUT -H "Content-Type: application/json" -H "Authorization: basic {Base64 kodad användarnamn och lösenord}" -d {\"plotArea\":{\"maxValue\":0,\"minValue\":0},\"sumArea\":{\"maxValue\":0,\"minValue\":0},\"subtypes\":[0]}
$URL = "https://connect.maklare.vitec.net/CRM/Contact/StringValue/SearchProfile/Commercial/StringValue"
$data = "{`"plotArea`":{`"maxValue`":0,`"minValue`":0},`"sumArea`":{`"maxValue`":0,`"minValue`":0},`"subtypes`":[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 = "{\"plotArea\":{\"maxValue\":0,\"minValue\":0},\"sumArea\":{\"maxValue\":0,\"minValue\":0},\"subtypes\":[0]}";
using (var response = await HttpClientInstance.PutAsync("CRM/Contact/StringValue/SearchProfile/Commercial/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/Commercial/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 = "{\"plotArea\":{\"maxValue\":0,\"minValue\":0},\"sumArea\":{\"maxValue\":0,\"minValue\":0},\"subtypes\":[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
}
Resultat av begäran