Dokumentation för API-funktioner
GET Report/Budget/{customerId}/Commission Hämta budget rapport över provision Request Information URI Parameters
NamnBeskrivningTypInformation
customerId Kund-id string Krävs
fromYear Från och med år integer

fromMonth Från och med månad integer

toYear Till och med år integer

toMonth Till och med månad integer

Response Information Resource Description Hämta budget rapport över provision Collection of BudgetOfficeReportRow
NamnBeskrivningTypInformation
CustomerId Kund-id string

Name Kontorets namn string

City Kontorsort string

Users Användare Collection of BudgetUserReportRow

Kodexempel

curl "https://connect.maklare.vitec.net/Report/Budget/StringValue/Commission?fromYear=0&fromMonth=0&toYear=0&toMonth=0" -X GET -H "Authorization: basic {Base64 kodad användarnamn och lösenord}" 
            

$URL = "https://connect.maklare.vitec.net/Report/Budget/StringValue/Commission?fromYear=0&fromMonth=0&toYear=0&toMonth=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("Report/Budget/StringValue/Commission?fromYear=0&fromMonth=0&toYear=0&toMonth=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 firstInArray = result[0];
    var customerId = firstInArray.customerId.Value;
    // TODO: Gör något med resultatet
}

$URL = "https://connect.maklare.vitec.net/Report/Budget/StringValue/Commission?fromYear=0&fromMonth=0&toYear=0&toMonth=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
}

