curl "https://connect.maklare.vitec.net/User/GetAllUsers?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/GetAllUsers
Hämta samtliga 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 alla 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 |
Deleted | Raderad | boolean | |
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/GetAllUsers?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/GetAllUsers?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 deleted = firstInArray.deleted.Value ;
// TODO: Gör något med resultatet
}
$URL = "https://connect.maklare.vitec.net/User/GetAllUsers?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["deleted"];
// TODO: Gör något med resultatet
Resultat av begäran
[ { "deleted": true, "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-21T09:42:33.7020108+01:00", "dateChangedImageData": "2024-11-21T09:42:33.7020108+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-21T09:42:33.7020108+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" } ] }, { "deleted": true, "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-21T09:42:33.7020108+01:00", "dateChangedImageData": "2024-11-21T09:42:33.7020108+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-21T09:42:33.7020108+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.CRM"> <User> <Account xmlns="http://schemas.datacontract.org/2004/07/Vitec.Housing.Connect.Api.Models.User">sample string 15</Account> <AllowLogOn xmlns="http://schemas.datacontract.org/2004/07/Vitec.Housing.Connect.Api.Models.User">true</AllowLogOn> <Archived xmlns="http://schemas.datacontract.org/2004/07/Vitec.Housing.Connect.Api.Models.User">true</Archived> <Bank xmlns="http://schemas.datacontract.org/2004/07/Vitec.Housing.Connect.Api.Models.User">sample string 13</Bank> <Category xmlns="http://schemas.datacontract.org/2004/07/Vitec.Housing.Connect.Api.Models.User">sample string 5</Category> <CellPhone xmlns="http://schemas.datacontract.org/2004/07/Vitec.Housing.Connect.Api.Models.User">sample string 11</CellPhone> <CleringNumber xmlns="http://schemas.datacontract.org/2004/07/Vitec.Housing.Connect.Api.Models.User">sample string 14</CleringNumber> <Comment xmlns="http://schemas.datacontract.org/2004/07/Vitec.Housing.Connect.Api.Models.User">sample string 18</Comment> <CustomerId xmlns:d3p1="http://schemas.microsoft.com/2003/10/Serialization/Arrays" xmlns="http://schemas.datacontract.org/2004/07/Vitec.Housing.Connect.Api.Models.User"> <d3p1:string>sample string 1</d3p1:string> <d3p1:string>sample string 2</d3p1:string> </CustomerId> <CustomerIdsWithSortOrder xmlns="http://schemas.datacontract.org/2004/07/Vitec.Housing.Connect.Api.Models.User"> <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 xmlns="http://schemas.datacontract.org/2004/07/Vitec.Housing.Connect.Api.Models.User">2024-11-21T09:42:33.7020108+01:00</DateChanged> <Department xmlns="http://schemas.datacontract.org/2004/07/Vitec.Housing.Connect.Api.Models.User">sample string 4</Department> <DirectPhonenumbers xmlns="http://schemas.datacontract.org/2004/07/Vitec.Housing.Connect.Api.Models.User"> <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 xmlns="http://schemas.datacontract.org/2004/07/Vitec.Housing.Connect.Api.Models.User">sample string 9</EmailAddress> <ExternalUserId xmlns="http://schemas.datacontract.org/2004/07/Vitec.Housing.Connect.Api.Models.User">sample string 19</ExternalUserId> <ExtraTitle xmlns="http://schemas.datacontract.org/2004/07/Vitec.Housing.Connect.Api.Models.User">sample string 7</ExtraTitle> <Iban xmlns="http://schemas.datacontract.org/2004/07/Vitec.Housing.Connect.Api.Models.User">sample string 16</Iban> <Image xmlns:d3p1="http://schemas.datacontract.org/2004/07/Vitec.Housing.Connect.Api.Models.Image" xmlns="http://schemas.datacontract.org/2004/07/Vitec.Housing.Connect.Api.Models.User"> <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-21T09:42:33.7020108+01:00</d3p1:DateChanged> <d3p1:DateChangedImageData>2024-11-21T09:42:33.7020108+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 xmlns="http://schemas.datacontract.org/2004/07/Vitec.Housing.Connect.Api.Models.User">1</InternalEmployeeNumber> <OrderNumber xmlns="http://schemas.datacontract.org/2004/07/Vitec.Housing.Connect.Api.Models.User">1</OrderNumber> <Public xmlns="http://schemas.datacontract.org/2004/07/Vitec.Housing.Connect.Api.Models.User">true</Public> <PublicPhonenumber xmlns="http://schemas.datacontract.org/2004/07/Vitec.Housing.Connect.Api.Models.User">sample string 12</PublicPhonenumber> <PublishedOnOffice xmlns:d3p1="http://schemas.microsoft.com/2003/10/Serialization/Arrays" xmlns="http://schemas.datacontract.org/2004/07/Vitec.Housing.Connect.Api.Models.User"> <d3p1:string>sample string 1</d3p1:string> <d3p1:string>sample string 2</d3p1:string> </PublishedOnOffice> <Reviews xmlns="http://schemas.datacontract.org/2004/07/Vitec.Housing.Connect.Api.Models.User"> <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" xmlns="http://schemas.datacontract.org/2004/07/Vitec.Housing.Connect.Api.Models.User"> <d3p1:string>sample string 1</d3p1:string> <d3p1:string>sample string 2</d3p1:string> </SpokenLanguages> <SubOffices xmlns="http://schemas.datacontract.org/2004/07/Vitec.Housing.Connect.Api.Models.User"> <UserSubOffice> <Id>sample string 1</Id> </UserSubOffice> <UserSubOffice> <Id>sample string 1</Id> </UserSubOffice> </SubOffices> <Swift xmlns="http://schemas.datacontract.org/2004/07/Vitec.Housing.Connect.Api.Models.User">sample string 17</Swift> <TelePhone xmlns="http://schemas.datacontract.org/2004/07/Vitec.Housing.Connect.Api.Models.User">sample string 10</TelePhone> <Title xmlns="http://schemas.datacontract.org/2004/07/Vitec.Housing.Connect.Api.Models.User">sample string 6</Title> <UserId xmlns="http://schemas.datacontract.org/2004/07/Vitec.Housing.Connect.Api.Models.User">sample string 2</UserId> <UserName xmlns="http://schemas.datacontract.org/2004/07/Vitec.Housing.Connect.Api.Models.User">sample string 3</UserName> <Deleted>true</Deleted> </User> <User> <Account xmlns="http://schemas.datacontract.org/2004/07/Vitec.Housing.Connect.Api.Models.User">sample string 15</Account> <AllowLogOn xmlns="http://schemas.datacontract.org/2004/07/Vitec.Housing.Connect.Api.Models.User">true</AllowLogOn> <Archived xmlns="http://schemas.datacontract.org/2004/07/Vitec.Housing.Connect.Api.Models.User">true</Archived> <Bank xmlns="http://schemas.datacontract.org/2004/07/Vitec.Housing.Connect.Api.Models.User">sample string 13</Bank> <Category xmlns="http://schemas.datacontract.org/2004/07/Vitec.Housing.Connect.Api.Models.User">sample string 5</Category> <CellPhone xmlns="http://schemas.datacontract.org/2004/07/Vitec.Housing.Connect.Api.Models.User">sample string 11</CellPhone> <CleringNumber xmlns="http://schemas.datacontract.org/2004/07/Vitec.Housing.Connect.Api.Models.User">sample string 14</CleringNumber> <Comment xmlns="http://schemas.datacontract.org/2004/07/Vitec.Housing.Connect.Api.Models.User">sample string 18</Comment> <CustomerId xmlns:d3p1="http://schemas.microsoft.com/2003/10/Serialization/Arrays" xmlns="http://schemas.datacontract.org/2004/07/Vitec.Housing.Connect.Api.Models.User"> <d3p1:string>sample string 1</d3p1:string> <d3p1:string>sample string 2</d3p1:string> </CustomerId> <CustomerIdsWithSortOrder xmlns="http://schemas.datacontract.org/2004/07/Vitec.Housing.Connect.Api.Models.User"> <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 xmlns="http://schemas.datacontract.org/2004/07/Vitec.Housing.Connect.Api.Models.User">2024-11-21T09:42:33.7020108+01:00</DateChanged> <Department xmlns="http://schemas.datacontract.org/2004/07/Vitec.Housing.Connect.Api.Models.User">sample string 4</Department> <DirectPhonenumbers xmlns="http://schemas.datacontract.org/2004/07/Vitec.Housing.Connect.Api.Models.User"> <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 xmlns="http://schemas.datacontract.org/2004/07/Vitec.Housing.Connect.Api.Models.User">sample string 9</EmailAddress> <ExternalUserId xmlns="http://schemas.datacontract.org/2004/07/Vitec.Housing.Connect.Api.Models.User">sample string 19</ExternalUserId> <ExtraTitle xmlns="http://schemas.datacontract.org/2004/07/Vitec.Housing.Connect.Api.Models.User">sample string 7</ExtraTitle> <Iban xmlns="http://schemas.datacontract.org/2004/07/Vitec.Housing.Connect.Api.Models.User">sample string 16</Iban> <Image xmlns:d3p1="http://schemas.datacontract.org/2004/07/Vitec.Housing.Connect.Api.Models.Image" xmlns="http://schemas.datacontract.org/2004/07/Vitec.Housing.Connect.Api.Models.User"> <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-21T09:42:33.7020108+01:00</d3p1:DateChanged> <d3p1:DateChangedImageData>2024-11-21T09:42:33.7020108+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 xmlns="http://schemas.datacontract.org/2004/07/Vitec.Housing.Connect.Api.Models.User">1</InternalEmployeeNumber> <OrderNumber xmlns="http://schemas.datacontract.org/2004/07/Vitec.Housing.Connect.Api.Models.User">1</OrderNumber> <Public xmlns="http://schemas.datacontract.org/2004/07/Vitec.Housing.Connect.Api.Models.User">true</Public> <PublicPhonenumber xmlns="http://schemas.datacontract.org/2004/07/Vitec.Housing.Connect.Api.Models.User">sample string 12</PublicPhonenumber> <PublishedOnOffice xmlns:d3p1="http://schemas.microsoft.com/2003/10/Serialization/Arrays" xmlns="http://schemas.datacontract.org/2004/07/Vitec.Housing.Connect.Api.Models.User"> <d3p1:string>sample string 1</d3p1:string> <d3p1:string>sample string 2</d3p1:string> </PublishedOnOffice> <Reviews xmlns="http://schemas.datacontract.org/2004/07/Vitec.Housing.Connect.Api.Models.User"> <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" xmlns="http://schemas.datacontract.org/2004/07/Vitec.Housing.Connect.Api.Models.User"> <d3p1:string>sample string 1</d3p1:string> <d3p1:string>sample string 2</d3p1:string> </SpokenLanguages> <SubOffices xmlns="http://schemas.datacontract.org/2004/07/Vitec.Housing.Connect.Api.Models.User"> <UserSubOffice> <Id>sample string 1</Id> </UserSubOffice> <UserSubOffice> <Id>sample string 1</Id> </UserSubOffice> </SubOffices> <Swift xmlns="http://schemas.datacontract.org/2004/07/Vitec.Housing.Connect.Api.Models.User">sample string 17</Swift> <TelePhone xmlns="http://schemas.datacontract.org/2004/07/Vitec.Housing.Connect.Api.Models.User">sample string 10</TelePhone> <Title xmlns="http://schemas.datacontract.org/2004/07/Vitec.Housing.Connect.Api.Models.User">sample string 6</Title> <UserId xmlns="http://schemas.datacontract.org/2004/07/Vitec.Housing.Connect.Api.Models.User">sample string 2</UserId> <UserName xmlns="http://schemas.datacontract.org/2004/07/Vitec.Housing.Connect.Api.Models.User">sample string 3</UserName> <Deleted>true</Deleted> </User> </ArrayOfUser>