curl "https://connect.maklare.vitec.net/CRM/Contact/StringValue/EstateValuation/StringValue" -X GET -H "Authorization: basic {Base64 kodad användarnamn och lösenord}"
Dokumentation för API-funktioner
GET CRM/Contact/{customerId}/EstateValuation/{contactIds}
Hämtar ut information om tjänsten "Ditt bostadsvärde" för en lista av kontakter, max 20 stycken åt gången.
Request Information
URI Parameters
Response Information
Resource Description
Hämtar ut information om tjänsten "Ditt bostadsvärde" för en lista av kontakter, max 20 stycken åt gången.
Collection of CrmEstateValuation
Kodexempel
Testformulär
Text input
Response Formats
Namn | Beskrivning | Typ | Information |
customerId | Kundid | string |
Krävs |
contactIds | Kontaktidn (kommaseparerade, max 20 stycken). | string |
Krävs |
Namn | Beskrivning | Typ | Information |
ContactId | KontaktId | string | |
Estates | Lista med objekt där tjänsten finns | Collection of ValuedEstate |
$URL = "https://connect.maklare.vitec.net/CRM/Contact/StringValue/EstateValuation/StringValue"
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/EstateValuation/StringValue")) {
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 firstInArray = result[0];
var contactId = firstInArray.contactId.Value ;
// TODO: Gör något med resultatet
}
$URL = "https://connect.maklare.vitec.net/CRM/Contact/StringValue/EstateValuation/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);
$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
}
$first = $result[0];
$field_on_result = $first["contactId"];
// TODO: Gör något med resultatet
Resultat av begäran
[ { "contactId": "sample string 1", "estates": [ { "estateId": "sample string 1", "initialValuationDate": "2024-11-21T11:11:13.254888+01:00", "initialValuation": 1, "endDate": "2024-11-21T11:11:13.254888+01:00", "valuationHistory": [ { "initialValuationDate": "2024-11-21T11:11:13.254888+01:00", "initialValuation": 1, "valuation": 1, "valuationDate": "2024-11-21T11:11:13.254888+01:00", "manuallyChanged": true }, { "initialValuationDate": "2024-11-21T11:11:13.254888+01:00", "initialValuation": 1, "valuation": 1, "valuationDate": "2024-11-21T11:11:13.254888+01:00", "manuallyChanged": true } ] }, { "estateId": "sample string 1", "initialValuationDate": "2024-11-21T11:11:13.254888+01:00", "initialValuation": 1, "endDate": "2024-11-21T11:11:13.254888+01:00", "valuationHistory": [ { "initialValuationDate": "2024-11-21T11:11:13.254888+01:00", "initialValuation": 1, "valuation": 1, "valuationDate": "2024-11-21T11:11:13.254888+01:00", "manuallyChanged": true }, { "initialValuationDate": "2024-11-21T11:11:13.254888+01:00", "initialValuation": 1, "valuation": 1, "valuationDate": "2024-11-21T11:11:13.254888+01:00", "manuallyChanged": true } ] } ] }, { "contactId": "sample string 1", "estates": [ { "estateId": "sample string 1", "initialValuationDate": "2024-11-21T11:11:13.254888+01:00", "initialValuation": 1, "endDate": "2024-11-21T11:11:13.254888+01:00", "valuationHistory": [ { "initialValuationDate": "2024-11-21T11:11:13.254888+01:00", "initialValuation": 1, "valuation": 1, "valuationDate": "2024-11-21T11:11:13.254888+01:00", "manuallyChanged": true }, { "initialValuationDate": "2024-11-21T11:11:13.254888+01:00", "initialValuation": 1, "valuation": 1, "valuationDate": "2024-11-21T11:11:13.254888+01:00", "manuallyChanged": true } ] }, { "estateId": "sample string 1", "initialValuationDate": "2024-11-21T11:11:13.254888+01:00", "initialValuation": 1, "endDate": "2024-11-21T11:11:13.254888+01:00", "valuationHistory": [ { "initialValuationDate": "2024-11-21T11:11:13.254888+01:00", "initialValuation": 1, "valuation": 1, "valuationDate": "2024-11-21T11:11:13.254888+01:00", "manuallyChanged": true }, { "initialValuationDate": "2024-11-21T11:11:13.254888+01:00", "initialValuation": 1, "valuation": 1, "valuationDate": "2024-11-21T11:11:13.254888+01:00", "manuallyChanged": true } ] } ] } ]
<ArrayOfCrmEstateValuation xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://schemas.datacontract.org/2004/07/Express.Connect.Api.Models.Contact.Crm"> <CrmEstateValuation> <ContactId>sample string 1</ContactId> <Estates> <ValuedEstate> <EndDate>2024-11-21T11:11:13.254888+01:00</EndDate> <EstateId>sample string 1</EstateId> <InitialValuation>1</InitialValuation> <InitialValuationDate>2024-11-21T11:11:13.254888+01:00</InitialValuationDate> <ValuationHistory> <ValuationHistory> <InitialValuation>1</InitialValuation> <InitialValuationDate>2024-11-21T11:11:13.254888+01:00</InitialValuationDate> <ManuallyChanged>true</ManuallyChanged> <Valuation>1</Valuation> <ValuationDate>2024-11-21T11:11:13.254888+01:00</ValuationDate> </ValuationHistory> <ValuationHistory> <InitialValuation>1</InitialValuation> <InitialValuationDate>2024-11-21T11:11:13.254888+01:00</InitialValuationDate> <ManuallyChanged>true</ManuallyChanged> <Valuation>1</Valuation> <ValuationDate>2024-11-21T11:11:13.254888+01:00</ValuationDate> </ValuationHistory> </ValuationHistory> </ValuedEstate> <ValuedEstate> <EndDate>2024-11-21T11:11:13.254888+01:00</EndDate> <EstateId>sample string 1</EstateId> <InitialValuation>1</InitialValuation> <InitialValuationDate>2024-11-21T11:11:13.254888+01:00</InitialValuationDate> <ValuationHistory> <ValuationHistory> <InitialValuation>1</InitialValuation> <InitialValuationDate>2024-11-21T11:11:13.254888+01:00</InitialValuationDate> <ManuallyChanged>true</ManuallyChanged> <Valuation>1</Valuation> <ValuationDate>2024-11-21T11:11:13.254888+01:00</ValuationDate> </ValuationHistory> <ValuationHistory> <InitialValuation>1</InitialValuation> <InitialValuationDate>2024-11-21T11:11:13.254888+01:00</InitialValuationDate> <ManuallyChanged>true</ManuallyChanged> <Valuation>1</Valuation> <ValuationDate>2024-11-21T11:11:13.254888+01:00</ValuationDate> </ValuationHistory> </ValuationHistory> </ValuedEstate> </Estates> </CrmEstateValuation> <CrmEstateValuation> <ContactId>sample string 1</ContactId> <Estates> <ValuedEstate> <EndDate>2024-11-21T11:11:13.254888+01:00</EndDate> <EstateId>sample string 1</EstateId> <InitialValuation>1</InitialValuation> <InitialValuationDate>2024-11-21T11:11:13.254888+01:00</InitialValuationDate> <ValuationHistory> <ValuationHistory> <InitialValuation>1</InitialValuation> <InitialValuationDate>2024-11-21T11:11:13.254888+01:00</InitialValuationDate> <ManuallyChanged>true</ManuallyChanged> <Valuation>1</Valuation> <ValuationDate>2024-11-21T11:11:13.254888+01:00</ValuationDate> </ValuationHistory> <ValuationHistory> <InitialValuation>1</InitialValuation> <InitialValuationDate>2024-11-21T11:11:13.254888+01:00</InitialValuationDate> <ManuallyChanged>true</ManuallyChanged> <Valuation>1</Valuation> <ValuationDate>2024-11-21T11:11:13.254888+01:00</ValuationDate> </ValuationHistory> </ValuationHistory> </ValuedEstate> <ValuedEstate> <EndDate>2024-11-21T11:11:13.254888+01:00</EndDate> <EstateId>sample string 1</EstateId> <InitialValuation>1</InitialValuation> <InitialValuationDate>2024-11-21T11:11:13.254888+01:00</InitialValuationDate> <ValuationHistory> <ValuationHistory> <InitialValuation>1</InitialValuation> <InitialValuationDate>2024-11-21T11:11:13.254888+01:00</InitialValuationDate> <ManuallyChanged>true</ManuallyChanged> <Valuation>1</Valuation> <ValuationDate>2024-11-21T11:11:13.254888+01:00</ValuationDate> </ValuationHistory> <ValuationHistory> <InitialValuation>1</InitialValuation> <InitialValuationDate>2024-11-21T11:11:13.254888+01:00</InitialValuationDate> <ManuallyChanged>true</ManuallyChanged> <Valuation>1</Valuation> <ValuationDate>2024-11-21T11:11:13.254888+01:00</ValuationDate> </ValuationHistory> </ValuationHistory> </ValuedEstate> </Estates> </CrmEstateValuation> </ArrayOfCrmEstateValuation>