The methods available for Contact Record Details are exposed with the method types GET and PUT. These method types, as you know, are used for record retrieval(Get) or for creating and maintaining records(Put).
The purpose of each of the methods are outlined more specifically below.
Contact Details by ContactID Fetch
Method Type: GET
returns contact record details by ContactID
'/contacts/{contactid}/details'
Contact Details by ContactID Put
Method Type: PUT
updates the contact record fields associated with the Details by ContactID GET method.
'/contacts/{contactid}/details'
*Note: For Contact Record Creation, please see the Contact PUT and Contact Basic PUT methods.<links to come>
So what are the contact record details? The fields made use of in our Contact Details methods mimick the fields exposed in our CRM inside the Contact Details card.
Contact Details by ContactID Fetch
The URI '/contacts/{contactid}/details', when coupled with Method Type 'GET', returns a contact record's details.
https://api2.redtailtechnology.com/crm/v1/rest/contacts/{contactid}/details
https://api2.redtailtechnology.com/crm/v1/rest/contacts/384843/details
Below is a sample request in C# using our URI, sample credentials, and the method type. The content type "text/json" work equally well.
HttpWebRequest req = (HttpWebRequest)HttpWebRequest.Create("https://api2.redtailtechnology.com/crm/v1/rest/contacts/384843"); req.Headers[System.Net.HttpRequestHeader.Authorization] = "Basic " + Convert.ToBase64String(System.Text.Encoding.Default.GetBytes("6C135EDF-C37C-4039-AEF3-5DFC079F9E6A:Statementone:sonedemo")); req.Method = "GET"; req.ContentType = "text/xml";
//and here's the response stream.
HttpWebResponse resp = (HttpWebResponse)req.GetResponse();
System.IO.StreamReader sr = new System.IO.StreamReader(resp.GetResponseStream());
The corresponding response(xml) will be similar to the following.
Contact Details by ContactID PUT
The Contact Details Put method allows you to update Contact Record Detail Fields by ContactID.
The available fields are provided below.
Field | Datatype |
<ClientID>
<StatusID>
<CategoryID>
<SourceID>
<ReferredBy>
<TaxID>
<DateOfBirth>
<DateofBirthReminder>
<MaritalStatus>
<DateOfBirth>
<Gender>
<MaritalStatus>
<MaritalDate>
<Gender>
<ServicingAdvisorID>
<WritingAdvisorID>
<ClientSince>
|
integer
integer
integer
integer
integer
integer
datetime
boolean
string
datetime
string
string
datetime
string
integer
integer
datetime
|
Unlike other put methods you've come across, you cannot actually create a record with 'Contact Details Put'. However, you can update a record. Of course, you will need to supply the ContactID for the record you will be modifying.
https://api2.redtailtechnology.com/crm/v1/rest/contacts/{contactid}
Request Header example (C#)
HttpWebRequest req = (HttpWebRequest)HttpWebRequest.Create("https://api2.redtailtechnology.com/crm/v1/rest/contacts/56738/details");
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/xml";
Request Body example (C#)
string reqXML= "<Detail xmlns=""http://schemas.datacontract.org/2004/07/REDTAIL.Model"" xmlns:i=""http://www.w3.org/2001/XMLSchema-instance""><CategoryID>5487</CategoryID><ClientID>384843</ClientID><ClientSince>2003-01-01T00:00:00</ClientSince><ClientType>I</ClientType><DateofBirth>1984-04-30T00:00:00</DateofBirth><DateofBirthReminder>false</DateofBirthReminder><FirstName i:nil=""true""/><Gender>F</Gender><InputByID>41974</InputByID><MaritalDate>1984-08-06T00:00:00</MaritalDate><MaritalStatus>M</MaritalStatus><ReferredBy>Joe Blo</ReferredBy><ServicingAdvisorID>1128</ServicingAdvisorID><SourceID>6061</SourceID><StatusID>8303</StatusID><TaxID>123321234</TaxID><WritingAdvisorID>1171</WritingAdvisorID></Detail>";
byte[] reqBody = System.Text.Encoding.ASCII.GetBytes(reqXML);
//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());
Comments