curl "https://connect.maklare.vitec.net/Advertising/Association/StringValue/StringValue" -X GET -H "Authorization: basic {Base64 kodad användarnamn och lösenord}"
Dokumentation för API-funktioner
GET Advertising/Association/{customerId}/{associationId}
Hämtar bostadsrättsförening
Request Information
URI Parameters
Response Information
Resource Description
Hämtar bostadsrättsförening
AdvertisingAssociation
Kodexempel
Testformulär
Text input
Response Formats
Namn | Beskrivning | Typ | Information |
customerId | string |
Krävs |
|
associationId | string |
Krävs |
Namn | Beskrivning | Typ | Information |
Id | Id | string | |
ChangedAt | När föreningen senast ändrades | date | |
Name | Föreningsnamn | string | |
CorporateNumber | Organisationsnummer | string | |
OrganizationalForm | Organisationsform | OrganizationalForm | |
Epostadress | string | ||
HomePage | Hemsida | string | |
GenuineAssociation | Äkta/oäkta bostadsrättsförening | AssociationTaxation | |
NumberOfApartments | Antal lägenheter | integer | |
NumberOfRentalApartments | Varav hyresrätter | integer | |
NumberOfPremises | Antal lokaler | integer | |
Descriptions | Beskrivningar | AssociationDescriptions |
Kan ersättas på objekt med OverridenDescriptions |
Economy | Ekonomi | AssociationEconomy |
Kan ersättas på objekt med OverridenEconomy |
PublicContact | Kontaktperson | AssociationContact |
Kan vara null |
Documents | Annonserade dokument | Collection of Document |
$URL = "https://connect.maklare.vitec.net/Advertising/Association/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("Advertising/Association/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/Advertising/Association/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", "changedAt": "2025-01-29T03:53:41.0810003+01:00", "name": "sample string 3", "corporateNumber": "sample string 4", "organizationalForm": "TenantOwnedAssociation", "email": "sample string 5", "homePage": "sample string 6", "genuineAssociation": "Undetermined", "numberOfApartments": 1, "numberOfRentalApartments": 1, "numberOfPremises": 1, "descriptions": { "generalAboutAssociation": "sample string 1", "renovations": "sample string 2", "parking": "sample string 3", "tvAndBroadband": "sample string 4", "courtyard": "sample string 5", "sharedSpaces": "sample string 6", "insurance": "sample string 7", "other": "sample string 8" }, "economy": { "monthlyFeeInformation": "sample string 1", "finances": "sample string 2", "sublettingPolicy": "sample string 3", "theAssociationOwnTheGround": "sample string 4", "transferFee": 1, "transferFeePaidBy": "Undetermined", "pledgeFee": 1, "allowLegalPersonAsBuyer": "Undetermined", "allowsSharedOwnershipInfo": "sample string 5" }, "publicContact": { "name": "sample string 1", "cellPhone": "sample string 2", "otherPhone": "sample string 3", "email": "sample string 4" }, "documents": [ { "name": "sample string 1", "id": "sample string 2", "extension": "sample string 3", "url": "sample string 4", "dateChangedData": "2025-01-29T03:53:41.0810003+01:00", "category": "sample string 5" }, { "name": "sample string 1", "id": "sample string 2", "extension": "sample string 3", "url": "sample string 4", "dateChangedData": "2025-01-29T03:53:41.0810003+01:00", "category": "sample string 5" } ] }
<AdvertisingAssociation xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://schemas.datacontract.org/2004/07/Express.Connect.Api.Models.Advertising"> <ChangedAt>2025-01-29T03:53:41.0810003+01:00</ChangedAt> <CorporateNumber>sample string 4</CorporateNumber> <Descriptions xmlns:d2p1="http://schemas.datacontract.org/2004/07/Express.Connect.Api.Models.Association"> <d2p1:Courtyard>sample string 5</d2p1:Courtyard> <d2p1:GeneralAboutAssociation>sample string 1</d2p1:GeneralAboutAssociation> <d2p1:Insurance>sample string 7</d2p1:Insurance> <d2p1:Other>sample string 8</d2p1:Other> <d2p1:Parking>sample string 3</d2p1:Parking> <d2p1:Renovations>sample string 2</d2p1:Renovations> <d2p1:SharedSpaces>sample string 6</d2p1:SharedSpaces> <d2p1:TvAndBroadband>sample string 4</d2p1:TvAndBroadband> </Descriptions> <Documents xmlns:d2p1="http://schemas.datacontract.org/2004/07/Vitec.Housing.Connect.Api.Models.Estate.Common"> <d2p1:Document> <d2p1:Category>sample string 5</d2p1:Category> <d2p1:DateChangedData>2025-01-29T03:53:41.0810003+01:00</d2p1:DateChangedData> <d2p1:Extension>sample string 3</d2p1:Extension> <d2p1:Id>sample string 2</d2p1:Id> <d2p1:Name>sample string 1</d2p1:Name> <d2p1:Url>sample string 4</d2p1:Url> </d2p1:Document> <d2p1:Document> <d2p1:Category>sample string 5</d2p1:Category> <d2p1:DateChangedData>2025-01-29T03:53:41.0810003+01:00</d2p1:DateChangedData> <d2p1:Extension>sample string 3</d2p1:Extension> <d2p1:Id>sample string 2</d2p1:Id> <d2p1:Name>sample string 1</d2p1:Name> <d2p1:Url>sample string 4</d2p1:Url> </d2p1:Document> </Documents> <Economy xmlns:d2p1="http://schemas.datacontract.org/2004/07/Express.Connect.Api.Models.Association"> <d2p1:AllowLegalPersonAsBuyer>Undetermined</d2p1:AllowLegalPersonAsBuyer> <d2p1:AllowsSharedOwnershipInfo>sample string 5</d2p1:AllowsSharedOwnershipInfo> <d2p1:Finances>sample string 2</d2p1:Finances> <d2p1:MonthlyFeeInformation>sample string 1</d2p1:MonthlyFeeInformation> <d2p1:PledgeFee>1</d2p1:PledgeFee> <d2p1:SublettingPolicy>sample string 3</d2p1:SublettingPolicy> <d2p1:TheAssociationOwnTheGround>sample string 4</d2p1:TheAssociationOwnTheGround> <d2p1:TransferFee>1</d2p1:TransferFee> <d2p1:TransferFeePaidBy>Undetermined</d2p1:TransferFeePaidBy> </Economy> <Email>sample string 5</Email> <GenuineAssociation>Undetermined</GenuineAssociation> <HomePage>sample string 6</HomePage> <Id>sample string 1</Id> <Name>sample string 3</Name> <NumberOfApartments>1</NumberOfApartments> <NumberOfPremises>1</NumberOfPremises> <NumberOfRentalApartments>1</NumberOfRentalApartments> <OrganizationalForm>TenantOwnedAssociation</OrganizationalForm> <PublicContact> <CellPhone>sample string 2</CellPhone> <Email>sample string 4</Email> <Name>sample string 1</Name> <OtherPhone>sample string 3</OtherPhone> </PublicContact> </AdvertisingAssociation>