Dokumentation för API-funktioner
GET CRM/Contact/{customerId}/DeceasedEstate/{contactIds} Hämta lista utav dödsbokontakter, max 20 stycken åt gången. Request Information URI Parameters
NamnBeskrivningTypInformation
customerId Kund-id. string Krävs
contactIds Kontaktidn (kommaseparerade, max 20 stycken). string Krävs
Response Information Resource Description Hämta lista utav dödsbokontakter, max 20 stycken åt gången. Collection of CrmDeceasedEstateContact
NamnBeskrivningTypInformation
Type Kontakttyp (Person, företag eller dödsbo) ContactType

Name Namn string Nam måste vara mellan 0 och 30 tecken
SocialSecurityNumber Personnummer string Personnummer måste vara mellan 0 och 20 tecken
IsForeignIdSocialSecurityNumber Annat format/utländskt personnummer boolean

Telephone Telefonnummer PersonTelephoneNumbers

Id Kontakt id string Kontaktid måste vara mellan 0 och 40 tecken
CustomerId Kund-id string Kund-id krävs
Kund-id måste vara mellan 0 och 40 tecken
AgentId Mäklarens id string

Address Adress CrmContactAddress

Email Email Email

AdvertisingEnabled Reklamutskick tillåts boolean

Note Anteckning string

Categories Kategorier Collection of Category

CreatedAt Skapad date

ChangedAt Ändrad date

Kodexempel

curl "https://connect.maklare.vitec.net/CRM/Contact/StringValue/DeceasedEstate/StringValue" -X GET -H "Authorization: basic {Base64 kodad användarnamn och lösenord}" 
            

$URL = "https://connect.maklare.vitec.net/CRM/Contact/StringValue/DeceasedEstate/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("CRM/Contact/StringValue/DeceasedEstate/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 type = firstInArray.type.Value;
    // TODO: Gör något med resultatet
}

