Dokumentation för API-funktioner
GET Report/Budget/{customerId}/Crm Hämta budget rapport över CRM 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 CRM Collection of BudgetCrmOfficeReportRow
NamnBeskrivningTypInformation
CustomerId Kund-id string

Name Kontorets namn string

City Kontorsort string

Users Användare Collection of BudgetCrmUserReportRow

Kodexempel

curl "https://connect.maklare.vitec.net/Report/Budget/StringValue/Crm?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/Crm?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/Crm?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/Crm?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,
            "outgoingLeads": 1.1,
            "meetings": 1.1,
            "tips": 1.1,
            "incomingLeads": 1.1,
            "admissionFollowUps": 1.1,
            "score": {
              "seller": 1.1,
              "buyer": 1.1,
              "viewingParticipants": 1.1
            }
          },
          {
            "year": 1,
            "month": 2,
            "outgoingLeads": 1.1,
            "meetings": 1.1,
            "tips": 1.1,
            "incomingLeads": 1.1,
            "admissionFollowUps": 1.1,
            "score": {
              "seller": 1.1,
              "buyer": 1.1,
              "viewingParticipants": 1.1
            }
          }
        ]
      },
      {
        "id": "sample string 1",
        "name": "sample string 2",
        "isPrimaryOffice": true,
        "months": [
          {
            "year": 1,
            "month": 2,
            "outgoingLeads": 1.1,
            "meetings": 1.1,
            "tips": 1.1,
            "incomingLeads": 1.1,
            "admissionFollowUps": 1.1,
            "score": {
              "seller": 1.1,
              "buyer": 1.1,
              "viewingParticipants": 1.1
            }
          },
          {
            "year": 1,
            "month": 2,
            "outgoingLeads": 1.1,
            "meetings": 1.1,
            "tips": 1.1,
            "incomingLeads": 1.1,
            "admissionFollowUps": 1.1,
            "score": {
              "seller": 1.1,
              "buyer": 1.1,
              "viewingParticipants": 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,
            "outgoingLeads": 1.1,
            "meetings": 1.1,
            "tips": 1.1,
            "incomingLeads": 1.1,
            "admissionFollowUps": 1.1,
            "score": {
              "seller": 1.1,
              "buyer": 1.1,
              "viewingParticipants": 1.1
            }
          },
          {
            "year": 1,
            "month": 2,
            "outgoingLeads": 1.1,
            "meetings": 1.1,
            "tips": 1.1,
            "incomingLeads": 1.1,
            "admissionFollowUps": 1.1,
            "score": {
              "seller": 1.1,
              "buyer": 1.1,
              "viewingParticipants": 1.1
            }
          }
        ]
      },
      {
        "id": "sample string 1",
        "name": "sample string 2",
        "isPrimaryOffice": true,
        "months": [
          {
            "year": 1,
            "month": 2,
            "outgoingLeads": 1.1,
            "meetings": 1.1,
            "tips": 1.1,
            "incomingLeads": 1.1,
            "admissionFollowUps": 1.1,
            "score": {
              "seller": 1.1,
              "buyer": 1.1,
              "viewingParticipants": 1.1
            }
          },
          {
            "year": 1,
            "month": 2,
            "outgoingLeads": 1.1,
            "meetings": 1.1,
            "tips": 1.1,
            "incomingLeads": 1.1,
            "admissionFollowUps": 1.1,
            "score": {
              "seller": 1.1,
              "buyer": 1.1,
              "viewingParticipants": 1.1
            }
          }
        ]
      }
    ]
  }
]
<ArrayOfBudgetCrmOfficeReportRow xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://schemas.datacontract.org/2004/07/Express.Connect.Api.Models.Reports">
  <BudgetCrmOfficeReportRow>
    <City>sample string 3</City>
    <CustomerId>sample string 1</CustomerId>
    <Name>sample string 2</Name>
    <Users>
      <BudgetCrmUserReportRow>
        <Id>sample string 1</Id>
        <IsPrimaryOffice>true</IsPrimaryOffice>
        <Months>
          <BudgetCrmMonthReportRow>
            <AdmissionFollowUps>1.1</AdmissionFollowUps>
            <IncomingLeads>1.1</IncomingLeads>
            <Meetings>1.1</Meetings>
            <Month>2</Month>
            <OutgoingLeads>1.1</OutgoingLeads>
            <Score>
              <Buyer>1.1</Buyer>
              <Seller>1.1</Seller>
              <ViewingParticipants>1.1</ViewingParticipants>
            </Score>
            <Tips>1.1</Tips>
            <Year>1</Year>
          </BudgetCrmMonthReportRow>
          <BudgetCrmMonthReportRow>
            <AdmissionFollowUps>1.1</AdmissionFollowUps>
            <IncomingLeads>1.1</IncomingLeads>
            <Meetings>1.1</Meetings>
            <Month>2</Month>
            <OutgoingLeads>1.1</OutgoingLeads>
            <Score>
              <Buyer>1.1</Buyer>
              <Seller>1.1</Seller>
              <ViewingParticipants>1.1</ViewingParticipants>
            </Score>
            <Tips>1.1</Tips>
            <Year>1</Year>
          </BudgetCrmMonthReportRow>
        </Months>
        <Name>sample string 2</Name>
      </BudgetCrmUserReportRow>
      <BudgetCrmUserReportRow>
        <Id>sample string 1</Id>
        <IsPrimaryOffice>true</IsPrimaryOffice>
        <Months>
          <BudgetCrmMonthReportRow>
            <AdmissionFollowUps>1.1</AdmissionFollowUps>
            <IncomingLeads>1.1</IncomingLeads>
            <Meetings>1.1</Meetings>
            <Month>2</Month>
            <OutgoingLeads>1.1</OutgoingLeads>
            <Score>
              <Buyer>1.1</Buyer>
              <Seller>1.1</Seller>
              <ViewingParticipants>1.1</ViewingParticipants>
            </Score>
            <Tips>1.1</Tips>
            <Year>1</Year>
          </BudgetCrmMonthReportRow>
          <BudgetCrmMonthReportRow>
            <AdmissionFollowUps>1.1</AdmissionFollowUps>
            <IncomingLeads>1.1</IncomingLeads>
            <Meetings>1.1</Meetings>
            <Month>2</Month>
            <OutgoingLeads>1.1</OutgoingLeads>
            <Score>
              <Buyer>1.1</Buyer>
              <Seller>1.1</Seller>
              <ViewingParticipants>1.1</ViewingParticipants>
            </Score>
            <Tips>1.1</Tips>
            <Year>1</Year>
          </BudgetCrmMonthReportRow>
        </Months>
        <Name>sample string 2</Name>
      </BudgetCrmUserReportRow>
    </Users>
  </BudgetCrmOfficeReportRow>
  <BudgetCrmOfficeReportRow>
    <City>sample string 3</City>
    <CustomerId>sample string 1</CustomerId>
    <Name>sample string 2</Name>
    <Users>
      <BudgetCrmUserReportRow>
        <Id>sample string 1</Id>
        <IsPrimaryOffice>true</IsPrimaryOffice>
        <Months>
          <BudgetCrmMonthReportRow>
            <AdmissionFollowUps>1.1</AdmissionFollowUps>
            <IncomingLeads>1.1</IncomingLeads>
            <Meetings>1.1</Meetings>
            <Month>2</Month>
            <OutgoingLeads>1.1</OutgoingLeads>
            <Score>
              <Buyer>1.1</Buyer>
              <Seller>1.1</Seller>
              <ViewingParticipants>1.1</ViewingParticipants>
            </Score>
            <Tips>1.1</Tips>
            <Year>1</Year>
          </BudgetCrmMonthReportRow>
          <BudgetCrmMonthReportRow>
            <AdmissionFollowUps>1.1</AdmissionFollowUps>
            <IncomingLeads>1.1</IncomingLeads>
            <Meetings>1.1</Meetings>
            <Month>2</Month>
            <OutgoingLeads>1.1</OutgoingLeads>
            <Score>
              <Buyer>1.1</Buyer>
              <Seller>1.1</Seller>
              <ViewingParticipants>1.1</ViewingParticipants>
            </Score>
            <Tips>1.1</Tips>
            <Year>1</Year>
          </BudgetCrmMonthReportRow>
        </Months>
        <Name>sample string 2</Name>
      </BudgetCrmUserReportRow>
      <BudgetCrmUserReportRow>
        <Id>sample string 1</Id>
        <IsPrimaryOffice>true</IsPrimaryOffice>
        <Months>
          <BudgetCrmMonthReportRow>
            <AdmissionFollowUps>1.1</AdmissionFollowUps>
            <IncomingLeads>1.1</IncomingLeads>
            <Meetings>1.1</Meetings>
            <Month>2</Month>
            <OutgoingLeads>1.1</OutgoingLeads>
            <Score>
              <Buyer>1.1</Buyer>
              <Seller>1.1</Seller>
              <ViewingParticipants>1.1</ViewingParticipants>
            </Score>
            <Tips>1.1</Tips>
            <Year>1</Year>
          </BudgetCrmMonthReportRow>
          <BudgetCrmMonthReportRow>
            <AdmissionFollowUps>1.1</AdmissionFollowUps>
            <IncomingLeads>1.1</IncomingLeads>
            <Meetings>1.1</Meetings>
            <Month>2</Month>
            <OutgoingLeads>1.1</OutgoingLeads>
            <Score>
              <Buyer>1.1</Buyer>
              <Seller>1.1</Seller>
              <ViewingParticipants>1.1</ViewingParticipants>
            </Score>
            <Tips>1.1</Tips>
            <Year>1</Year>
          </BudgetCrmMonthReportRow>
        </Months>
        <Name>sample string 2</Name>
      </BudgetCrmUserReportRow>
    </Users>
  </BudgetCrmOfficeReportRow>
</ArrayOfBudgetCrmOfficeReportRow>