The methods available for Accounts are exposed under their respective URI's, which are described below.
Method Type: GET
returns a paged list of Accounts associated with a specific Contact Record
'/contacts/{contactid}/accounts?assets={INCLUDEASSETS}&Page={page}'
Optional Query string parameters: Page, Assets
?page = page #, non-supplied= page 1
?assets specifies whether to include securities in the results. 0 = false, 1 = true.
Method Type: PUT
Creates or Updates an Account Record by AccountID for a specific contact.
'/contacts/{contactid}/accounts/{accountid}'
Account Assets by AccountID Fetch
Method Type: GET
returns a list of Assets associated with an Account.
'/contacts/{contactid}/accounts/{accountid}/assets
Accounts By ContactID Fetch
The URI '/contacts/{contactid}/accounts', when coupled with Method Type 'GET', returns a List of accounts associated with a specific Contact Record.
https://api2.redtailtechnology.com/crm/v1/rest/contacts/{ContactID}/accounts
example: https://api2.redtailtechnology.com/crm/v1/rest/contacts/384843/accounts
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/accounts"); 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 following is a condensed XML response. The XML response will include up to 50 accounts per page and provide a total count of the related note records.
Account By AccountID Put
The URI '/contacts/{contactid}/accounts/{accountid}', when coupled with Method Type 'PUT', Creates or Updates an Account by AccountID. To create a new Account record, the AccountID supplied in the URI should be 0. To Update an existing Account record, you will need to provide the AccountID. THe AccountID is the same as the RecID found in each Account record of an Accounts Fetch.
https://api2.redtailtechnology.com/crm/v1/rest/contacts/{ContactID}/accounts/{AccountID}
https://api2.redtailtechnology.com/crm/v1/rest/contacts/384843/accounts/0
Request Header example (C#)
HttpWebRequest req = (HttpWebRequest)HttpWebRequest.Create("https://api2.redtailtechnology.com/crm/v1/rest/contacts/384843/accounts/0");
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 = "{""Balance"":1000000,""ClientID"":384843,""Company"":""AIG"",""Discretionary"":false,""Managed"":true,""Manager"":"""",""Model"":"""",""Number"":""5432151515a"",""Product"":"""",""Registration"":"""",""RecAddUser"":41974,""StatusID"":2,""TaxQualifiedID"":2,""TypeID"":33,""Assets"":null}";
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());
Accounts Assets By AccountID Fetch
The URI '/contacts/{contactid}/accounts/{accountid}/assets', when coupled with Method Type 'GET', returns a List of Assets associated with a specific Account.
https://api2.redtailtechnology.com/crm/v1/rest/contacts/{ContactID}/accounts/{AccountID}/assets
example: https://api2.redtailtechnology.com/crm/v1/rest/contacts/384843/accounts/451583/assets
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/accounts/451583/assets"); 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 following is a sample XML response of the Account Assets Fetch method.
Comments