Dokumentation för API-funktioner
POST Contacts/GetContactsSyncList Hämta kontaktlista. För att kunna hämta en kontaktlista så krävs det en giltig API nyckel och ett kundid. Request Information Body Parameters Urval ContactCriteria
NamnBeskrivningTypInformation
CustomerId Om kontakt id ska tillhöra en specifikt kontor string Kundid måste vara mellan 0 och 40 tecken
ContactId Kontaktid Collection of string

UserId Urval på användarid string

Categories Urval på kategorier Collection of string

EmailAddresses Urval på epostadress Collection of string

ContractDateFrom Kontraktdatum från date

ContractDateTo Kontraktdatum till date

ViewingDateFrom Visiningsdatum från date

ViewingDateTo Visiningsdatum till date

BiddingDateFrom Budgivningsdatum från date

BiddingDateTo Budgivningsdatum till date

CreatedDateFrom Skapatdatum från date

CreatedDateTo Skapatdatum till date

ChangedDateFrom Ändringsdatum från date

ChangedDateTo Ändringsdatum till date

SellerRelationDateFrom Från datum kopplad som säljare på objekt date

SellerRelationDateTo Till datum kopplad som säljare på objekt date

BuyerRelationDateFrom Från datum kopplad som köpare på objekt date

BuyerRelationDateTo Till datum kopplad som köpare på objekt date

CustomField Egendefinerat fält FieldValueCriteria

SocialSecurityNumber Personnummer string

Request Formats

{
  "customerId": "sample string 1",
  "contactId": [
    "sample string 1",
    "sample string 2"
  ],
  "userId": "sample string 2",
  "categories": [
    "sample string 1",
    "sample string 2"
  ],
  "emailAddresses": [
    "sample string 1",
    "sample string 2"
  ],
  "contractDateFrom": "2024-11-21T11:06:18.8765301+01:00",
  "contractDateTo": "2024-11-21T11:06:18.8765301+01:00",
  "viewingDateFrom": "2024-11-21T11:06:18.8765301+01:00",
  "viewingDateTo": "2024-11-21T11:06:18.8765301+01:00",
  "biddingDateFrom": "2024-11-21T11:06:18.8765301+01:00",
  "biddingDateTo": "2024-11-21T11:06:18.8765301+01:00",
  "createdDateFrom": "2024-11-21T11:06:18.8765301+01:00",
  "createdDateTo": "2024-11-21T11:06:18.8765301+01:00",
  "changedDateFrom": "2024-11-21T11:06:18.8765301+01:00",
  "changedDateTo": "2024-11-21T11:06:18.8765301+01:00",
  "sellerRelationDateFrom": "2024-11-21T11:06:18.8765301+01:00",
  "sellerRelationDateTo": "2024-11-21T11:06:18.8765301+01:00",
  "buyerRelationDateFrom": "2024-11-21T11:06:18.8765301+01:00",
  "buyerRelationDateTo": "2024-11-21T11:06:18.8765301+01:00",
  "customField": {
    "name": "sample string 1",
    "value": "sample string 2"
  },
  "socialSecurityNumber": "sample string 3"
}
<ContactCriteria xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://schemas.datacontract.org/2004/07/Vitec.Housing.Connect.Api.Models.Contact">
  <BiddingDateFrom>2024-11-21T11:06:18.8765301+01:00</BiddingDateFrom>
  <BiddingDateTo>2024-11-21T11:06:18.8765301+01:00</BiddingDateTo>
  <BuyerRelationDateFrom>2024-11-21T11:06:18.8765301+01:00</BuyerRelationDateFrom>
  <BuyerRelationDateTo>2024-11-21T11:06:18.8765301+01:00</BuyerRelationDateTo>
  <Categories xmlns:d2p1="http://schemas.microsoft.com/2003/10/Serialization/Arrays">
    <d2p1:string>sample string 1</d2p1:string>
    <d2p1:string>sample string 2</d2p1:string>
  </Categories>
  <ChangedDateFrom>2024-11-21T11:06:18.8765301+01:00</ChangedDateFrom>
  <ChangedDateTo>2024-11-21T11:06:18.8765301+01:00</ChangedDateTo>
  <ContactId xmlns:d2p1="http://schemas.microsoft.com/2003/10/Serialization/Arrays">
    <d2p1:string>sample string 1</d2p1:string>
    <d2p1:string>sample string 2</d2p1:string>
  </ContactId>
  <ContractDateFrom>2024-11-21T11:06:18.8765301+01:00</ContractDateFrom>
  <ContractDateTo>2024-11-21T11:06:18.8765301+01:00</ContractDateTo>
  <CreatedDateFrom>2024-11-21T11:06:18.8765301+01:00</CreatedDateFrom>
  <CreatedDateTo>2024-11-21T11:06:18.8765301+01:00</CreatedDateTo>
  <CustomField xmlns:d2p1="http://schemas.datacontract.org/2004/07/Vitec.Housing.Connect.Api.Models.CustomField">
    <d2p1:Name>sample string 1</d2p1:Name>
    <d2p1:Value>sample string 2</d2p1:Value>
  </CustomField>
  <CustomerId>sample string 1</CustomerId>
  <EmailAddresses xmlns:d2p1="http://schemas.microsoft.com/2003/10/Serialization/Arrays">
    <d2p1:string>sample string 1</d2p1:string>
    <d2p1:string>sample string 2</d2p1:string>
  </EmailAddresses>
  <SellerRelationDateFrom>2024-11-21T11:06:18.8765301+01:00</SellerRelationDateFrom>
  <SellerRelationDateTo>2024-11-21T11:06:18.8765301+01:00</SellerRelationDateTo>
  <SocialSecurityNumber>sample string 3</SocialSecurityNumber>
  <UserId>sample string 2</UserId>
  <ViewingDateFrom>2024-11-21T11:06:18.8765301+01:00</ViewingDateFrom>
  <ViewingDateTo>2024-11-21T11:06:18.8765301+01:00</ViewingDateTo>