$URL = "https://connect.maklare.vitec.net/CRM/Contact/StringValue/DeceasedEstate/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["type"];
// TODO: Gör något med resultatet
Testformulär Text input
Response Formats
[
  {
    "type": "DeceasedEstate",
    "name": "sample string 1",
    "socialSecurityNumber": "sample string 2",
    "isForeignIdSocialSecurityNumber": true,
    "telephone": {
      "home": "sample string 1",
      "work": "sample string 2",
      "cell": "sample string 3",
      "other": "sample string 4"
    },
    "id": "sample string 3",
    "customerId": "sample string 4",
    "agentId": "sample string 5",
    "address": {
      "streetAddress": "sample string 1",
      "zipCode": "sample string 2",
      "city": "sample string 3",
      "countryCode": "sample string 4"
    },
    "email": {
      "emailAddress": "sample string 1",
      "emailAddress2": "sample string 2"
    },
    "advertisingEnabled": true,
    "note": "sample string 7",
    "categories": [
      {
        "id": "sample string 1",
        "name": "sample string 2",
        "readOnly": true
      },
      {
        "id": "sample string 1",
        "name": "sample string 2",
        "readOnly": true
      }
    ],
    "createdAt": "2024-11-21T11:11:24.1768638+01:00",
    "changedAt": "2024-11-21T11:11:24.1768638+01:00"
  },
  {
    "type": "DeceasedEstate",
    "name": "sample string 1",
    "socialSecurityNumber": "sample string 2",
    "isForeignIdSocialSecurityNumber": true,
    "telephone": {
      "home": "sample string 1",
      "work": "sample string 2",
      "cell": "sample string 3",
      "other": "sample string 4"
    },
    "id": "sample string 3",
    "customerId": "sample string 4",
    "agentId": "sample string 5",
    "address": {
      "streetAddress": "sample string 1",
      "zipCode": "sample string 2",
      "city": "sample string 3",
      "countryCode": "sample string 4"
    },
    "email": {
      "emailAddress": "sample string 1",
      "emailAddress2": "sample string 2"
    },
    "advertisingEnabled": true,
    "note": "sample string 7",
    "categories": [
      {
        "id": "sample string 1",
        "name": "sample string 2",
        "readOnly": true
      },
      {
        "id": "sample string 1",
        "name": "sample string 2",
        "readOnly": true
      }
    ],
    "createdAt": "2024-11-21T11:11:24.1768638+01:00",
    "changedAt": "2024-11-21T11:11:24.1768638+01:00"
  }
]
<ArrayOfCrmDeceasedEstateContact xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://schemas.datacontract.org/2004/07/Vitec.Housing.Connect.Api.Models.Contact.Crm">
  <CrmDeceasedEstateContact>
    <Address>
      <City>sample string 3</City>
      <CountryCode>sample string 4</CountryCode>
      <StreetAddress>sample string 1</StreetAddress>
      <ZipCode>sample string 2</ZipCode>
    </Address>
    <AdvertisingEnabled>true</AdvertisingEnabled>
    <AgentId>sample string 5</AgentId>
    <Categories xmlns:d3p1="http://schemas.datacontract.org/2004/07/Vitec.Housing.Connect.Api.Models.Category">
      <d3p1:Category>
        <d3p1:Id>sample string 1</d3p1:Id>
        <d3p1:Name>sample string 2</d3p1:Name>
        <d3p1:ReadOnly>true</d3p1:ReadOnly>
      </d3p1:Category>
      <d3p1:Category>
        <d3p1:Id>sample string 1</d3p1:Id>
        <d3p1:Name>sample string 2</d3p1:Name>
        <d3p1:ReadOnly>true</d3p1:ReadOnly>
      </d3p1:Category>
    </Categories>
    <ChangedAt>2024-11-21T11:11:24.1768638+01:00</ChangedAt>
    <CreatedAt>2024-11-21T11:11:24.1768638+01:00</CreatedAt>
    <CustomerId>sample string 4</CustomerId>
    <Email xmlns:d3p1="http://schemas.datacontract.org/2004/07/Vitec.Housing.Connect.Api.Models">
      <d3p1:EmailAddress>sample string 1</d3p1:EmailAddress>
      <d3p1:EmailAddress2>sample string 2</d3p1:EmailAddress2>
    </Email>
    <Id>sample string 3</Id>
    <Note>sample string 7</Note>
    <Type>DeceasedEstate</Type>
    <IsForeignIdSocialSecurityNumber>true</IsForeignIdSocialSecurityNumber>
    <Name>sample string 1</Name>
    <SocialSecurityNumber>sample string 2</SocialSecurityNumber>
    <Telephone>
      <Other>sample string 4</Other>
      <Cell>sample string 3</Cell>
      <Home>sample string 1</Home>
      <Work>sample string 2</Work>
    </Telephone>
  </CrmDeceasedEstateContact>
  <CrmDeceasedEstateContact>
    <Address>
      <City>sample string 3</City>
      <CountryCode>sample string 4</CountryCode>
      <StreetAddress>sample string 1</StreetAddress>
      <ZipCode>sample string 2</ZipCode>
    </Address>
    <AdvertisingEnabled>true</AdvertisingEnabled>
    <AgentId>sample string 5</AgentId>
    <Categories xmlns:d3p1="http://schemas.datacontract.org/2004/07/Vitec.Housing.Connect.Api.Models.Category">
      <d3p1:Category>
        <d3p1:Id>sample string 1</d3p1:Id>
        <d3p1:Name>sample string 2</d3p1:Name>
        <d3p1:ReadOnly>true</d3p1:ReadOnly>
      </d3p1:Category>
      <d3p1:Category>
        <d3p1:Id>sample string 1</d3p1:Id>
        <d3p1:Name>sample string 2</d3p1:Name>
        <d3p1:ReadOnly>true</d3p1:ReadOnly>
      </d3p1:Category>
    </Categories>
    <ChangedAt>2024-11-21T11:11:24.1768638+01:00</ChangedAt>
    <CreatedAt>2024-11-21T11:11:24.1768638+01:00</CreatedAt>
    <CustomerId>sample string 4</CustomerId>
    <Email xmlns:d3p1="http://schemas.datacontract.org/2004/07/Vitec.Housing.Connect.Api.Models">
      <d3p1:EmailAddress>sample string 1</d3p1:EmailAddress>
      <d3p1:EmailAddress2>sample string 2</d3p1:EmailAddress2>
    </Email>
    <Id>sample string 3</Id>
    <Note>sample string 7</Note>
    <Type>DeceasedEstate</Type>
    <IsForeignIdSocialSecurityNumber>true</IsForeignIdSocialSecurityNumber>
    <Name>sample string 1</Name>
    <SocialSecurityNumber>sample string 2</SocialSecurityNumber>
    <Telephone>
      <Other>sample string 4</Other>
      <Cell>sample string 3</Cell>
      <Home>sample string 1</Home>
      <Work>sample string 2</Work>
    </Telephone>
  </CrmDeceasedEstateContact>
</ArrayOfCrmDeceasedEstateContact>