curl "https://connect.maklare.vitec.net/Advertising/User/StringValue?ChangedAtMinValue=2015-01-01T12:00:00&ChangedAtMaxValue=2015-01-01T12:00:00&PageSize=0&PageIndex=0" -X GET -H "Authorization: basic {Base64 kodad användarnamn och lösenord}"
Dokumentation för API-funktioner
GET Advertising/User/{customerId}
Hämta användarlista för hemsida
Request Information
URI Parameters
Response Information
Resource Description
Hämta användarlista för hemsida
PageOfAdvertising_AdvertisingUserListRow
Kodexempel
Testformulär
Text input
Response Formats
| Namn | Beskrivning | Typ | Information |
| customerId | Kund-id | string |
Krävs |
| ChangedAtMinValue | Ändringsdatum minvärde | date | |
| ChangedAtMaxValue | Ändringsdatum maxvärde | date | |
| PageSize | Sid-storlek | integer | |
| PageIndex | Sid-index | integer |
| Namn | Beskrivning | Typ | Information |
| Index | integer | ||
| Count | integer | ||
| TotalRowCount | integer | ||
| Rows | Collection of AdvertisingUserListRow |
$URL = "https://connect.maklare.vitec.net/Advertising/User/StringValue?ChangedAtMinValue=2015-01-01T12:00:00&ChangedAtMaxValue=2015-01-01T12:00:00&PageSize=0&PageIndex=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("Advertising/User/StringValue?ChangedAtMinValue=2015-01-01T12:00:00&ChangedAtMaxValue=2015-01-01T12:00:00&PageSize=0&PageIndex=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 index = result.index.Value ;
// TODO: Gör något med resultatet
}
$URL = "https://connect.maklare.vitec.net/Advertising/User/StringValue?ChangedAtMinValue=2015-01-01T12:00:00&ChangedAtMaxValue=2015-01-01T12:00:00&PageSize=0&PageIndex=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["index"];
// TODO: Gör något med resultatet
Resultat av begäran
{
"index": 1,
"count": 2,
"totalRowCount": 3,
"rows": [
{
"id": "sample string 1",
"changedAt": "2025-11-08T18:03:34.9343855+01:00",
"offices": [
{
"id": "sample string 1",
"customerId": "sample string 2"
},
{
"id": "sample string 1",
"customerId": "sample string 2"
}
]
},
{
"id": "sample string 1",
"changedAt": "2025-11-08T18:03:34.9343855+01:00",
"offices": [
{
"id": "sample string 1",
"customerId": "sample string 2"
},
{
"id": "sample string 1",
"customerId": "sample string 2"
}
]
}
]
}
<PageOfAdvertisingUserListRowMjTPm89K xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://schemas.datacontract.org/2004/07/Express.Connect.Api.Models">
<Count>2</Count>
<Index>1</Index>
<Rows xmlns:d2p1="http://schemas.datacontract.org/2004/07/Express.Connect.Api.Services.Advertising">
<d2p1:AdvertisingUserListRow>
<d2p1:ChangedAt>2025-11-08T18:03:34.9343855+01:00</d2p1:ChangedAt>
<d2p1:Id>sample string 1</d2p1:Id>
<d2p1:Offices>
<d2p1:AdvertisingUserListRowOffice>
<d2p1:CustomerId>sample string 2</d2p1:CustomerId>
<d2p1:Id>sample string 1</d2p1:Id>
</d2p1:AdvertisingUserListRowOffice>
<d2p1:AdvertisingUserListRowOffice>
<d2p1:CustomerId>sample string 2</d2p1:CustomerId>
<d2p1:Id>sample string 1</d2p1:Id>
</d2p1:AdvertisingUserListRowOffice>
</d2p1:Offices>
</d2p1:AdvertisingUserListRow>
<d2p1:AdvertisingUserListRow>
<d2p1:ChangedAt>2025-11-08T18:03:34.9343855+01:00</d2p1:ChangedAt>
<d2p1:Id>sample string 1</d2p1:Id>
<d2p1:Offices>
<d2p1:AdvertisingUserListRowOffice>
<d2p1:CustomerId>sample string 2</d2p1:CustomerId>
<d2p1:Id>sample string 1</d2p1:Id>
</d2p1:AdvertisingUserListRowOffice>
<d2p1:AdvertisingUserListRowOffice>
<d2p1:CustomerId>sample string 2</d2p1:CustomerId>
<d2p1:Id>sample string 1</d2p1:Id>
</d2p1:AdvertisingUserListRowOffice>
</d2p1:Offices>
</d2p1:AdvertisingUserListRow>
</Rows>
<TotalRowCount>3</TotalRowCount>
</PageOfAdvertisingUserListRowMjTPm89K>