Skip to main content

Last updated: 2024-06-07


InsertKeyRelations Method


In this topic:


Overview


The InsertKeyRelations method adds a key relation to a SmartOffice contact record.


The InsertKeyRelations method is invoked using the method operation.


Note that the user inserting the key relation must have access to both contacts if office security is enabled.


Parameters


Parameter NameTypeRequired?Description
ContactIDStringYesThis is the object ID of the contact to which the key relation will be added.
RelatedToIDStringYesThis is the object ID of the contact that will be the key relation.
RelationTypeStringYesValid values for this parameter are: 1 (Business), 2 (Family), 3 (Group Census), 4 (Personal) or 5 (Professional).




Note that
RelationType
must correspond to the value of the
Relation
parameter.
RelationStringYesThe value of Relation must correspond to the value of RelationType.
If RelationType is 1, valid values for Relation are: 0 (None), 1 (Associate), 9 (Employee), 10 (Employer), 16 (Fellow Employee), 28 (Partner), 40 (Subordinate), 41 (Superior).
If RelationType is 2, valid values for Relation are: 0 (None), 2 (Aunt), 3 (Brother), 4 (Brother-in-Law), 5 (Cousin), 6 (Daughter), 7 (Daughter-in-Law), 8 (Domestic Partner), 11 (Ex-Husband), 12 (Ex-Spouse), 13 (Ex-Wife), 14 (Father), 15 (Father-in-Law), 17 (Fiancee), 19 (Granddaughter), 20 (Grandfather), 21 (Grandmother), 22 (Grandson), 23 (Husband), 24 (Mother), 25 (Mother-in-Law), 26 (Nephew), 27 (Niece), 31 (Sister), 32 (Sister-in-Law), 33 (Son), 34 (Son-in-Law), 35 (Spouse), 36 (Stepdaughter), 37 (Stepfather), 38 (Stepmother), 39 (Stepson), 42 (Uncle), 43 (Wife), 44 (Other), 55 (Child), 56 (Parent), 57 (Stepbrother), 58 (Stepsister), 59 (Grandchild), 60 (Fiance).
If RelationType is 3, valid values for Relation are: 45 (Group Census).
If RelationType is 4, valid values for Relation are: 0 (None), 18 (Friend), 29 (Referree), 30 (Referrer).
If RelationType is 5, valid values for Relation are: 0 (None), 46 (Financial Advisor), 47 (Banker), 48 (Attorney), 49 (Accountant), 50 (Broker), 51 (Financial Client), 52 (Dependent), 53 (Nominator), 54 (Nominee), 61 (Provider), 62 (Customer), 63 (Legal Client), 64 (Account Client), 65 (Broker Client), 66 (Trustee), 67 (Grantor), 68 (Assistant), 69 (Supervisor).

Example


The following example adds a family (husband) key relation to a contact:


XML
<request version='1.0'>
  <header>...</header>
  <method>
    <InsertKeyRelations>
      <ContactID>Contact.1.14</ContactID>
      <RelatedToID>Contact.1.38</RelatedToID>
      <RelationType>2</RelationType>
      <Relation>23</Relation>
    </InsertKeyRelations>
  </method>
</request>

The response returns the newly created key relations' object IDs:


XML
<response version="1.0">
  <header>
    <sessionClosed/>
  </header>
  <method>
    <InsertKeyRelations>
      <Relation>
        <Contact>Relation.1.55</Contact>
        <RelatedTo>Relation.1.56</RelatedTo>
      </Relation>
    </InsertKeyRelations>
  </method>
  <_status>OK</_status>
  <_systime>2015-10-08T23:38:15</_systime>
  <!--Cost 43 mill seconds.-->
</response>