curl "https://connect.maklare.vitec.net/CRM/Contact/StringValue/SearchProfile/SearchProfileValues" -X GET -H "Authorization: basic {Base64 kodad användarnamn och lösenord}"
Dokumentation för API-funktioner
GET CRM/Contact/{customerId}/SearchProfile/SearchProfileValues
Hämtar undertyper och giltiga värden för sökprofiler
Request Information
URI Parameters
Response Information
Resource Description
Hämtar undertyper och giltiga värden för sökprofiler
SearchProfilesInfo
Kodexempel
Testformulär
Text input
Response Formats
| Namn | Beskrivning | Typ | Information |
| customerId | Kundid | string |
Krävs |
| Namn | Beskrivning | Typ | Information |
| SelectableResidentialSubtypes | Valbara undertyper för boenden(villa, lägenhet, fritidshus, tomt) | Collection of SubtypeResidential | |
| SelectableFarmSubtypes | Valbara undertyper för gårdar | Collection of SubtypeFarm | |
| SelectableForeignSubtypes | Valbara undertyper för utlandsboenden | Collection of SubtypeForeign | |
| SelectableCommercialSubtypes | Valbara undertyper för kommersiella fastigheter | Collection of SubtypeCommercial | |
| SelectablePremisesSubtypes | Valbara undertyper för lokaler | Collection of SubtypePremises | |
| DomesticPriceSteps | Valbara värden för pris i SEK för inhemska objekt | Collection of decimal number | |
| ForeignPriceSteps | Valbara värden för pris i valt lands valuta för utländska objekt | Collection of decimal number | |
| RoomSteps | Valbara värden för rum och sovrum | Collection of decimal number | |
| LivingAreaSteps | Valbara värden för boarea | Collection of decimal number | |
| MonthlyFeeSteps | Valbara värden för månadsavgift | Collection of decimal number | |
| PlotAreaSteps | Valbara värden för tomtarea i kvm | Collection of decimal number | |
| FarmAreaStepsHectare | Valbara värden för areor för gårdar i hektar | Collection of decimal number |
$URL = "https://connect.maklare.vitec.net/CRM/Contact/StringValue/SearchProfile/SearchProfileValues"
Invoke-WebRequest -Uri $URL -Method GET -Headers @{"authorization" = "basic {Base64 kodad användarnamn och lösenord}"}
// 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}")
// }
// }
using (var response = await HttpClientInstance.GetAsync("CRM/Contact/StringValue/SearchProfile/SearchProfileValues")) {
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
}
var json = await response.Content.ReadAsStringAsync();
// JsonConvert finns i biblioteket Newtonsoft.Json
var result = JsonConvert.DeserializeObject<dynamic>(json);
var selectableResidentialSubtypes = result.selectableResidentialSubtypes.Value ;
// TODO: Gör något med resultatet
}
$URL = "https://connect.maklare.vitec.net/CRM/Contact/StringValue/SearchProfile/SearchProfileValues";
$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);
$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
}
$field_on_result = $result["selectableResidentialSubtypes"];
// TODO: Gör något med resultatet
Resultat av begäran
{
"selectableResidentialSubtypes": [
"Apartment",
"Apartment"
],
"selectableFarmSubtypes": [
"Agriculture",
"Agriculture"
],
"selectableForeignSubtypes": [
"Apartment",
"Apartment"
],
"selectableCommercialSubtypes": [
"Residential",
"Residential"
],
"selectablePremisesSubtypes": [
"Retail",
"Retail"
],
"domesticPriceSteps": [
1.1,
2.1
],
"foreignPriceSteps": [
1.1,
2.1
],
"roomSteps": [
1.1,
2.1
],
"livingAreaSteps": [
1.1,
2.1
],
"monthlyFeeSteps": [
1.1,
2.1
],
"plotAreaSteps": [
1.1,
2.1
],
"farmAreaStepsHectare": [
1.1,
2.1
]
}
<SearchProfilesInfo xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://schemas.datacontract.org/2004/07/Express.Connect.Api.Models.SearchProfileV2">
<DomesticPriceSteps xmlns:d2p1="http://schemas.microsoft.com/2003/10/Serialization/Arrays">
<d2p1:double>1.1</d2p1:double>
<d2p1:double>2.1</d2p1:double>
</DomesticPriceSteps>
<FarmAreaStepsHectare xmlns:d2p1="http://schemas.microsoft.com/2003/10/Serialization/Arrays">
<d2p1:double>1.1</d2p1:double>
<d2p1:double>2.1</d2p1:double>
</FarmAreaStepsHectare>
<ForeignPriceSteps xmlns:d2p1="http://schemas.microsoft.com/2003/10/Serialization/Arrays">
<d2p1:double>1.1</d2p1:double>
<d2p1:double>2.1</d2p1:double>
</ForeignPriceSteps>
<LivingAreaSteps xmlns:d2p1="http://schemas.microsoft.com/2003/10/Serialization/Arrays">
<d2p1:double>1.1</d2p1:double>
<d2p1:double>2.1</d2p1:double>
</LivingAreaSteps>
<MonthlyFeeSteps xmlns:d2p1="http://schemas.microsoft.com/2003/10/Serialization/Arrays">
<d2p1:double>1.1</d2p1:double>
<d2p1:double>2.1</d2p1:double>
</MonthlyFeeSteps>
<PlotAreaSteps xmlns:d2p1="http://schemas.microsoft.com/2003/10/Serialization/Arrays">
<d2p1:double>1.1</d2p1:double>
<d2p1:double>2.1</d2p1:double>
</PlotAreaSteps>
<RoomSteps xmlns:d2p1="http://schemas.microsoft.com/2003/10/Serialization/Arrays">
<d2p1:double>1.1</d2p1:double>
<d2p1:double>2.1</d2p1:double>
</RoomSteps>
<SelectableCommercialSubtypes>
<SubtypeCommercial>Residential</SubtypeCommercial>
<SubtypeCommercial>Residential</SubtypeCommercial>
</SelectableCommercialSubtypes>
<SelectableFarmSubtypes>
<SubtypeFarm>Agriculture</SubtypeFarm>
<SubtypeFarm>Agriculture</SubtypeFarm>
</SelectableFarmSubtypes>
<SelectableForeignSubtypes>
<SubtypeForeign>Apartment</SubtypeForeign>
<SubtypeForeign>Apartment</SubtypeForeign>
</SelectableForeignSubtypes>
<SelectablePremisesSubtypes>
<SubtypePremises>Retail</SubtypePremises>
<SubtypePremises>Retail</SubtypePremises>
</SelectablePremisesSubtypes>
<SelectableResidentialSubtypes>
<SubtypeResidential>Apartment</SubtypeResidential>
<SubtypeResidential>Apartment</SubtypeResidential>
</SelectableResidentialSubtypes>
</SearchProfilesInfo>