curl "https://connect.maklare.vitec.net/User/GetUser?UserId=StringValue&SearchText=StringValue&CustomerId=StringValue" -X GET -H "Authorization: basic {Base64 kodad användarnamn och lösenord}"
Dokumentation för API-funktioner
GET User/GetUser
Hämta användarlista för publika användare.
För att kunna hämta användarlista så krävs det en giltig API nyckel och ett kundid.
Request Information
URI Parameters
Response Information
Resource Description
Hämtar lista över publika användare.
Collection of User
Kodexempel
Testformulär
Text input
Response Formats
Namn | Beskrivning | Typ | Information |
UserId | Användarid | string | |
SearchText | Text som filtrerar på namn eller titel | string | |
CustomerId | Kundid | string |
Namn | Beskrivning | Typ | Information |
Archived | Arkiverad | boolean | |
Public | Publik | boolean | |
UserId | Användarid | string | |
CustomerId | Kontorsid | Collection of string | |
OrderNumber | Sorteringsnummer-OBS obsolete. Använd sorteringsnumret under CustomerIdsWithSortOrder istället | integer | |
UserName | Namn | string | |
Department | Avdelning | string | |
Category | Kategori | string | |
Title | Titel | string | |
ExtraTitle | Extra Titel | string | |
AllowLogOn | Tillåt inloggning | boolean | |
EmailAddress | Epostadress | string | |
TelePhone | Telefonnummer | string | |
CellPhone | Mobilnummer | string | |
DirectPhonenumbers | Telefonnummer direkt | Collection of DirectPhoneNumber | |
PublicPhonenumber | Publikt telefonnummer | string | |
SpokenLanguages | Talade språk | Collection of string | |
Bank | Banknamn | string | |
CleringNumber | Cleringnummer | string | |
Account | Konto | string | |
Iban | Ibannummer | string | |
Swift | Swiftnummer | string | |
Comment | Kommentar | string | |
Image | Bild | Image | |
PublishedOnOffice | Företag där användaren är publik | Collection of string | |
InternalEmployeeNumber | integer | ||
ExternalUserId | string | ||
CustomerIdsWithSortOrder | Kundid och sorteringnummer | Collection of CustomerIdWithOrderNumber | |
DateChanged | Ändringsdatum | date | |
SubOffices | Underkontor som användaren är kopplad till | Collection of UserSubOffice | |
Reviews | Kundomdömen | Collection of UserReview |
$URL = "https://connect.maklare.vitec.net/User/GetUser?UserId=StringValue&SearchText=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("User/GetUser?UserId=StringValue&SearchText=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 archived = firstInArray.archived.Value ;
// TODO: Gör något med resultatet
}
$URL = "https://connect.maklare.vitec.net/User/GetUser?UserId=StringValue&SearchText=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["archived"];
// TODO: Gör något med resultatet
Resultat av begäran
[ { "archived": true, "public": true, "userId": "sample string 2", "customerId": [ "sample string 1", "sample string 2" ], "orderNumber": 1, "userName": "sample string 3", "department": "sample string 4", "category": "sample string 5", "title": "sample string 6", "extraTitle": "sample string 7", "allowLogOn": true, "emailAddress": "sample string 9", "telePhone": "sample string 10", "cellPhone": "sample string 11", "directPhonenumbers": [ { "customerId": "sample string 1", "phonenumber": "sample string 2" }, { "customerId": "sample string 1", "phonenumber": "sample string 2" } ], "publicPhonenumber": "sample string 12", "spokenLanguages": [ "sample string 1", "sample string 2" ], "bank": "sample string 13", "cleringNumber": "sample string 14", "account": "sample string 15", "iban": "sample string 16", "swift": "sample string 17", "comment": "sample string 18", "image": { "imageId": "sample string 1", "dateChanged": "2024-11-21T07:14:37.2591614+01:00", "dateChangedImageData": "2024-11-21T07:14:37.2591614+01:00", "url": "sample string 4", "showImageOnInternet": true, "extension": "sample string 6", "cdnReferences": [ { "name": "sample string 1", "url": "sample string 2" }, { "name": "sample string 1", "url": "sample string 2" } ] }, "publishedOnOffice": [ "sample string 1", "sample string 2" ], "internalEmployeeNumber": 1, "externalUserId": "sample string 19", "customerIdsWithSortOrder": [ { "customerId": "sample string 1", "orderNumber": 1, "mainBusiness": true, "officeId": "sample string 2" }, { "customerId": "sample string 1", "orderNumber": 1, "mainBusiness": true, "officeId": "sample string 2" } ], "dateChanged": "2024-11-21T07:14:37.2591614+01:00", "subOffices": [ { "id": "sample string 1" }, { "id": "sample string 1" } ], "reviews": [ { "review": "sample string 1", "madeBy": "sample string 2" }, { "review": "sample string 1", "madeBy": "sample string 2" } ] }, { "archived": true, "public": true, "userId": "sample string 2", "customerId": [ "sample string 1", "sample string 2" ], "orderNumber": 1, "userName": "sample string 3", "department": "sample string 4", "category": "sample string 5", "title": "sample string 6", "extraTitle": "sample string 7", "allowLogOn": true, "emailAddress": "sample string 9", "telePhone": "sample string 10", "cellPhone": "sample string 11", "directPhonenumbers": [ { "customerId": "sample string 1", "phonenumber": "sample string 2" }, { "customerId": "sample string 1", "phonenumber": "sample string 2" } ], "publicPhonenumber": "sample string 12", "spokenLanguages": [ "sample string 1", "sample string 2" ], "bank": "sample string 13", "cleringNumber": "sample string 14", "account": "sample string 15", "iban": "sample string 16", "swift": "sample string 17", "comment": "sample string 18", "image": { "imageId": "sample string 1", "dateChanged": "2024-11-21T07:14:37.2591614+01:00", "dateChangedImageData": "2024-11-21T07:14:37.2591614+01:00", "url": "sample string 4", "showImageOnInternet": true, "extension": "sample string 6", "cdnReferences": [ { "name": "sample string 1", "url": "sample string 2" }, { "name": "sample string 1", "url": "sample string 2" } ] }, "publishedOnOffice": [ "sample string 1", "sample string 2" ], "internalEmployeeNumber": 1, "externalUserId": "sample string 19", "customerIdsWithSortOrder": [ { "customerId": "sample string 1", "orderNumber": 1, "mainBusiness": true, "officeId": "sample string 2" }, { "customerId": "sample string 1", "orderNumber": 1, "mainBusiness": true, "officeId": "sample string 2" } ], "dateChanged": "2024-11-21T07:14:37.2591614+01:00", "subOffices": [ { "id": "sample string 1" }, { "id": "sample string 1" } ], "reviews": [ { "review": "sample string 1", "madeBy": "sample string 2" }, { "review": "sample string 1", "madeBy": "sample string 2" } ] } ]
<ArrayOfUser xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://schemas.datacontract.org/2004/07/Vitec.Housing.Connect.Api.Models.User"> <User> <Account>sample string 15</Account> <AllowLogOn>true</AllowLogOn> <Archived>true</Archived> <Bank>sample string 13</Bank> <Category>sample string 5</Category> <CellPhone>sample string 11</CellPhone> <CleringNumber>sample string 14</CleringNumber> <Comment>sample string 18</Comment> <CustomerId xmlns:d3p1="http://schemas.microsoft.com/2003/10/Serialization/Arrays"> <d3p1:string>sample string 1</d3p1:string> <d3p1:string>sample string 2</d3p1:string> </CustomerId> <CustomerIdsWithSortOrder> <CustomerIdWithOrderNumber> <CustomerId>sample string 1</CustomerId> <MainBusiness>true</MainBusiness> <OfficeId>sample string 2</OfficeId> <OrderNumber>1</OrderNumber> </CustomerIdWithOrderNumber> <CustomerIdWithOrderNumber> <CustomerId>sample string 1</CustomerId> <MainBusiness>true</MainBusiness> <OfficeId>sample string 2</OfficeId> <OrderNumber>1</OrderNumber> </CustomerIdWithOrderNumber> </CustomerIdsWithSortOrder> <DateChanged>2024-11-21T07:14:37.2591614+01:00</DateChanged> <Department>sample string 4</Department> <DirectPhonenumbers> <DirectPhoneNumber> <CustomerId>sample string 1</CustomerId> <Phonenumber>sample string 2</Phonenumber> </DirectPhoneNumber> <DirectPhoneNumber> <CustomerId>sample string 1</CustomerId> <Phonenumber>sample string 2</Phonenumber> </DirectPhoneNumber> </DirectPhonenumbers> <EmailAddress>sample string 9</EmailAddress> <ExternalUserId>sample string 19</ExternalUserId> <ExtraTitle>sample string 7</ExtraTitle> <Iban>sample string 16</Iban> <Image xmlns:d3p1="http://schemas.datacontract.org/2004/07/Vitec.Housing.Connect.Api.Models.Image"> <d3p1:CdnReferences xmlns:d4p1="http://schemas.datacontract.org/2004/07/Vitec.Housing.Connect.Api"> <d4p1:CdnImageReference> <d4p1:Name>sample string 1</d4p1:Name> <d4p1:Url>sample string 2</d4p1:Url> </d4p1:CdnImageReference> <d4p1:CdnImageReference> <d4p1:Name>sample string 1</d4p1:Name> <d4p1:Url>sample string 2</d4p1:Url> </d4p1:CdnImageReference> </d3p1:CdnReferences> <d3p1:DateChanged>2024-11-21T07:14:37.2591614+01:00</d3p1:DateChanged> <d3p1:DateChangedImageData>2024-11-21T07:14:37.2591614+01:00</d3p1:DateChangedImageData> <d3p1:Extension>sample string 6</d3p1:Extension> <d3p1:ImageId>sample string 1</d3p1:ImageId> <d3p1:ShowImageOnInternet>true</d3p1:ShowImageOnInternet> <d3p1:Url>sample string 4</d3p1:Url> </Image> <InternalEmployeeNumber>1</InternalEmployeeNumber> <OrderNumber>1</OrderNumber> <Public>true</Public> <PublicPhonenumber>sample string 12</PublicPhonenumber> <PublishedOnOffice xmlns:d3p1="http://schemas.microsoft.com/2003/10/Serialization/Arrays"> <d3p1:string>sample string 1</d3p1:string> <d3p1:string>sample string 2</d3p1:string> </PublishedOnOffice> <Reviews> <UserReview> <MadeBy>sample string 2</MadeBy> <Review>sample string 1</Review> </UserReview> <UserReview> <MadeBy>sample string 2</MadeBy> <Review>sample string 1</Review> </UserReview> </Reviews> <SpokenLanguages xmlns:d3p1="http://schemas.microsoft.com/2003/10/Serialization/Arrays"> <d3p1:string>sample string 1</d3p1:string> <d3p1:string>sample string 2</d3p1:string> </SpokenLanguages> <SubOffices> <UserSubOffice> <Id>sample string 1</Id> </UserSubOffice> <UserSubOffice> <Id>sample string 1</Id> </UserSubOffice> </SubOffices> <Swift>sample string 17</Swift> <TelePhone>sample string 10</TelePhone> <Title>sample string 6</Title> <UserId>sample string 2</UserId> <UserName>sample string 3</UserName> </User> <User> <Account>sample string 15</Account> <AllowLogOn>true</AllowLogOn> <Archived>true</Archived> <Bank>sample string 13</Bank> <Category>sample string 5</Category> <CellPhone>sample string 11</CellPhone> <CleringNumber>sample string 14</CleringNumber> <Comment>sample string 18</Comment> <CustomerId xmlns:d3p1="http://schemas.microsoft.com/2003/10/Serialization/Arrays"> <d3p1:string>sample string 1</d3p1:string> <d3p1:string>sample string 2</d3p1:string> </CustomerId> <CustomerIdsWithSortOrder> <CustomerIdWithOrderNumber> <CustomerId>sample string 1</CustomerId> <MainBusiness>true</MainBusiness> <OfficeId>sample string 2</OfficeId> <OrderNumber>1</OrderNumber> </CustomerIdWithOrderNumber> <CustomerIdWithOrderNumber> <CustomerId>sample string 1</CustomerId> <MainBusiness>true</MainBusiness> <OfficeId>sample string 2</OfficeId> <OrderNumber>1</OrderNumber> </CustomerIdWithOrderNumber> </CustomerIdsWithSortOrder> <DateChanged>2024-11-21T07:14:37.2591614+01:00</DateChanged> <Department>sample string 4</Department> <DirectPhonenumbers> <DirectPhoneNumber> <CustomerId>sample string 1</CustomerId> <Phonenumber>sample string 2</Phonenumber> </DirectPhoneNumber> <DirectPhoneNumber> <CustomerId>sample string 1</CustomerId> <Phonenumber>sample string 2</Phonenumber> </DirectPhoneNumber> </DirectPhonenumbers> <EmailAddress>sample string 9</EmailAddress> <ExternalUserId>sample string 19</ExternalUserId> <ExtraTitle>sample string 7</ExtraTitle> <Iban>sample string 16</Iban> <Image xmlns:d3p1="http://schemas.datacontract.org/2004/07/Vitec.Housing.Connect.Api.Models.Image"> <d3p1:CdnReferences xmlns:d4p1="http://schemas.datacontract.org/2004/07/Vitec.Housing.Connect.Api"> <d4p1:CdnImageReference> <d4p1:Name>sample string 1</d4p1:Name> <d4p1:Url>sample string 2</d4p1:Url> </d4p1:CdnImageReference> <d4p1:CdnImageReference> <d4p1:Name>sample string 1</d4p1:Name> <d4p1:Url>sample string 2</d4p1:Url> </d4p1:CdnImageReference> </d3p1:CdnReferences> <d3p1:DateChanged>2024-11-21T07:14:37.2591614+01:00</d3p1:DateChanged> <d3p1:DateChangedImageData>2024-11-21T07:14:37.2591614+01:00</d3p1:DateChangedImageData> <d3p1:Extension>sample string 6</d3p1:Extension> <d3p1:ImageId>sample string 1</d3p1:ImageId> <d3p1:ShowImageOnInternet>true</d3p1:ShowImageOnInternet> <d3p1:Url>sample string 4</d3p1:Url> </Image> <InternalEmployeeNumber>1</InternalEmployeeNumber> <OrderNumber>1</OrderNumber> <Public>true</Public> <PublicPhonenumber>sample string 12</PublicPhonenumber> <PublishedOnOffice xmlns:d3p1="http://schemas.microsoft.com/2003/10/Serialization/Arrays"> <d3p1:string>sample string 1</d3p1:string> <d3p1:string>sample string 2</d3p1:string> </PublishedOnOffice> <Reviews> <UserReview> <MadeBy>sample string 2</MadeBy> <Review>sample string 1</Review> </UserReview> <UserReview> <MadeBy>sample string 2</MadeBy> <Review>sample string 1</Review> </UserReview> </Reviews> <SpokenLanguages xmlns:d3p1="http://schemas.microsoft.com/2003/10/Serialization/Arrays"> <d3p1:string>sample string 1</d3p1:string> <d3p1:string>sample string 2</d3p1:string> </SpokenLanguages> <SubOffices> <UserSubOffice> <Id>sample string 1</Id> </UserSubOffice> <UserSubOffice> <Id>sample string 1</Id> </UserSubOffice> </SubOffices> <Swift>sample string 17</Swift> <TelePhone>sample string 10</TelePhone> <Title>sample string 6</Title> <UserId>sample string 2</UserId> <UserName>sample string 3</UserName> </User> </ArrayOfUser>