curl "https://connect.maklare.vitec.net/BusinessIntelligence/CommissionOfficeReportByMonth/StringValue?dateFrom=2015-01-01T12:00:00&dateTo=2015-01-01T12:00:00&assignment=0" -X GET -H "Authorization: basic {Base64 kodad användarnamn och lösenord}"
Dokumentation för API-funktioner
GET BusinessIntelligence/CommissionOfficeReportByMonth/{customerId}
Hämtar provisionsrapport, sorterad på år och månad, för ett eller flera kontor. Datumintervallet får inte överstiga ett år.
Request Information
URI Parameters
Response Information
Resource Description
Hämtar provisionsrapport för kontor och sorterar informationen per år och månad.
Man kan hämta för ett enskilt kontor eller en grupp, datumintervallet får inte överstiga ett år.
CommissionOfficeReportByMonth
Kodexempel
Testformulär
Text input
Response Formats
Namn | Beskrivning | Typ | Information |
customerId | Kund-id (kontor eller grupp) | string |
Krävs |
dateFrom | Datum från | date |
Krävs |
dateTo | Datum till | date |
Krävs |
assignment | Uppdragstyp | AssignmentType |
Namn | Beskrivning | Typ | Information |
CommissionOffices | Lista på provision per kontor | Collection of CommissionOfficeByMonth |
$URL = "https://connect.maklare.vitec.net/BusinessIntelligence/CommissionOfficeReportByMonth/StringValue?dateFrom=2015-01-01T12:00:00&dateTo=2015-01-01T12:00:00&assignment=0"
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/CommissionOfficeReportByMonth/StringValue?dateFrom=2015-01-01T12:00:00&dateTo=2015-01-01T12:00:00&assignment=0")) {
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 commissionOffices = result.commissionOffices.Value ;
// TODO: Gör något med resultatet
}
$URL = "https://connect.maklare.vitec.net/BusinessIntelligence/CommissionOfficeReportByMonth/StringValue?dateFrom=2015-01-01T12:00:00&dateTo=2015-01-01T12:00:00&assignment=0";
$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["commissionOffices"];
// TODO: Gör något med resultatet
Resultat av begäran
{ "commissionOffices": [ { "customerId": "sample string 1", "office": { "customerId": "sample string 1" }, "years": [ { "year": 1, "months": [ { "month": 1, "commission": 2.1, "soldTotalPrice": 3.1, "soldCommissionPercentage": 4.1, "soldAverageCommission": 5.1, "soldEstateParts": 6.1, "writingParts": 7.1, "valuationParts": 8.1 }, { "month": 1, "commission": 2.1, "soldTotalPrice": 3.1, "soldCommissionPercentage": 4.1, "soldAverageCommission": 5.1, "soldEstateParts": 6.1, "writingParts": 7.1, "valuationParts": 8.1 } ] }, { "year": 1, "months": [ { "month": 1, "commission": 2.1, "soldTotalPrice": 3.1, "soldCommissionPercentage": 4.1, "soldAverageCommission": 5.1, "soldEstateParts": 6.1, "writingParts": 7.1, "valuationParts": 8.1 }, { "month": 1, "commission": 2.1, "soldTotalPrice": 3.1, "soldCommissionPercentage": 4.1, "soldAverageCommission": 5.1, "soldEstateParts": 6.1, "writingParts": 7.1, "valuationParts": 8.1 } ] } ] }, { "customerId": "sample string 1", "office": { "customerId": "sample string 1" }, "years": [ { "year": 1, "months": [ { "month": 1, "commission": 2.1, "soldTotalPrice": 3.1, "soldCommissionPercentage": 4.1, "soldAverageCommission": 5.1, "soldEstateParts": 6.1, "writingParts": 7.1, "valuationParts": 8.1 }, { "month": 1, "commission": 2.1, "soldTotalPrice": 3.1, "soldCommissionPercentage": 4.1, "soldAverageCommission": 5.1, "soldEstateParts": 6.1, "writingParts": 7.1, "valuationParts": 8.1 } ] }, { "year": 1, "months": [ { "month": 1, "commission": 2.1, "soldTotalPrice": 3.1, "soldCommissionPercentage": 4.1, "soldAverageCommission": 5.1, "soldEstateParts": 6.1, "writingParts": 7.1, "valuationParts": 8.1 }, { "month": 1, "commission": 2.1, "soldTotalPrice": 3.1, "soldCommissionPercentage": 4.1, "soldAverageCommission": 5.1, "soldEstateParts": 6.1, "writingParts": 7.1, "valuationParts": 8.1 } ] } ] } ] }
<CommissionOfficeReportByMonth xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://schemas.datacontract.org/2004/07/Vitec.Housing.Connect.Api.Models.BusinessIntelligense"> <CommissionOffices> <CommissionOfficeByMonth> <CustomerId>sample string 1</CustomerId> <Office> <CustomerId>sample string 1</CustomerId> </Office> <Years> <CommissionYearSummary> <Months> <CommissionMonthSummary> <Commission>2.1</Commission> <SoldAverageCommission>5.1</SoldAverageCommission> <SoldCommissionPercentage>4.1</SoldCommissionPercentage> <SoldEstateParts>6.1</SoldEstateParts> <SoldTotalPrice>3.1</SoldTotalPrice> <ValuationParts>8.1</ValuationParts> <WritingParts>7.1</WritingParts> <Month>1</Month> </CommissionMonthSummary> <CommissionMonthSummary> <Commission>2.1</Commission> <SoldAverageCommission>5.1</SoldAverageCommission> <SoldCommissionPercentage>4.1</SoldCommissionPercentage> <SoldEstateParts>6.1</SoldEstateParts> <SoldTotalPrice>3.1</SoldTotalPrice> <ValuationParts>8.1</ValuationParts> <WritingParts>7.1</WritingParts> <Month>1</Month> </CommissionMonthSummary> </Months> <Year>1</Year> </CommissionYearSummary> <CommissionYearSummary> <Months> <CommissionMonthSummary> <Commission>2.1</Commission> <SoldAverageCommission>5.1</SoldAverageCommission> <SoldCommissionPercentage>4.1</SoldCommissionPercentage> <SoldEstateParts>6.1</SoldEstateParts> <SoldTotalPrice>3.1</SoldTotalPrice> <ValuationParts>8.1</ValuationParts> <WritingParts>7.1</WritingParts> <Month>1</Month> </CommissionMonthSummary> <CommissionMonthSummary> <Commission>2.1</Commission> <SoldAverageCommission>5.1</SoldAverageCommission> <SoldCommissionPercentage>4.1</SoldCommissionPercentage> <SoldEstateParts>6.1</SoldEstateParts> <SoldTotalPrice>3.1</SoldTotalPrice> <ValuationParts>8.1</ValuationParts> <WritingParts>7.1</WritingParts> <Month>1</Month> </CommissionMonthSummary> </Months> <Year>1</Year> </CommissionYearSummary> </Years> </CommissionOfficeByMonth> <CommissionOfficeByMonth> <CustomerId>sample string 1</CustomerId> <Office> <CustomerId>sample string 1</CustomerId> </Office> <Years> <CommissionYearSummary> <Months> <CommissionMonthSummary> <Commission>2.1</Commission> <SoldAverageCommission>5.1</SoldAverageCommission> <SoldCommissionPercentage>4.1</SoldCommissionPercentage> <SoldEstateParts>6.1</SoldEstateParts> <SoldTotalPrice>3.1</SoldTotalPrice> <ValuationParts>8.1</ValuationParts> <WritingParts>7.1</WritingParts> <Month>1</Month> </CommissionMonthSummary> <CommissionMonthSummary> <Commission>2.1</Commission> <SoldAverageCommission>5.1</SoldAverageCommission> <SoldCommissionPercentage>4.1</SoldCommissionPercentage> <SoldEstateParts>6.1</SoldEstateParts> <SoldTotalPrice>3.1</SoldTotalPrice> <ValuationParts>8.1</ValuationParts> <WritingParts>7.1</WritingParts> <Month>1</Month> </CommissionMonthSummary> </Months> <Year>1</Year> </CommissionYearSummary> <CommissionYearSummary> <Months> <CommissionMonthSummary> <Commission>2.1</Commission> <SoldAverageCommission>5.1</SoldAverageCommission> <SoldCommissionPercentage>4.1</SoldCommissionPercentage> <SoldEstateParts>6.1</SoldEstateParts> <SoldTotalPrice>3.1</SoldTotalPrice> <ValuationParts>8.1</ValuationParts> <WritingParts>7.1</WritingParts> <Month>1</Month> </CommissionMonthSummary> <CommissionMonthSummary> <Commission>2.1</Commission> <SoldAverageCommission>5.1</SoldAverageCommission> <SoldCommissionPercentage>4.1</SoldCommissionPercentage> <SoldEstateParts>6.1</SoldEstateParts> <SoldTotalPrice>3.1</SoldTotalPrice> <ValuationParts>8.1</ValuationParts> <WritingParts>7.1</WritingParts> <Month>1</Month> </CommissionMonthSummary> </Months> <Year>1</Year> </CommissionYearSummary> </Years> </CommissionOfficeByMonth> </CommissionOffices> </CommissionOfficeReportByMonth>