curl "https://connect.maklare.vitec.net/Area/GetAreas?AreaId=StringValue&CustomerId=StringValue" -X GET -H "Authorization: basic {Base64 kodad användarnamn och lösenord}"
Dokumentation för API-funktioner
GET Area/GetAreas
Hämtar en lista över områden.
Request Information
URI Parameters
Response Information
Resource Description
Hämtar en lista över områden.
Collection of Area
Kodexempel
Testformulär
Text input
Response Formats
Namn | Beskrivning | Typ | Information |
AreaId | Områdets id | string | |
CustomerId | Kund-id | string |
Required |
Namn | Beskrivning | Typ | Information |
AreaId | Områdets id | string | |
Archived | Arkiverad | boolean | |
ExternalId | Externt id | string | |
AreaName | Områdesnamn | string | |
Description | Beskrivning | string | |
ShowOnInternet | Visa på internet | boolean | |
Surrounding | Omgivning | Surrounding | |
County | LK-kod | string | |
Polygon | Området som 2d-polygon | Collection of Coordinate | |
PolygonWGS84 | Området som 2d-polygon i WGS84 | Collection of Coordinate | |
Coordinates | Områdets koordinater i formatet GeoJSON Multipolygon (longitud, latitud) | Collection of Collection of Collection of Collection of decimal number | |
Images | Bilder på området | Collection of AreaImage | |
DateChanged | Ändringsdatum | date |
$URL = "https://connect.maklare.vitec.net/Area/GetAreas?AreaId=StringValue&CustomerId=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("Area/GetAreas?AreaId=StringValue&CustomerId=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 areaId = firstInArray.areaId.Value ;
// TODO: Gör något med resultatet
}
$URL = "https://connect.maklare.vitec.net/Area/GetAreas?AreaId=StringValue&CustomerId=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["areaId"];
// TODO: Gör något med resultatet
Resultat av begäran
[ { "areaId": "sample string 1", "archived": true, "externalId": "sample string 3", "areaName": "sample string 4", "description": "sample string 5", "showOnInternet": true, "surrounding": { "generalAboutArea": "sample string 1", "nearService": "sample string 2", "communication": "sample string 3", "parking": "sample string 4", "other": "sample string 5" }, "county": "sample string 7", "polygon": [ { "longitud": 1.1, "latitud": 2.1 }, { "longitud": 1.1, "latitud": 2.1 } ], "polygonWGS84": [ { "longitud": 1.1, "latitud": 2.1 }, { "longitud": 1.1, "latitud": 2.1 } ], "coordinates": [ [ [ [ 1.1, 2.1 ], [ 1.1, 2.1 ] ], [ [ 1.1, 2.1 ], [ 1.1, 2.1 ] ] ], [ [ [ 1.1, 2.1 ], [ 1.1, 2.1 ] ], [ [ 1.1, 2.1 ], [ 1.1, 2.1 ] ] ] ], "images": [ { "imageId": "sample string 1", "dateChanged": "2024-11-21T10:11:46.9024833+01:00", "url": "sample string 3", "extension": "sample string 4", "showOnInternet": true, "text": "sample string 6", "textExtended": "sample string 7" }, { "imageId": "sample string 1", "dateChanged": "2024-11-21T10:11:46.9024833+01:00", "url": "sample string 3", "extension": "sample string 4", "showOnInternet": true, "text": "sample string 6", "textExtended": "sample string 7" } ], "dateChanged": "2024-11-21T10:11:46.9024833+01:00" }, { "areaId": "sample string 1", "archived": true, "externalId": "sample string 3", "areaName": "sample string 4", "description": "sample string 5", "showOnInternet": true, "surrounding": { "generalAboutArea": "sample string 1", "nearService": "sample string 2", "communication": "sample string 3", "parking": "sample string 4", "other": "sample string 5" }, "county": "sample string 7", "polygon": [ { "longitud": 1.1, "latitud": 2.1 }, { "longitud": 1.1, "latitud": 2.1 } ], "polygonWGS84": [ { "longitud": 1.1, "latitud": 2.1 }, { "longitud": 1.1, "latitud": 2.1 } ], "coordinates": [ [ [ [ 1.1, 2.1 ], [ 1.1, 2.1 ] ], [ [ 1.1, 2.1 ], [ 1.1, 2.1 ] ] ], [ [ [ 1.1, 2.1 ], [ 1.1, 2.1 ] ], [ [ 1.1, 2.1 ], [ 1.1, 2.1 ] ] ] ], "images": [ { "imageId": "sample string 1", "dateChanged": "2024-11-21T10:11:46.9024833+01:00", "url": "sample string 3", "extension": "sample string 4", "showOnInternet": true, "text": "sample string 6", "textExtended": "sample string 7" }, { "imageId": "sample string 1", "dateChanged": "2024-11-21T10:11:46.9024833+01:00", "url": "sample string 3", "extension": "sample string 4", "showOnInternet": true, "text": "sample string 6", "textExtended": "sample string 7" } ], "dateChanged": "2024-11-21T10:11:46.9024833+01:00" } ]
<ArrayOfArea xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://schemas.datacontract.org/2004/07/Vitec.Housing.Connect.Api.Models.Area"> <Area> <Archived>true</Archived> <AreaId>sample string 1</AreaId> <AreaName>sample string 4</AreaName> <Coordinates xmlns:d3p1="http://schemas.microsoft.com/2003/10/Serialization/Arrays"> <d3p1:ArrayOfArrayOfArrayOfdouble> <d3p1:ArrayOfArrayOfdouble> <d3p1:ArrayOfdouble> <d3p1:double>1.1</d3p1:double> <d3p1:double>2.1</d3p1:double> </d3p1:ArrayOfdouble> <d3p1:ArrayOfdouble> <d3p1:double>1.1</d3p1:double> <d3p1:double>2.1</d3p1:double> </d3p1:ArrayOfdouble> </d3p1:ArrayOfArrayOfdouble> <d3p1:ArrayOfArrayOfdouble> <d3p1:ArrayOfdouble> <d3p1:double>1.1</d3p1:double> <d3p1:double>2.1</d3p1:double> </d3p1:ArrayOfdouble> <d3p1:ArrayOfdouble> <d3p1:double>1.1</d3p1:double> <d3p1:double>2.1</d3p1:double> </d3p1:ArrayOfdouble> </d3p1:ArrayOfArrayOfdouble> </d3p1:ArrayOfArrayOfArrayOfdouble> <d3p1:ArrayOfArrayOfArrayOfdouble> <d3p1:ArrayOfArrayOfdouble> <d3p1:ArrayOfdouble> <d3p1:double>1.1</d3p1:double> <d3p1:double>2.1</d3p1:double> </d3p1:ArrayOfdouble> <d3p1:ArrayOfdouble> <d3p1:double>1.1</d3p1:double> <d3p1:double>2.1</d3p1:double> </d3p1:ArrayOfdouble> </d3p1:ArrayOfArrayOfdouble> <d3p1:ArrayOfArrayOfdouble> <d3p1:ArrayOfdouble> <d3p1:double>1.1</d3p1:double> <d3p1:double>2.1</d3p1:double> </d3p1:ArrayOfdouble> <d3p1:ArrayOfdouble> <d3p1:double>1.1</d3p1:double> <d3p1:double>2.1</d3p1:double> </d3p1:ArrayOfdouble> </d3p1:ArrayOfArrayOfdouble> </d3p1:ArrayOfArrayOfArrayOfdouble> </Coordinates> <County>sample string 7</County> <DateChanged>2024-11-21T10:11:46.9024833+01:00</DateChanged> <Description>sample string 5</Description> <ExternalId>sample string 3</ExternalId> <Images> <AreaImage> <DateChanged>2024-11-21T10:11:46.9024833+01:00</DateChanged> <Extension>sample string 4</Extension> <ImageId>sample string 1</ImageId> <ShowOnInternet>true</ShowOnInternet> <Text>sample string 6</Text> <TextExtended>sample string 7</TextExtended> <Url>sample string 3</Url> </AreaImage> <AreaImage> <DateChanged>2024-11-21T10:11:46.9024833+01:00</DateChanged> <Extension>sample string 4</Extension> <ImageId>sample string 1</ImageId> <ShowOnInternet>true</ShowOnInternet> <Text>sample string 6</Text> <TextExtended>sample string 7</TextExtended> <Url>sample string 3</Url> </AreaImage> </Images> <Polygon xmlns:d3p1="http://schemas.datacontract.org/2004/07/Vitec.Housing.Connect.Api.Models"> <d3p1:Coordinate> <d3p1:Latitud>2.1</d3p1:Latitud> <d3p1:Longitud>1.1</d3p1:Longitud> </d3p1:Coordinate> <d3p1:Coordinate> <d3p1:Latitud>2.1</d3p1:Latitud> <d3p1:Longitud>1.1</d3p1:Longitud> </d3p1:Coordinate> </Polygon> <PolygonWGS84 xmlns:d3p1="http://schemas.datacontract.org/2004/07/Vitec.Housing.Connect.Api.Models"> <d3p1:Coordinate> <d3p1:Latitud>2.1</d3p1:Latitud> <d3p1:Longitud>1.1</d3p1:Longitud> </d3p1:Coordinate> <d3p1:Coordinate> <d3p1:Latitud>2.1</d3p1:Latitud> <d3p1:Longitud>1.1</d3p1:Longitud> </d3p1:Coordinate> </PolygonWGS84> <ShowOnInternet>true</ShowOnInternet> <Surrounding xmlns:d3p1="http://schemas.datacontract.org/2004/07/Vitec.Housing.Connect.Api.Models.Estate.Common"> <d3p1:Communication>sample string 3</d3p1:Communication> <d3p1:GeneralAboutArea>sample string 1</d3p1:GeneralAboutArea> <d3p1:NearService>sample string 2</d3p1:NearService> <d3p1:Other>sample string 5</d3p1:Other> <d3p1:Parking>sample string 4</d3p1:Parking> </Surrounding> </Area> <Area> <Archived>true</Archived> <AreaId>sample string 1</AreaId> <AreaName>sample string 4</AreaName> <Coordinates xmlns:d3p1="http://schemas.microsoft.com/2003/10/Serialization/Arrays"> <d3p1:ArrayOfArrayOfArrayOfdouble> <d3p1:ArrayOfArrayOfdouble> <d3p1:ArrayOfdouble> <d3p1:double>1.1</d3p1:double> <d3p1:double>2.1</d3p1:double> </d3p1:ArrayOfdouble> <d3p1:ArrayOfdouble> <d3p1:double>1.1</d3p1:double> <d3p1:double>2.1</d3p1:double> </d3p1:ArrayOfdouble> </d3p1:ArrayOfArrayOfdouble> <d3p1:ArrayOfArrayOfdouble> <d3p1:ArrayOfdouble> <d3p1:double>1.1</d3p1:double> <d3p1:double>2.1</d3p1:double> </d3p1:ArrayOfdouble> <d3p1:ArrayOfdouble> <d3p1:double>1.1</d3p1:double> <d3p1:double>2.1</d3p1:double> </d3p1:ArrayOfdouble> </d3p1:ArrayOfArrayOfdouble> </d3p1:ArrayOfArrayOfArrayOfdouble> <d3p1:ArrayOfArrayOfArrayOfdouble> <d3p1:ArrayOfArrayOfdouble> <d3p1:ArrayOfdouble> <d3p1:double>1.1</d3p1:double> <d3p1:double>2.1</d3p1:double> </d3p1:ArrayOfdouble> <d3p1:ArrayOfdouble> <d3p1:double>1.1</d3p1:double> <d3p1:double>2.1</d3p1:double> </d3p1:ArrayOfdouble> </d3p1:ArrayOfArrayOfdouble> <d3p1:ArrayOfArrayOfdouble> <d3p1:ArrayOfdouble> <d3p1:double>1.1</d3p1:double> <d3p1:double>2.1</d3p1:double> </d3p1:ArrayOfdouble> <d3p1:ArrayOfdouble> <d3p1:double>1.1</d3p1:double> <d3p1:double>2.1</d3p1:double> </d3p1:ArrayOfdouble> </d3p1:ArrayOfArrayOfdouble> </d3p1:ArrayOfArrayOfArrayOfdouble> </Coordinates> <County>sample string 7</County> <DateChanged>2024-11-21T10:11:46.9024833+01:00</DateChanged> <Description>sample string 5</Description> <ExternalId>sample string 3</ExternalId> <Images> <AreaImage> <DateChanged>2024-11-21T10:11:46.9024833+01:00</DateChanged> <Extension>sample string 4</Extension> <ImageId>sample string 1</ImageId> <ShowOnInternet>true</ShowOnInternet> <Text>sample string 6</Text> <TextExtended>sample string 7</TextExtended> <Url>sample string 3</Url> </AreaImage> <AreaImage> <DateChanged>2024-11-21T10:11:46.9024833+01:00</DateChanged> <Extension>sample string 4</Extension> <ImageId>sample string 1</ImageId> <ShowOnInternet>true</ShowOnInternet> <Text>sample string 6</Text> <TextExtended>sample string 7</TextExtended> <Url>sample string 3</Url> </AreaImage> </Images> <Polygon xmlns:d3p1="http://schemas.datacontract.org/2004/07/Vitec.Housing.Connect.Api.Models"> <d3p1:Coordinate> <d3p1:Latitud>2.1</d3p1:Latitud> <d3p1:Longitud>1.1</d3p1:Longitud> </d3p1:Coordinate> <d3p1:Coordinate> <d3p1:Latitud>2.1</d3p1:Latitud> <d3p1:Longitud>1.1</d3p1:Longitud> </d3p1:Coordinate> </Polygon> <PolygonWGS84 xmlns:d3p1="http://schemas.datacontract.org/2004/07/Vitec.Housing.Connect.Api.Models"> <d3p1:Coordinate> <d3p1:Latitud>2.1</d3p1:Latitud> <d3p1:Longitud>1.1</d3p1:Longitud> </d3p1:Coordinate> <d3p1:Coordinate> <d3p1:Latitud>2.1</d3p1:Latitud> <d3p1:Longitud>1.1</d3p1:Longitud> </d3p1:Coordinate> </PolygonWGS84> <ShowOnInternet>true</ShowOnInternet> <Surrounding xmlns:d3p1="http://schemas.datacontract.org/2004/07/Vitec.Housing.Connect.Api.Models.Estate.Common"> <d3p1:Communication>sample string 3</d3p1:Communication> <d3p1:GeneralAboutArea>sample string 1</d3p1:GeneralAboutArea> <d3p1:NearService>sample string 2</d3p1:NearService> <d3p1:Other>sample string 5</d3p1:Other> <d3p1:Parking>sample string 4</d3p1:Parking> </Surrounding> </Area> </ArrayOfArea>