</ContactCriteria>
Response Information Resource Description Hämtar lista över kontakters id och ändringsdatum. Collection of ContactCollectionForSyncList
NamnBeskrivningTypInformation
CustomerId Kund id string

Persons Lista av personkontakter Collection of PersonForSyncList

Companies Lista av företagskontakter Collection of CompanyForSyncList

Estates Lista av dödsbokontakter Collection of EstateForSyncList

Kodexempel

curl "https://connect.maklare.vitec.net/Contacts/GetContactsSyncList" -X POST -H "Content-Type: application/json" -H "Authorization: basic {Base64 kodad användarnamn och lösenord}" -d {\"customerId\":\"StringValue\",\"contactId\":[\"StringValue\"],\"userId\":\"StringValue\"}
            

$URL = "https://connect.maklare.vitec.net/Contacts/GetContactsSyncList"
$data = "{`"customerId`":`"StringValue`",`"contactId`":[`"StringValue`"],`"userId`":`"StringValue`"}"
Invoke-WebRequest -Uri $URL -Method POST -Headers @{"Content-Type" = "application/json"; "authorization" = "basic {Base64 kodad användarnamn och lösenord}"} -Body $data
                

// 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}")
//     }
// }
var json = "{\"customerId\":\"StringValue\",\"contactId\":[\"StringValue\"],\"userId\":\"StringValue\"}";
using (var response = await HttpClientInstance.PostAsync("Contacts/GetContactsSyncList", new StringContent(json, Encoding.UTF8, "application/json"))) {
    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/Contacts/GetContactsSyncList";

$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);
$data = "{\"customerId\":\"StringValue\",\"contactId\":[\"StringValue\"],\"userId\":\"StringValue\"}";
curl_setopt($ch, CURLOPT_POST, true);

curl_setopt($ch, CURLOPT_POSTFIELDS, $data);
curl_setopt($ch, CURLOPT_HTTPHEADER, array(
    'Content-Type: application/json',
    'Content-Length: ' . strlen($data)
));

$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",
    "persons": [
      {
        "contactId": "sample string 1",
        "dateChanged": "2024-11-21T11:06:18.8765301+01:00"
      },
      {
        "contactId": "sample string 1",
        "dateChanged": "2024-11-21T11:06:18.8765301+01:00"
      }
    ],
    "companies": [
      {
        "contactId": "sample string 1",
        "dateChanged": "2024-11-21T11:06:18.8765301+01:00"
      },
      {
        "contactId": "sample string 1",
        "dateChanged": "2024-11-21T11:06:18.8765301+01:00"
      }
    ],
    "estates": [
      {
        "contactId": "sample string 1",
        "dateChanged": "2024-11-21T11:06:18.8765301+01:00"
      },
      {
        "contactId": "sample string 1",
        "dateChanged": "2024-11-21T11:06:18.8765301+01:00"
      }
    ]
  },
  {
    "customerId": "sample string 1",
    "persons": [
      {
        "contactId": "sample string 1",
        "dateChanged": "2024-11-21T11:06:18.8765301+01:00"
      },
      {
        "contactId": "sample string 1",
        "dateChanged": "2024-11-21T11:06:18.8765301+01:00"
      }
    ],
    "companies": [
      {
        "contactId": "sample string 1",
        "dateChanged": "2024-11-21T11:06:18.8765301+01:00"
      },
      {
        "contactId": "sample string 1",
        "dateChanged": "2024-11-21T11:06:18.8765301+01:00"
      }
    ],
    "estates": [
      {
        "contactId": "sample string 1",
        "dateChanged": "2024-11-21T11:06:18.8765301+01:00"
      },
      {
        "contactId": "sample string 1",
        "dateChanged": "2024-11-21T11:06:18.8765301+01:00"
      }
    ]
  }
]
<ArrayOfContactCollectionForSyncList xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://schemas.datacontract.org/2004/07/Vitec.Housing.Connect.Api.Models.Contact">
  <ContactCollectionForSyncList>
    <Companies>
      <CompanyForSyncList>
        <ContactId>sample string 1</ContactId>
        <DateChanged>2024-11-21T11:06:18.8765301+01:00</DateChanged>
      </CompanyForSyncList>
      <CompanyForSyncList>
        <ContactId>sample string 1</ContactId>
        <DateChanged>2024-11-21T11:06:18.8765301+01:00</DateChanged>
      </CompanyForSyncList>
    </Companies>
    <CustomerId>sample string 1</CustomerId>
    <Estates>
      <EstateForSyncList>
        <ContactId>sample string 1</ContactId>
        <DateChanged>2024-11-21T11:06:18.8765301+01:00</DateChanged>
      </EstateForSyncList>
      <EstateForSyncList>
        <ContactId>sample string 1</ContactId>
        <DateChanged>2024-11-21T11:06:18.8765301+01:00</DateChanged>
      </EstateForSyncList>
    </Estates>
    <Persons>
      <PersonForSyncList>
        <ContactId>sample string 1</ContactId>
        <DateChanged>2024-11-21T11:06:18.8765301+01:00</DateChanged>
      </PersonForSyncList>
      <PersonForSyncList>
        <ContactId>sample string 1</ContactId>
        <DateChanged>2024-11-21T11:06:18.8765301+01:00</DateChanged>
      </PersonForSyncList>
    </Persons>
  </ContactCollectionForSyncList>
  <ContactCollectionForSyncList>
    <Companies>
      <CompanyForSyncList>
        <ContactId>sample string 1</ContactId>
        <DateChanged>2024-11-21T11:06:18.8765301+01:00</DateChanged>
      </CompanyForSyncList>
      <CompanyForSyncList>
        <ContactId>sample string 1</ContactId>
        <DateChanged>2024-11-21T11:06:18.8765301+01:00</DateChanged>
      </CompanyForSyncList>
    </Companies>
    <CustomerId>sample string 1</CustomerId>
    <Estates>
      <EstateForSyncList>
        <ContactId>sample string 1</ContactId>
        <DateChanged>2024-11-21T11:06:18.8765301+01:00</DateChanged>
      </EstateForSyncList>
      <EstateForSyncList>
        <ContactId>sample string 1</ContactId>
        <DateChanged>2024-11-21T11:06:18.8765301+01:00</DateChanged>
      </EstateForSyncList>
    </Estates>
    <Persons>
      <PersonForSyncList>
        <ContactId>sample string 1</ContactId>
        <DateChanged>2024-11-21T11:06:18.8765301+01:00</DateChanged>
      </PersonForSyncList>
      <PersonForSyncList>
        <ContactId>sample string 1</ContactId>
        <DateChanged>2024-11-21T11:06:18.8765301+01:00</DateChanged>
      </PersonForSyncList>
    </Persons>
  </ContactCollectionForSyncList>
</ArrayOfContactCollectionForSyncList>