{ "updatePerson": { "contactId": "sample string 1", "customerId": "sample string 2", "categoryIds": [ "sample string 1", "sample string 2" ], "address": { "streetAddress": "sample string 1", "zipCode": "sample string 2", "city": "sample string 3", "countryCode": "sample string 4" }, "email": { "emailAddress": "sample string 1", "emailAddress2": "sample string 2" }, "userId": "sample string 3", "otherPhone": "sample string 4", "wishAdvertising": true, "note": "sample string 5", "coordinate": { "longitud": 1.1, "latitud": 2.1 }, "task": { "predefinedTaskId": "sample string 1", "note": "sample string 2", "estateId": "sample string 3", "assignedTo": "sample string 4" }, "customField": { "name": "sample string 1", "value": "sample string 2" }, "firstName": "sample string 6", "lastName": "sample string 7", "socialSecurityNumber": "sample string 8", "isForeignSocialSecurityNumber": true, "telePhone": "sample string 9", "workPhone": "sample string 10", "cellPhone": "sample string 11", "approval": true, "approvalDate": "2024-11-21T09:52:41.0807795+01:00", "gdprApprovalDate": "2024-11-21T09:52:41.0807795+01:00", "obtainThrough": "Interest", "leadScore": 1 }, "participated": true, "reminderTime": 2, "smsReminder": true, "mailConfirmation": true, "smsConfirmation": true, "returnBookingId": true, "contactMessage": "sample string 7", "leadSourceId": "sample string 8", "options": { "isDeadlineValidationEnabled": true, "enableBookingLimitValidation": true } }
Dokumentation för API-funktioner
POST Viewing/{customerId}/{viewingId}/{timeSlotId}/Participant
Lägg till ny visningsdeltagare på en befintligt bostad
Request Information
URI Parameters
Body Parameters
Visningsdeltagaren. AddNewViewingParticipant
Response Information
Resource Description
Lägg till ny visningsdeltagare på en befintligt bostad
string
Kodexempel
Testformulär
Text input
Response Formats
Namn | Beskrivning | Typ | Information |
viewingId | Visningsid | string |
Krävs |
timeSlotId | Id på visningstillfället | string |
Krävs |
customerId | Kundid | string |
Namn | Beskrivning | Typ | Information |
UpdatePerson | Kontakt | UpdatePerson | |
Participated | Deltog | boolean | |
ReminderTime | Minuter innan visningen som påminnelse ska skickas ut | integer | |
SMSReminder | SMS påminnelse | boolean | |
MailConfirmation | Bekräftelse via epost | boolean | |
SMSConfirmation | Bekräftelse via SMS | boolean | |
ReturnBookingId | boolean | ||
ContactMessage | Meddelande från kontaktpersonen. Meddelandet kommer att sparas på det lead som skapas i samband med att visningsdeltagaren läggs till. | string | |
LeadSourceId | Leadskälla - Det lead som skapas i samband med anmälan till visning kommer att kopplas till aktuell leadskälla. Om fältet inte anges, kommer leadet att kopplas till en förvald leadskälla. | string | |
Options | Alternativ som rör bokningen | ViewingParticipantBookingOptions |
Request Formats
<AddNewViewingParticipant xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://schemas.datacontract.org/2004/07/Vitec.Housing.Connect.Api.Models.Viewing"> <ContactMessage>sample string 7</ContactMessage> <LeadSourceId>sample string 8</LeadSourceId> <MailConfirmation>true</MailConfirmation> <Options> <EnableBookingLimitValidation>true</EnableBookingLimitValidation> <IsDeadlineValidationEnabled>true</IsDeadlineValidationEnabled> </Options> <Participated>true</Participated> <ReminderTime>2</ReminderTime> <ReturnBookingId>true</ReturnBookingId> <SMSConfirmation>true</SMSConfirmation> <SMSReminder>true</SMSReminder> <UpdatePerson> <Address xmlns:d3p1="http://schemas.datacontract.org/2004/07/Vitec.Housing.Connect.Api.Models"> <d3p1:City>sample string 3</d3p1:City> <d3p1:CountryCode>sample string 4</d3p1:CountryCode> <d3p1:StreetAddress>sample string 1</d3p1:StreetAddress> <d3p1:ZipCode>sample string 2</d3p1:ZipCode> </Address> <Approval>true</Approval> <ApprovalDate>2024-11-21T09:52:41.0807795+01:00</ApprovalDate> <CategoryIds xmlns:d3p1="http://schemas.microsoft.com/2003/10/Serialization/Arrays"> <d3p1:string>sample string 1</d3p1:string> <d3p1:string>sample string 2</d3p1:string> </CategoryIds> <CellPhone>sample string 11</CellPhone> <ContactId>sample string 1</ContactId> <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> <CustomField xmlns:d3p1="http://schemas.datacontract.org/2004/07/Vitec.Housing.Connect.Api.Models.CustomField"> <d3p1:Name>sample string 1</d3p1:Name> <d3p1:Value>sample string 2</d3p1:Value> </CustomField> <CustomerId>sample string 2</CustomerId> <Email xmlns:d3p1="http://schemas.datacontract.org/2004/07/Vitec.Housing.Connect.Api.Models"> <d3p1:EmailAddress>sample string 1</d3p1:EmailAddress> <d3p1:EmailAddress2>sample string 2</d3p1:EmailAddress2> </Email> <FirstName>sample string 6</FirstName> <GDPRApprovalDate>2024-11-21T09:52:41.0807795+01:00</GDPRApprovalDate> <IsForeignSocialSecurityNumber>true</IsForeignSocialSecurityNumber> <LastName>sample string 7</LastName> <LeadScore>1</LeadScore> <Note>sample string 5</Note> <ObtainThrough>Interest</ObtainThrough> <OtherPhone>sample string 4</OtherPhone> <SocialSecurityNumber>sample string 8</SocialSecurityNumber> <Task xmlns:d3p1="http://schemas.datacontract.org/2004/07/Vitec.Housing.Connect.Api.Models.Task"> <d3p1:AssignedTo>sample string 4</d3p1:AssignedTo> <d3p1:EstateId>sample string 3</d3p1:EstateId> <d3p1:Note>sample string 2</d3p1:Note> <d3p1:PredefinedTaskId>sample string 1</d3p1:PredefinedTaskId> </Task> <TelePhone>sample string 9</TelePhone> <UserId>sample string 3</UserId> <WishAdvertising>true</WishAdvertising> <WorkPhone>sample string 10</WorkPhone> </UpdatePerson> </AddNewViewingParticipant>
curl "https://connect.maklare.vitec.net/Viewing/StringValue/StringValue/StringValue/Participant" -X POST -H "Content-Type: application/json" -H "Authorization: basic {Base64 kodad användarnamn och lösenord}" -d {\"updatePerson\":{\"contactId\":\"StringValue\",\"customerId\":\"StringValue\",\"categoryIds\":[\"StringValue\"]},\"participated\":false,\"reminderTime\":0}
$URL = "https://connect.maklare.vitec.net/Viewing/StringValue/StringValue/StringValue/Participant"
$data = "{`"updatePerson`":{`"contactId`":`"StringValue`",`"customerId`":`"StringValue`",`"categoryIds`":[`"StringValue`"]},`"participated`":false,`"reminderTime`":0}"
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 = "{\"updatePerson\":{\"contactId\":\"StringValue\",\"customerId\":\"StringValue\",\"categoryIds\":[\"StringValue\"]},\"participated\":false,\"reminderTime\":0}";
using (var response = await HttpClientInstance.PostAsync("Viewing/StringValue/StringValue/StringValue/Participant", 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
}
var json = await response.Content.ReadAsStringAsync();
// JsonConvert finns i biblioteket Newtonsoft.Json
var result = JsonConvert.DeserializeObject<dynamic>(json);
// TODO: Gör något med resultatet
}
$URL = "https://connect.maklare.vitec.net/Viewing/StringValue/StringValue/StringValue/Participant";
$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 = "{\"updatePerson\":{\"contactId\":\"StringValue\",\"customerId\":\"StringValue\",\"categoryIds\":[\"StringValue\"]},\"participated\":false,\"reminderTime\":0}";
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
}
// TODO: Gör något med resultatet
Resultat av begäran
"sample string 1"
<string xmlns="http://schemas.microsoft.com/2003/10/Serialization/">sample string 1</string>