curl "https://connect.maklare.vitec.net/CRM/Contact/StringValue/StringValue/PartyRoles" -X GET -H "Authorization: basic {Base64 kodad användarnamn och lösenord}"
Dokumentation för API-funktioner
GET CRM/Contact/{customerId}/{contactId}/PartyRoles
Alla köp-, sälj- och extra köp-/sälj-relationer en kontakt har
Request Information
URI Parameters
Response Information
Resource Description
Alla köp-, sälj- och extra köp-/sälj-relationer en kontakt har
ContactPartyRoles
Kodexempel
Testformulär
Text input
Response Formats
Namn | Beskrivning | Typ | Information |
customerId | Kundid | string |
Krävs |
contactId | Kontaktid | string |
Krävs |
Namn | Beskrivning | Typ | Information |
Buyer | Köpare | Collection of EstateParty | |
ExtraBuyer | Relation/extra kontakt till köpare | Collection of EstateExtraParty | |
Seller | Säljare | Collection of EstateParty | |
ExtraSeller | Relation/extra kontakt till säljare | Collection of EstateExtraParty | |
Tenant | Hyresgäst | Collection of EstateParty |
För lokaler |
ExtraTenant | Relation/extra kontakt till hyresgäst | Collection of EstateExtraParty |
För lokaler |
Owner | Ägare/uthyrare | Collection of EstateParty |
För lokaler |
ExtraOwner | Relation/extra kontakt till ägare/uthyrare | Collection of EstateExtraParty |
För lokaler |
$URL = "https://connect.maklare.vitec.net/CRM/Contact/StringValue/StringValue/PartyRoles"
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/StringValue/PartyRoles")) {
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 buyer = result.buyer.Value ;
// TODO: Gör något med resultatet
}
$URL = "https://connect.maklare.vitec.net/CRM/Contact/StringValue/StringValue/PartyRoles";
$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["buyer"];
// TODO: Gör något med resultatet
Resultat av begäran
{ "buyer": [ { "estateId": "sample string 1", "roleCreatedAt": "2024-11-21T10:36:29.098594+01:00" }, { "estateId": "sample string 1", "roleCreatedAt": "2024-11-21T10:36:29.098594+01:00" } ], "extraBuyer": [ { "estateId": "sample string 1", "roleCreatedAt": "2024-11-21T10:36:29.098594+01:00", "partyRole": "ExtraPartyContactPerson", "contactId": "sample string 3" }, { "estateId": "sample string 1", "roleCreatedAt": "2024-11-21T10:36:29.098594+01:00", "partyRole": "ExtraPartyContactPerson", "contactId": "sample string 3" } ], "seller": [ { "estateId": "sample string 1", "roleCreatedAt": "2024-11-21T10:36:29.098594+01:00" }, { "estateId": "sample string 1", "roleCreatedAt": "2024-11-21T10:36:29.098594+01:00" } ], "extraSeller": [ { "estateId": "sample string 1", "roleCreatedAt": "2024-11-21T10:36:29.098594+01:00", "partyRole": "ExtraPartyContactPerson", "contactId": "sample string 3" }, { "estateId": "sample string 1", "roleCreatedAt": "2024-11-21T10:36:29.098594+01:00", "partyRole": "ExtraPartyContactPerson", "contactId": "sample string 3" } ], "tenant": [ { "estateId": "sample string 1", "roleCreatedAt": "2024-11-21T10:36:29.098594+01:00" }, { "estateId": "sample string 1", "roleCreatedAt": "2024-11-21T10:36:29.098594+01:00" } ], "extraTenant": [ { "estateId": "sample string 1", "roleCreatedAt": "2024-11-21T10:36:29.098594+01:00", "partyRole": "ExtraPartyContactPerson", "contactId": "sample string 3" }, { "estateId": "sample string 1", "roleCreatedAt": "2024-11-21T10:36:29.098594+01:00", "partyRole": "ExtraPartyContactPerson", "contactId": "sample string 3" } ], "owner": [ { "estateId": "sample string 1", "roleCreatedAt": "2024-11-21T10:36:29.098594+01:00" }, { "estateId": "sample string 1", "roleCreatedAt": "2024-11-21T10:36:29.098594+01:00" } ], "extraOwner": [ { "estateId": "sample string 1", "roleCreatedAt": "2024-11-21T10:36:29.098594+01:00", "partyRole": "ExtraPartyContactPerson", "contactId": "sample string 3" }, { "estateId": "sample string 1", "roleCreatedAt": "2024-11-21T10:36:29.098594+01:00", "partyRole": "ExtraPartyContactPerson", "contactId": "sample string 3" } ] }
<ContactPartyRoles xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://schemas.datacontract.org/2004/07/Express.Connect.Api.Models.Contact.Crm"> <Buyer> <EstateParty> <EstateId>sample string 1</EstateId> <RoleCreatedAt>2024-11-21T10:36:29.098594+01:00</RoleCreatedAt> </EstateParty> <EstateParty> <EstateId>sample string 1</EstateId> <RoleCreatedAt>2024-11-21T10:36:29.098594+01:00</RoleCreatedAt> </EstateParty> </Buyer> <ExtraBuyer> <EstateExtraParty> <ContactId>sample string 3</ContactId> <EstateId>sample string 1</EstateId> <PartyRole>ExtraPartyContactPerson</PartyRole> <RoleCreatedAt>2024-11-21T10:36:29.098594+01:00</RoleCreatedAt> </EstateExtraParty> <EstateExtraParty> <ContactId>sample string 3</ContactId> <EstateId>sample string 1</EstateId> <PartyRole>ExtraPartyContactPerson</PartyRole> <RoleCreatedAt>2024-11-21T10:36:29.098594+01:00</RoleCreatedAt> </EstateExtraParty> </ExtraBuyer> <ExtraOwner> <EstateExtraParty> <ContactId>sample string 3</ContactId> <EstateId>sample string 1</EstateId> <PartyRole>ExtraPartyContactPerson</PartyRole> <RoleCreatedAt>2024-11-21T10:36:29.098594+01:00</RoleCreatedAt> </EstateExtraParty> <EstateExtraParty> <ContactId>sample string 3</ContactId> <EstateId>sample string 1</EstateId> <PartyRole>ExtraPartyContactPerson</PartyRole> <RoleCreatedAt>2024-11-21T10:36:29.098594+01:00</RoleCreatedAt> </EstateExtraParty> </ExtraOwner> <ExtraSeller> <EstateExtraParty> <ContactId>sample string 3</ContactId> <EstateId>sample string 1</EstateId> <PartyRole>ExtraPartyContactPerson</PartyRole> <RoleCreatedAt>2024-11-21T10:36:29.098594+01:00</RoleCreatedAt> </EstateExtraParty> <EstateExtraParty> <ContactId>sample string 3</ContactId> <EstateId>sample string 1</EstateId> <PartyRole>ExtraPartyContactPerson</PartyRole> <RoleCreatedAt>2024-11-21T10:36:29.098594+01:00</RoleCreatedAt> </EstateExtraParty> </ExtraSeller> <ExtraTenant> <EstateExtraParty> <ContactId>sample string 3</ContactId> <EstateId>sample string 1</EstateId> <PartyRole>ExtraPartyContactPerson</PartyRole> <RoleCreatedAt>2024-11-21T10:36:29.098594+01:00</RoleCreatedAt> </EstateExtraParty> <EstateExtraParty> <ContactId>sample string 3</ContactId> <EstateId>sample string 1</EstateId> <PartyRole>ExtraPartyContactPerson</PartyRole> <RoleCreatedAt>2024-11-21T10:36:29.098594+01:00</RoleCreatedAt> </EstateExtraParty> </ExtraTenant> <Owner> <EstateParty> <EstateId>sample string 1</EstateId> <RoleCreatedAt>2024-11-21T10:36:29.098594+01:00</RoleCreatedAt> </EstateParty> <EstateParty> <EstateId>sample string 1</EstateId> <RoleCreatedAt>2024-11-21T10:36:29.098594+01:00</RoleCreatedAt> </EstateParty> </Owner> <Seller> <EstateParty> <EstateId>sample string 1</EstateId> <RoleCreatedAt>2024-11-21T10:36:29.098594+01:00</RoleCreatedAt> </EstateParty> <EstateParty> <EstateId>sample string 1</EstateId> <RoleCreatedAt>2024-11-21T10:36:29.098594+01:00</RoleCreatedAt> </EstateParty> </Seller> <Tenant> <EstateParty> <EstateId>sample string 1</EstateId> <RoleCreatedAt>2024-11-21T10:36:29.098594+01:00</RoleCreatedAt> </EstateParty> <EstateParty> <EstateId>sample string 1</EstateId> <RoleCreatedAt>2024-11-21T10:36:29.098594+01:00</RoleCreatedAt> </EstateParty> </Tenant> </ContactPartyRoles>