This article covers both the GET and PUT methods associated with a Contact Record's 'Estimated Tax Information'. You can find this portion in the CRM under Contact's Overview ->'Know Your Client'
Tax Information by ContactID Fetch
Method Type: GET
returns the Estimated Tax Information associated with a contact record.
'/contacts/{contactid}/tax'
Tax Information by ContactID Put
Method Type: PUT
Updates the Estimated Tax Information associated with a contact record.
'/contacts/{contactid}/tax/{taxid}'
Tax Information By ContactID Fetch
The URI '/contacts/{contactid}/importantinformation', when coupled with Method Type 'GET', returns the Estimated Tax Information related to a specific contact record.
https://api2.redtailtechnology.com/crm/v1/rest/contacts/{ContactID}/tax
https://api2.redtailtechnology.com/crm/v1/rest/contacts/384843/tax
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/tax"); 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.
Tax Information by ContactID PUT
With this method you can update the Estimated Tax Information Record by ContactID
As you know, a PUT method requires a Request Body accompanying the Request Header. (You know this because you've read our 101 article!)
To create a new record, we will specify the ContactID in our URI and supply the required fields in the request body.
https://api2.redtailtechnology.com/crm/v1/rest/contacts/{contactid}/tax
Request Header example (C#)
HttpWebRequest req = (HttpWebRequest)HttpWebRequest.Create("https://api2.redtailtechnology.com/crm/v1/rest/contacts/384843/tax");
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 = "{\"Estimate\":280000,\"TaxReturn\":true,\"TaxReturnYear\":2013,\"Bracket\":20,\"AdjustGrossIncome\":150000}"
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());
Comments