Family by ContactID Put '/contacts/{contactid}/family/{FamilyID}'

The Family by ContactID Put method is used for the creation or maintenance of family relationships.

When the URI '/contacts/{contactid}/family/{familyid}' is paired up with the Method Type 'PUT', you will need to supply the following fields in your put request.

 

Fields
RecID
It's synonymous with the FamilyID supplied in the URI and is the unique identifier for a specific family relationship. Supply 0 or leave the field blank to create NEW relationships. You are welcome to manually specify the RecID by supplying a value. If a relationship between two individuals already exists and a value is not specified, the RecID will be found automatically and the relationship record will be overwritten by your new values.
FromNameID
It's the same as the ContactID supplied in the URI. It represents the family head from which all family associations are related to.
ToNameID
The ContactID for a relative of the family head(from_clid).
RelationshipID
The RelationshipID defines how the relative(to_clid) is related to the family head(from_clid).

 

There are several default Relationship types that are enumerated as follows.

Relationship Types
RelationshipID
Label
20
Spouse
21
Child
22
Grandchild
23
Other Dependent

https://api2.redtailtechnology.com/crm/v1/rest/contacts/{ContactID}/family/{FamilyID}

https://api2.redtailtechnology.com/crm/v1/rest/contacts/1662588/family/0

 

Request Header example (C#)

HttpWebRequest req = (HttpWebRequest)HttpWebRequest.Create("https://api2.redtailtechnology.com/crm/v1/rest/contacts/1662588/family/0");
//To Update an existing relationship, supply a value for the relationship record identifier FamilyID. '/contacts/{contactid}/family/{FamilyID}'
req.Headers[System.Net.HttpRequestHeader.Authorization] = "Basic " + Convert.ToBase64String(System.Text.Encoding.Default.GetBytes("6C135EDF-C37C-4039-AEF3-5DFC079F9E6A:statementone:sonedemo"));
req.Method = "PUT";
req.ContentType = "text/json";

 

Request Body example (C#)

string reqJSON = "{\"FromNameID\":1662588,\"ToNameID\":1662587,\"RecID\":0,\"RelationshipID\":21}";
byte[] reqBody = System.Text.Encoding.ASCII.GetBytes(reqJSON);

//Request Stream
req.GetRequestStream().Write(reqBody, 0, reqBody.Length);

//and here's the response stream.
HttpWebResponse resp = (HttpWebResponse)req.GetResponse();
System.IO.StreamReader sr = new System.IO.StreamReader(resp.GetResponseStream());

 

Was this article helpful?
0 out of 0 found this helpful
Have more questions? Submit a request

Comments

Powered by Zendesk