$first = $result[0];
$field_on_result = $first["customerId"];
// TODO: Gör något med resultatet
Testformulär Text input
Response Formats
[
  {
    "customerId": "sample string 1",
    "name": "sample string 2",
    "city": "sample string 3",
    "users": [
      {
        "id": "sample string 1",
        "name": "sample string 2",
        "isPrimaryOffice": true,
        "months": [
          {
            "year": 1,
            "month": 2,
            "apartments": 1.1,
            "apartmentsNewHome": 1.1,
            "houses": 1.1,
            "cottages": 1.1,
            "plots": 1.1,
            "farms": 1.1,
            "commercialProperties": 1.1,
            "foreignApartments": 1.1,
            "foreignHouses": 1.1,
            "foreignTerraceHouses": 1.1,
            "foreignPlots": 1.1,
            "others": 1.1,
            "totalEstates": 1.1
          },
          {
            "year": 1,
            "month": 2,
            "apartments": 1.1,
            "apartmentsNewHome": 1.1,
            "houses": 1.1,
            "cottages": 1.1,
            "plots": 1.1,
            "farms": 1.1,
            "commercialProperties": 1.1,
            "foreignApartments": 1.1,
            "foreignHouses": 1.1,
            "foreignTerraceHouses": 1.1,
            "foreignPlots": 1.1,
            "others": 1.1,
            "totalEstates": 1.1
          }
        ]
      },
      {
        "id": "sample string 1",
        "name": "sample string 2",
        "isPrimaryOffice": true,
        "months": [
          {
            "year": 1,
            "month": 2,
            "apartments": 1.1,
            "apartmentsNewHome": 1.1,
            "houses": 1.1,
            "cottages": 1.1,
            "plots": 1.1,
            "farms": 1.1,
            "commercialProperties": 1.1,
            "foreignApartments": 1.1,
            "foreignHouses": 1.1,
            "foreignTerraceHouses": 1.1,
            "foreignPlots": 1.1,
            "others": 1.1,
            "totalEstates": 1.1
          },
          {
            "year": 1,
            "month": 2,
            "apartments": 1.1,
            "apartmentsNewHome": 1.1,
            "houses": 1.1,
            "cottages": 1.1,
            "plots": 1.1,
            "farms": 1.1,
            "commercialProperties": 1.1,
            "foreignApartments": 1.1,
            "foreignHouses": 1.1,
            "foreignTerraceHouses": 1.1,
            "foreignPlots": 1.1,
            "others": 1.1,
            "totalEstates": 1.1
          }
        ]
      }
    ]
  },
  {
    "customerId": "sample string 1",
    "name": "sample string 2",
    "city": "sample string 3",
    "users": [
      {
        "id": "sample string 1",
        "name": "sample string 2",
        "isPrimaryOffice": true,
        "months": [
          {
            "year": 1,
            "month": 2,
            "apartments": 1.1,
            "apartmentsNewHome": 1.1,
            "houses": 1.1,
            "cottages": 1.1,
            "plots": 1.1,
            "farms": 1.1,
            "commercialProperties": 1.1,
            "foreignApartments": 1.1,
            "foreignHouses": 1.1,
            "foreignTerraceHouses": 1.1,
            "foreignPlots": 1.1,
            "others": 1.1,
            "totalEstates": 1.1
          },
          {
            "year": 1,
            "month": 2,
            "apartments": 1.1,
            "apartmentsNewHome": 1.1,
            "houses": 1.1,
            "cottages": 1.1,
            "plots": 1.1,
            "farms": 1.1,
            "commercialProperties": 1.1,
            "foreignApartments": 1.1,
            "foreignHouses": 1.1,
            "foreignTerraceHouses": 1.1,
            "foreignPlots": 1.1,
            "others": 1.1,
            "totalEstates": 1.1
          }
        ]
      },
      {
        "id": "sample string 1",
        "name": "sample string 2",
        "isPrimaryOffice": true,
        "months": [
          {
            "year": 1,
            "month": 2,
            "apartments": 1.1,
            "apartmentsNewHome": 1.1,
            "houses": 1.1,
            "cottages": 1.1,
            "plots": 1.1,
            "farms": 1.1,
            "commercialProperties": 1.1,
            "foreignApartments": 1.1,
            "foreignHouses": 1.1,
            "foreignTerraceHouses": 1.1,
            "foreignPlots": 1.1,
            "others": 1.1,
            "totalEstates": 1.1
          },
          {
            "year": 1,
            "month": 2,
            "apartments": 1.1,
            "apartmentsNewHome": 1.1,
            "houses": 1.1,
            "cottages": 1.1,
            "plots": 1.1,
            "farms": 1.1,
            "commercialProperties": 1.1,
            "foreignApartments": 1.1,
            "foreignHouses": 1.1,
            "foreignTerraceHouses": 1.1,
            "foreignPlots": 1.1,
            "others": 1.1,
            "totalEstates": 1.1
          }
        ]
      }
    ]
  }
]
<ArrayOfBudgetOfficeReportRow xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://schemas.datacontract.org/2004/07/Express.Connect.Api.Models.Reports">
  <BudgetOfficeReportRow>
    <City>sample string 3</City>
    <CustomerId>sample string 1</CustomerId>
    <Name>sample string 2</Name>
    <Users>
      <BudgetUserReportRow>
        <Id>sample string 1</Id>
        <IsPrimaryOffice>true</IsPrimaryOffice>
        <Months>
          <BudgetMonthReportRow>
            <Apartments>1.1</Apartments>
            <ApartmentsNewHome>1.1</ApartmentsNewHome>
            <CommercialProperties>1.1</CommercialProperties>
            <Cottages>1.1</Cottages>
            <Farms>1.1</Farms>
            <ForeignApartments>1.1</ForeignApartments>
            <ForeignHouses>1.1</ForeignHouses>
            <ForeignPlots>1.1</ForeignPlots>
            <ForeignTerraceHouses>1.1</ForeignTerraceHouses>
            <Houses>1.1</Houses>
            <Month>2</Month>
            <Others>1.1</Others>
            <Plots>1.1</Plots>
            <TotalEstates>1.1</TotalEstates>
            <Year>1</Year>
          </BudgetMonthReportRow>
          <BudgetMonthReportRow>
            <Apartments>1.1</Apartments>
            <ApartmentsNewHome>1.1</ApartmentsNewHome>
            <CommercialProperties>1.1</CommercialProperties>
            <Cottages>1.1</Cottages>
            <Farms>1.1</Farms>
            <ForeignApartments>1.1</ForeignApartments>
            <ForeignHouses>1.1</ForeignHouses>
            <ForeignPlots>1.1</ForeignPlots>
            <ForeignTerraceHouses>1.1</ForeignTerraceHouses>
            <Houses>1.1</Houses>
            <Month>2</Month>
            <Others>1.1</Others>
            <Plots>1.1</Plots>
            <TotalEstates>1.1</TotalEstates>
            <Year>1</Year>
          </BudgetMonthReportRow>
        </Months>
        <Name>sample string 2</Name>
      </BudgetUserReportRow>
      <BudgetUserReportRow>
        <Id>sample string 1</Id>
        <IsPrimaryOffice>true</IsPrimaryOffice>
        <Months>
          <BudgetMonthReportRow>
            <Apartments>1.1</Apartments>
            <ApartmentsNewHome>1.1</ApartmentsNewHome>
            <CommercialProperties>1.1</CommercialProperties>
            <Cottages>1.1</Cottages>
            <Farms>1.1</Farms>
            <ForeignApartments>1.1</ForeignApartments>
            <ForeignHouses>1.1</ForeignHouses>
            <ForeignPlots>1.1</ForeignPlots>
            <ForeignTerraceHouses>1.1</ForeignTerraceHouses>
            <Houses>1.1</Houses>
            <Month>2</Month>
            <Others>1.1</Others>
            <Plots>1.1</Plots>
            <TotalEstates>1.1</TotalEstates>
            <Year>1</Year>
          </BudgetMonthReportRow>
          <BudgetMonthReportRow>
            <Apartments>1.1</Apartments>
            <ApartmentsNewHome>1.1</ApartmentsNewHome>
            <CommercialProperties>1.1</CommercialProperties>
            <Cottages>1.1</Cottages>
            <Farms>1.1</Farms>
            <ForeignApartments>1.1</ForeignApartments>
            <ForeignHouses>1.1</ForeignHouses>
            <ForeignPlots>1.1</ForeignPlots>
            <ForeignTerraceHouses>1.1</ForeignTerraceHouses>
            <Houses>1.1</Houses>
            <Month>2</Month>
            <Others>1.1</Others>
            <Plots>1.1</Plots>
            <TotalEstates>1.1</TotalEstates>
            <Year>1</Year>
          </BudgetMonthReportRow>
        </Months>
        <Name>sample string 2</Name>
      </BudgetUserReportRow>
    </Users>
  </BudgetOfficeReportRow>
  <BudgetOfficeReportRow>
    <City>sample string 3</City>
    <CustomerId>sample string 1</CustomerId>
    <Name>sample string 2</Name>
    <Users>
      <BudgetUserReportRow>
        <Id>sample string 1</Id>
        <IsPrimaryOffice>true</IsPrimaryOffice>
        <Months>
          <BudgetMonthReportRow>
            <Apartments>1.1</Apartments>
            <ApartmentsNewHome>1.1</ApartmentsNewHome>
            <CommercialProperties>1.1</CommercialProperties>
            <Cottages>1.1</Cottages>
            <Farms>1.1</Farms>
            <ForeignApartments>1.1</ForeignApartments>
            <ForeignHouses>1.1</ForeignHouses>
            <ForeignPlots>1.1</ForeignPlots>
            <ForeignTerraceHouses>1.1</ForeignTerraceHouses>
            <Houses>1.1</Houses>
            <Month>2</Month>
            <Others>1.1</Others>
            <Plots>1.1</Plots>
            <TotalEstates>1.1</TotalEstates>
            <Year>1</Year>
          </BudgetMonthReportRow>
          <BudgetMonthReportRow>
            <Apartments>1.1</Apartments>
            <ApartmentsNewHome>1.1</ApartmentsNewHome>
            <CommercialProperties>1.1</CommercialProperties>
            <Cottages>1.1</Cottages>
            <Farms>1.1</Farms>
            <ForeignApartments>1.1</ForeignApartments>
            <ForeignHouses>1.1</ForeignHouses>
            <ForeignPlots>1.1</ForeignPlots>
            <ForeignTerraceHouses>1.1</ForeignTerraceHouses>
            <Houses>1.1</Houses>
            <Month>2</Month>
            <Others>1.1</Others>
            <Plots>1.1</Plots>
            <TotalEstates>1.1</TotalEstates>
            <Year>1</Year>
          </BudgetMonthReportRow>
        </Months>
        <Name>sample string 2</Name>
      </BudgetUserReportRow>
      <BudgetUserReportRow>
        <Id>sample string 1</Id>
        <IsPrimaryOffice>true</IsPrimaryOffice>
        <Months>
          <BudgetMonthReportRow>
            <Apartments>1.1</Apartments>
            <ApartmentsNewHome>1.1</ApartmentsNewHome>
            <CommercialProperties>1.1</CommercialProperties>
            <Cottages>1.1</Cottages>
            <Farms>1.1</Farms>
            <ForeignApartments>1.1</ForeignApartments>
            <ForeignHouses>1.1</ForeignHouses>
            <ForeignPlots>1.1</ForeignPlots>
            <ForeignTerraceHouses>1.1</ForeignTerraceHouses>
            <Houses>1.1</Houses>
            <Month>2</Month>
            <Others>1.1</Others>
            <Plots>1.1</Plots>
            <TotalEstates>1.1</TotalEstates>
            <Year>1</Year>
          </BudgetMonthReportRow>
          <BudgetMonthReportRow>
            <Apartments>1.1</Apartments>
            <ApartmentsNewHome>1.1</ApartmentsNewHome>
            <CommercialProperties>1.1</CommercialProperties>
            <Cottages>1.1</Cottages>
            <Farms>1.1</Farms>
            <ForeignApartments>1.1</ForeignApartments>
            <ForeignHouses>1.1</ForeignHouses>
            <ForeignPlots>1.1</ForeignPlots>
            <ForeignTerraceHouses>1.1</ForeignTerraceHouses>
            <Houses>1.1</Houses>
            <Month>2</Month>
            <Others>1.1</Others>
            <Plots>1.1</Plots>
            <TotalEstates>1.1</TotalEstates>
            <Year>1</Year>
          </BudgetMonthReportRow>
        </Months>
        <Name>sample string 2</Name>
      </BudgetUserReportRow>
    </Users>
  </BudgetOfficeReportRow>
</ArrayOfBudgetOfficeReportRow>