curl "https://connect.maklare.vitec.net/PublicAdvertising/Cottage/StringValue/StringValue" -X GET -H "Authorization: basic {Base64 kodad användarnamn och lösenord}"
Dokumentation för API-funktioner
GET PublicAdvertising/Cottage/{customerId}/{id}
Hämta fritidshus
Request Information
URI Parameters
Response Information
Resource Description
Hämta fritidshus
Cottage
Kodexempel
Testformulär
Text input
Response Formats
Namn | Beskrivning | Typ | Information |
customerId | Kundid | string |
Krävs |
id | Bostadens id | string |
Krävs |
Namn | Beskrivning | Typ | Information |
Marketing | Marknadsföring | CottageMarketing | |
PropertyDesignation | Fastighetsbeteckning | string | |
ProjectId | Projektid om bostaden ingår i ett projekt | string | |
Type | Typ av hus | HousingType | |
Tenure | Upplåtelseform | HousingTenure | |
Building | Byggnad | Building | |
Taxation | Taxeringsvärden | Taxation | |
Expenses | Utgifter | HousingExpenses | |
PlotInfo | Tomtuppgifter | PlotInfo | |
Price | Prisuppgift | Price | |
EnergyDeclaration | Energideklaration | EnergyDeclaration | |
VerifiedBidding | Verified budgivning | VerifiedBidding | |
Id | Bostadens id | string | |
Status | Status på försäljningen/uthyrningen. | EstateStatus | |
OfficeAffiliation | Kontorstillhörighet | OfficeAffiliation | |
CustomAttributes | Ytterligare specialiseringsattribut | Dictionary of string [key] and string [value] | |
PrimaryAgentId | Id på huvudhandläggare | string | |
SecondaryAgentId | Id på andrahandläggare | string | |
Address | Adress och geografiska uppgifter | Address | |
Texts | Texter | Texts | |
Surroundings | Närområde | Surroundings | |
AcceptingBids | Om budgivning pågår | boolean | |
IsVerifiedBidding | Om budgivningen är en verifierad budgivning | boolean | |
ChangedAt | När bostaden senast ändrades | date | |
AdmissionAt | Tillträde vid | date | |
Urls | Url:er | Urls | |
Files | Filer | Collection of File | |
Viewings | Visningar | Collection of Viewing | |
Images | Bilder | Collection of Image | |
IsAdvertisedOnHomepage | Annonserad på hemsida | boolean |
$URL = "https://connect.maklare.vitec.net/PublicAdvertising/Cottage/StringValue/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("PublicAdvertising/Cottage/StringValue/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 marketing = result.marketing.Value ;
// TODO: Gör något med resultatet
}
$URL = "https://connect.maklare.vitec.net/PublicAdvertising/Cottage/StringValue/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
}
$field_on_result = $result["marketing"];
// TODO: Gör något med resultatet
Resultat av begäran
{ "marketing": { "allYear": true, "isFarm": true, "isHousingCooperative": true, "isOtherType": true, "isNewHome": true, "swapDemanded": true, "isFutureSale": true, "isSoonForSale": true }, "propertyDesignation": "sample string 1", "projectId": "sample string 2", "type": "DuplexHouse", "tenure": "Owned", "building": { "numberOfRooms": 1.1, "roomDescription": "sample string 2", "yearBuilt": 3, "grossFloorArea": 4.1, "livingSpace": 5.1 }, "taxation": { "buildingValue": 1.1, "code": "sample string 2", "totalValue": 3.1, "year": 1 }, "expenses": { "operatingCost": 1.1, "plotRent": 2.1, "isLeasehold": true }, "plotInfo": { "plotSize": 1.1 }, "price": { "swedishCurrency": 1.1, "foreignCurrency": { "value": 1.1, "currency": "sample string 2" }, "text": "sample string 2" }, "energyDeclaration": { "energyPerformance": 1.1, "energyClass": "sample string 1" }, "verifiedBidding": { "id": "sample string 1", "name": "sample string 2", "isActive": true }, "id": "sample string 3", "status": "SoonForSale", "officeAffiliation": { "officeId": "sample string 1", "customerId": "sample string 2" }, "customAttributes": { "sample string 1": "sample string 2", "sample string 3": "sample string 4" }, "primaryAgentId": "sample string 4", "secondaryAgentId": "sample string 5", "address": { "streetAddress": "sample string 1", "zipCode": "sample string 2", "city": "sample string 3", "areaName": "sample string 4", "countryCode": "sample string 5", "countyMunicipalityParishCode": "sample string 6", "wgs84Coordinate": { "longitude": 1.1, "latitude": 2.1 }, "directions": "sample string 7" }, "texts": { "shortSaleDescription": "sample string 1", "saleDescription": "sample string 2", "salePhrase": "sample string 3", "saleHeading": "sample string 4" }, "surroundings": { "service": "sample string 1", "communication": "sample string 2", "generalAboutArea": "sample string 3", "parking": "sample string 4", "other": "sample string 5" }, "acceptingBids": true, "isVerifiedBidding": true, "changedAt": "2025-01-22T18:08:22.2710255+01:00", "admissionAt": "2025-01-22T18:08:22.2710255+01:00", "urls": { "description": "sample string 1", "imageList": "sample string 2" }, "files": [ { "id": "sample string 1", "extension": "sample string 2", "description": "sample string 3", "dataChangedAt": "2025-01-22T18:08:22.2710255+01:00" }, { "id": "sample string 1", "extension": "sample string 2", "description": "sample string 3", "dataChangedAt": "2025-01-22T18:08:22.2710255+01:00" } ], "viewings": [ { "id": "sample string 1", "startsAt": "2025-01-22T18:08:22.2710255+01:00", "endsAt": "2025-01-22T18:08:22.2710255+01:00", "comment": "sample string 4" }, { "id": "sample string 1", "startsAt": "2025-01-22T18:08:22.2710255+01:00", "endsAt": "2025-01-22T18:08:22.2710255+01:00", "comment": "sample string 4" } ], "images": [ { "id": "sample string 1", "dataChangedAt": "2025-01-22T18:08:22.2710255+01:00", "description": "sample string 3", "name": "sample string 4", "category": "Layout", "tags": "sample string 5", "extension": "sample string 6", "cdnReferences": [ { "name": "sample string 1", "url": "sample string 2" }, { "name": "sample string 1", "url": "sample string 2" } ] }, { "id": "sample string 1", "dataChangedAt": "2025-01-22T18:08:22.2710255+01:00", "description": "sample string 3", "name": "sample string 4", "category": "Layout", "tags": "sample string 5", "extension": "sample string 6", "cdnReferences": [ { "name": "sample string 1", "url": "sample string 2" }, { "name": "sample string 1", "url": "sample string 2" } ] } ], "isAdvertisedOnHomepage": true }
<Cottage xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://schemas.datacontract.org/2004/07/Vitec.Housing.Connect.Api.Models.PublicAdvertisement"> <AcceptingBids>true</AcceptingBids> <Address> <AreaName>sample string 4</AreaName> <City>sample string 3</City> <CountryCode>sample string 5</CountryCode> <CountyMunicipalityParishCode>sample string 6</CountyMunicipalityParishCode> <Directions>sample string 7</Directions> <StreetAddress>sample string 1</StreetAddress> <Wgs84Coordinate> <Latitude>2.1</Latitude> <Longitude>1.1</Longitude> </Wgs84Coordinate> <ZipCode>sample string 2</ZipCode> </Address> <AdmissionAt>2025-01-22T18:08:22.2710255+01:00</AdmissionAt> <ChangedAt>2025-01-22T18:08:22.2710255+01:00</ChangedAt> <CustomAttributes xmlns:d2p1="http://schemas.microsoft.com/2003/10/Serialization/Arrays"> <d2p1:KeyValueOfstringstring> <d2p1:Key>sample string 1</d2p1:Key> <d2p1:Value>sample string 2</d2p1:Value> </d2p1:KeyValueOfstringstring> <d2p1:KeyValueOfstringstring> <d2p1:Key>sample string 3</d2p1:Key> <d2p1:Value>sample string 4</d2p1:Value> </d2p1:KeyValueOfstringstring> </CustomAttributes> <Files xmlns:d2p1="http://schemas.datacontract.org/2004/07/Vitec.Housing.Connect.Api.Models.PublicAdvertisement.Media"> <d2p1:File> <d2p1:DataChangedAt>2025-01-22T18:08:22.2710255+01:00</d2p1:DataChangedAt> <d2p1:Description>sample string 3</d2p1:Description> <d2p1:Extension>sample string 2</d2p1:Extension> <d2p1:Id>sample string 1</d2p1:Id> </d2p1:File> <d2p1:File> <d2p1:DataChangedAt>2025-01-22T18:08:22.2710255+01:00</d2p1:DataChangedAt> <d2p1:Description>sample string 3</d2p1:Description> <d2p1:Extension>sample string 2</d2p1:Extension> <d2p1:Id>sample string 1</d2p1:Id> </d2p1:File> </Files> <Id>sample string 3</Id> <Images> <Image> <Category>Layout</Category> <CdnReferences xmlns:d4p1="http://schemas.datacontract.org/2004/07/Vitec.Housing.Connect.Api"> <d4p1:CdnImageReference> <d4p1:Name>sample string 1</d4p1:Name> <d4p1:Url>sample string 2</d4p1:Url> </d4p1:CdnImageReference> <d4p1:CdnImageReference> <d4p1:Name>sample string 1</d4p1:Name> <d4p1:Url>sample string 2</d4p1:Url> </d4p1:CdnImageReference> </CdnReferences> <DataChangedAt>2025-01-22T18:08:22.2710255+01:00</DataChangedAt> <Description>sample string 3</Description> <Extension>sample string 6</Extension> <Id>sample string 1</Id> <Name>sample string 4</Name> <Tags>sample string 5</Tags> </Image> <Image> <Category>Layout</Category> <CdnReferences xmlns:d4p1="http://schemas.datacontract.org/2004/07/Vitec.Housing.Connect.Api"> <d4p1:CdnImageReference> <d4p1:Name>sample string 1</d4p1:Name> <d4p1:Url>sample string 2</d4p1:Url> </d4p1:CdnImageReference> <d4p1:CdnImageReference> <d4p1:Name>sample string 1</d4p1:Name> <d4p1:Url>sample string 2</d4p1:Url> </d4p1:CdnImageReference> </CdnReferences> <DataChangedAt>2025-01-22T18:08:22.2710255+01:00</DataChangedAt> <Description>sample string 3</Description> <Extension>sample string 6</Extension> <Id>sample string 1</Id> <Name>sample string 4</Name> <Tags>sample string 5</Tags> </Image> </Images> <IsAdvertisedOnHomepage>true</IsAdvertisedOnHomepage> <IsVerifiedBidding>true</IsVerifiedBidding> <OfficeAffiliation> <CustomerId>sample string 2</CustomerId> <OfficeId>sample string 1</OfficeId> </OfficeAffiliation> <PrimaryAgentId>sample string 4</PrimaryAgentId> <SecondaryAgentId>sample string 5</SecondaryAgentId> <Status>SoonForSale</Status> <Surroundings> <Communication>sample string 2</Communication> <GeneralAboutArea>sample string 3</GeneralAboutArea> <Other>sample string 5</Other> <Parking>sample string 4</Parking> <Service>sample string 1</Service> </Surroundings> <Texts> <SaleDescription>sample string 2</SaleDescription> <SaleHeading>sample string 4</SaleHeading> <SalePhrase>sample string 3</SalePhrase> <ShortSaleDescription>sample string 1</ShortSaleDescription> </Texts> <Urls> <Description>sample string 1</Description> <ImageList>sample string 2</ImageList> </Urls> <Viewings> <Viewing> <Comment>sample string 4</Comment> <EndsAt>2025-01-22T18:08:22.2710255+01:00</EndsAt> <Id>sample string 1</Id> <StartsAt>2025-01-22T18:08:22.2710255+01:00</StartsAt> </Viewing> <Viewing> <Comment>sample string 4</Comment> <EndsAt>2025-01-22T18:08:22.2710255+01:00</EndsAt> <Id>sample string 1</Id> <StartsAt>2025-01-22T18:08:22.2710255+01:00</StartsAt> </Viewing> </Viewings> <Building> <GrossFloorArea>4.1</GrossFloorArea> <LivingSpace>5.1</LivingSpace> <NumberOfRooms>1.1</NumberOfRooms> <RoomDescription>sample string 2</RoomDescription> <YearBuilt>3</YearBuilt> </Building> <EnergyDeclaration> <EnergyClass>sample string 1</EnergyClass> <EnergyPerformance>1.1</EnergyPerformance> </EnergyDeclaration> <Expenses> <IsLeasehold>true</IsLeasehold> <OperatingCost>1.1</OperatingCost> <PlotRent>2.1</PlotRent> </Expenses> <PlotInfo> <PlotSize>1.1</PlotSize> </PlotInfo> <Price> <ForeignCurrency xmlns:d3p1="http://schemas.datacontract.org/2004/07/Vitec.Housing.Connect.Api.Models"> <d3p1:Currency>sample string 2</d3p1:Currency> <d3p1:Value>1.1</d3p1:Value> </ForeignCurrency> <SwedishCurrency>1.1</SwedishCurrency> <Text>sample string 2</Text> </Price> <ProjectId>sample string 2</ProjectId> <PropertyDesignation>sample string 1</PropertyDesignation> <Taxation> <BuildingValue>1.1</BuildingValue> <Code>sample string 2</Code> <TotalValue>3.1</TotalValue> <Year>1</Year> </Taxation> <Tenure>Owned</Tenure> <Type>DuplexHouse</Type> <VerifiedBidding> <Id>sample string 1</Id> <IsActive>true</IsActive> <Name>sample string 2</Name> </VerifiedBidding> <Marketing> <IsFutureSale>true</IsFutureSale> <IsSoonForSale>true</IsSoonForSale> <IsNewHome>true</IsNewHome> <SwapDemanded>true</SwapDemanded> <AllYear>true</AllYear> <IsFarm>true</IsFarm> <IsHousingCooperative>true</IsHousingCooperative> <IsOtherType>true</IsOtherType> </Marketing> </Cottage>