curl "https://connect.maklare.vitec.net/BusinessIntelligence/Office/StringValue/StringValue" -X GET -H "Authorization: basic {Base64 kodad användarnamn och lösenord}"
Dokumentation för API-funktioner
GET BusinessIntelligence/Office/{customerId}/{officeId}
Response Information
Resource Description
Kodexempel
Testformulär
Text input
Response Formats
Hämta kontor för beslutsstöd.
Request Information URI Parameters| Namn | Beskrivning | Typ | Information |
| customerId | Kund-id | string |
Krävs |
| officeId | Kontorsid | string |
Krävs |
Hämta kontor för beslutsstöd.
BusinessIntelligenceOffice| Namn | Beskrivning | Typ | Information |
| Id | Id | string | |
| CustomerId | Kund-id | string | |
| ChangedAt | Ändringsdatum | date | |
| Name | Namn på kontoret | string | |
| StreetAddress | Gatuadress/Besöksadress | string | |
| ZipCode | Postnr | AddressZipCode | |
| PostalTown | Ort | string | |
| Telephone | Telefonnummer | OfficeTelephoneNumbers | |
| EmailAddress | E-postadress | string | |
| Coordinate | Koordinater | Wgs84Coordinate |
$URL = "https://connect.maklare.vitec.net/BusinessIntelligence/Office/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("BusinessIntelligence/Office/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/BusinessIntelligence/Office/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",
"customerId": "sample string 2",
"changedAt": "2025-12-07T22:17:01.1830463+01:00",
"name": "sample string 3",
"streetAddress": "sample string 4",
"zipCode": {
"numerical": 1,
"value": "sample string 1"
},
"postalTown": "sample string 5",
"telephone": {
"switch": {
"msisdn": "sample string 1",
"display": "sample string 2"
}
},
"emailAddress": "sample string 6",
"coordinate": {
"longitude": 1.1,
"latitude": 2.1
}
}
<BusinessIntelligenceOffice xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://schemas.datacontract.org/2004/07/Express.Connect.Api.Services.BusinessIntelligence">
<ChangedAt>2025-12-07T22:17:01.1830463+01:00</ChangedAt>
<Coordinate xmlns:d2p1="http://schemas.datacontract.org/2004/07/Vitec.Housing.Connect.Api.Models">
<d2p1:Latitude>2.1</d2p1:Latitude>
<d2p1:Longitude>1.1</d2p1:Longitude>
</Coordinate>
<CustomerId>sample string 2</CustomerId>
<EmailAddress>sample string 6</EmailAddress>
<Id>sample string 1</Id>
<Name>sample string 3</Name>
<PostalTown>sample string 5</PostalTown>
<StreetAddress>sample string 4</StreetAddress>
<Telephone xmlns:d2p1="http://schemas.datacontract.org/2004/07/Express.Connect.Api.Models">
<d2p1:Switch>
<d2p1:Display>sample string 2</d2p1:Display>
<d2p1:Msisdn>sample string 1</d2p1:Msisdn>
</d2p1:Switch>
</Telephone>
<ZipCode xmlns:d2p1="http://schemas.datacontract.org/2004/07/Express.Connect.Api.Services.Advertising">
<d2p1:Numerical>1</d2p1:Numerical>
<d2p1:Value>sample string 1</d2p1:Value>
</ZipCode>
</BusinessIntelligenceOffice>