curl "https://connect.maklare.vitec.net/PublicAdvertising/Project/StringValue/StringValue" -X GET -H "Authorization: basic {Base64 kodad användarnamn och lösenord}"
Dokumentation för API-funktioner
GET PublicAdvertising/Project/{customerId}/{id}
Hämta projekt
Request Information
URI Parameters
Response Information
Resource Description
Hämta projekt
Project
Kodexempel
Testformulär
Text input
Response Formats
Namn | Beskrivning | Typ | Information |
customerId | Kundid | string |
Krävs |
id | Projektets id | string |
Krävs |
Namn | Beskrivning | Typ | Information |
Id | Projektets id | string | |
Status | Status på projektet. | ProjectStatus | |
Name | Projektets namn | string | |
Marketing | Marknadsföring | ProjectMarketing | |
OfficeAffiliation | Kontorstillhörighet | OfficeAffiliation | |
PrimaryAgentId | Id på huvudhandläggare | string | |
SecondaryAgentId | Id på andrahandläggare | string | |
Address | Adress och geografiska uppgifter | Address | |
Texts | Texter | Texts | |
ChangedAt | När bostaden senast ändrades | date | |
SellstartDate | Dag för säljstart | date | |
PossibleAdmissionDate | Preliminär dag för inflyttning | string | |
Urls | Url:er | Urls | |
Viewings | Visningar | Collection of Viewing | |
Images | Bilder | Collection of Image | |
Files | Filer | Collection of File | |
Houses | Villor som ingår i projektet | Collection of ProjectEstateRelation | |
Plots | Tomter som ingår i projektet | Collection of ProjectEstateRelation | |
HousingCooperatives | Bostadsrätter som ingår i projektet | Collection of ProjectEstateRelation | |
Condominiums | Ägarlägenheter som ingår i projektet | Collection of ProjectEstateRelation | |
Premises | Lokaler som ingår i projektet | Collection of ProjectEstateRelation | |
ForeignProperties | Utländska bostäder som ingår i projektet | Collection of ProjectEstateRelation | |
Cottages | Fritidshus som ingår i projektet | Collection of ProjectEstateRelation | |
IsAdvertisedOnHomepage | Annonserad på hemsida | boolean |
$URL = "https://connect.maklare.vitec.net/PublicAdvertising/Project/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/Project/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 id = result.id.Value ;
// TODO: Gör något med resultatet
}
$URL = "https://connect.maklare.vitec.net/PublicAdvertising/Project/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["id"];
// TODO: Gör något med resultatet
Resultat av begäran
{ "id": "sample string 1", "status": "Future", "name": "sample string 2", "marketing": {}, "officeAffiliation": { "officeId": "sample string 1", "customerId": "sample string 2" }, "primaryAgentId": "sample string 3", "secondaryAgentId": "sample string 4", "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" }, "changedAt": "2025-01-22T09:16:46.9653446+01:00", "sellstartDate": "2025-01-22T09:16:46.9653446+01:00", "possibleAdmissionDate": "sample string 6", "urls": { "description": "sample string 1", "imageList": "sample string 2" }, "viewings": [ { "id": "sample string 1", "startsAt": "2025-01-22T09:16:46.9653446+01:00", "endsAt": "2025-01-22T09:16:46.9653446+01:00", "comment": "sample string 4" }, { "id": "sample string 1", "startsAt": "2025-01-22T09:16:46.9653446+01:00", "endsAt": "2025-01-22T09:16:46.9653446+01:00", "comment": "sample string 4" } ], "images": [ { "id": "sample string 1", "dataChangedAt": "2025-01-22T09:16:46.9653446+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-22T09:16:46.9653446+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" } ] } ], "files": [ { "id": "sample string 1", "extension": "sample string 2", "description": "sample string 3", "dataChangedAt": "2025-01-22T09:16:46.9653446+01:00" }, { "id": "sample string 1", "extension": "sample string 2", "description": "sample string 3", "dataChangedAt": "2025-01-22T09:16:46.9653446+01:00" } ], "houses": [ { "estateId": "sample string 1" }, { "estateId": "sample string 1" } ], "plots": [ { "estateId": "sample string 1" }, { "estateId": "sample string 1" } ], "housingCooperatives": [ { "estateId": "sample string 1" }, { "estateId": "sample string 1" } ], "condominiums": [ { "estateId": "sample string 1" }, { "estateId": "sample string 1" } ], "premises": [ { "estateId": "sample string 1" }, { "estateId": "sample string 1" } ], "foreignProperties": [ { "estateId": "sample string 1" }, { "estateId": "sample string 1" } ], "cottages": [ { "estateId": "sample string 1" }, { "estateId": "sample string 1" } ], "isAdvertisedOnHomepage": true }
<Project xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://schemas.datacontract.org/2004/07/Vitec.Housing.Connect.Api.Models.PublicAdvertisement"> <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> <ChangedAt>2025-01-22T09:16:46.9653446+01:00</ChangedAt> <Condominiums> <ProjectEstateRelation> <EstateId>sample string 1</EstateId> </ProjectEstateRelation> <ProjectEstateRelation> <EstateId>sample string 1</EstateId> </ProjectEstateRelation> </Condominiums> <Cottages> <ProjectEstateRelation> <EstateId>sample string 1</EstateId> </ProjectEstateRelation> <ProjectEstateRelation> <EstateId>sample string 1</EstateId> </ProjectEstateRelation> </Cottages> <Files xmlns:d2p1="http://schemas.datacontract.org/2004/07/Vitec.Housing.Connect.Api.Models.PublicAdvertisement.Media"> <d2p1:File> <d2p1:DataChangedAt>2025-01-22T09:16:46.9653446+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-22T09:16:46.9653446+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> <ForeignProperties> <ProjectEstateRelation> <EstateId>sample string 1</EstateId> </ProjectEstateRelation> <ProjectEstateRelation> <EstateId>sample string 1</EstateId> </ProjectEstateRelation> </ForeignProperties> <Houses> <ProjectEstateRelation> <EstateId>sample string 1</EstateId> </ProjectEstateRelation> <ProjectEstateRelation> <EstateId>sample string 1</EstateId> </ProjectEstateRelation> </Houses> <HousingCooperatives> <ProjectEstateRelation> <EstateId>sample string 1</EstateId> </ProjectEstateRelation> <ProjectEstateRelation> <EstateId>sample string 1</EstateId> </ProjectEstateRelation> </HousingCooperatives> <Id>sample string 1</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-22T09:16:46.9653446+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-22T09:16:46.9653446+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> <Marketing /> <Name>sample string 2</Name> <OfficeAffiliation> <CustomerId>sample string 2</CustomerId> <OfficeId>sample string 1</OfficeId> </OfficeAffiliation> <Plots> <ProjectEstateRelation> <EstateId>sample string 1</EstateId> </ProjectEstateRelation> <ProjectEstateRelation> <EstateId>sample string 1</EstateId> </ProjectEstateRelation> </Plots> <PossibleAdmissionDate>sample string 6</PossibleAdmissionDate> <Premises> <ProjectEstateRelation> <EstateId>sample string 1</EstateId> </ProjectEstateRelation> <ProjectEstateRelation> <EstateId>sample string 1</EstateId> </ProjectEstateRelation> </Premises> <PrimaryAgentId>sample string 3</PrimaryAgentId> <SecondaryAgentId>sample string 4</SecondaryAgentId> <SellstartDate>2025-01-22T09:16:46.9653446+01:00</SellstartDate> <Status>Future</Status> <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-22T09:16:46.9653446+01:00</EndsAt> <Id>sample string 1</Id> <StartsAt>2025-01-22T09:16:46.9653446+01:00</StartsAt> </Viewing> <Viewing> <Comment>sample string 4</Comment> <EndsAt>2025-01-22T09:16:46.9653446+01:00</EndsAt> <Id>sample string 1</Id> <StartsAt>2025-01-22T09:16:46.9653446+01:00</StartsAt> </Viewing> </Viewings> </Project>