This article covers both the GET and PUT methods associated with a Contact Record's 'Strategic Allocation Model'. You can find this portion in the CRM under Contact's Overview ->'Know Your Client'
Strategic Allocation Model By ContactID Fetch
Method Type: GET
returns the Strategic Allocation Model info associated with a contact record.
'/contacts/{contactid}/sam'
Strategic Allocation Model Objectives Fetch
Method Type: GET
returns the list of SAM Objectives for the authenticated user's Database.
'/settings/samobjectives'
Strategic Allocation Model By ContactID PUT
Method Type: PUT
Updates the Strategic Allocation Model info associated with a contact record.
'/contacts/{contactid}/sam'
Strategic Allocation Model By ContactID Fetch
The URI '/contacts/{contactid}/sam', when coupled with Method Type 'GET', returns the Strategic Allocation Model related to a specific contact record.
https://api2.redtailtechnology.com/crm/v1/rest/contacts/{ContactID}/sam
https://api2.redtailtechnology.com/crm/v1/rest/contacts/384843/sam
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/sam"); 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.
Strategic Allocation Model Objectives Fetch
The URI '/contacts/{contactid}/sam', when coupled with Method Type 'GET', returns the Strategic Allocation Model related to a specific contact record.
https://api2.redtailtechnology.com/crm/v1/rest/settings/samobjectives
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/settings/samobjectives"); 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.
Strategic Allocation Model by ContactID PUT
With this method you can update the Strategic Allocation Model 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 the URI and supply the required fields in the request body.
https://api2.redtailtechnology.com/crm/v1/rest/contacts/{contactid}/sam
Horizon Types | |
S
|
Short-Term
|
I
|
Intermediate
|
L
|
Long-Term
|
Risk Tolerance Types | |
L
|
Low
|
M
|
Moderate
|
H
|
High
|
Request Header example (C#)
HttpWebRequest req = (HttpWebRequest)HttpWebRequest.Create("https://api2.redtailtechnology.com/crm/v1/rest/contacts/384843/sam");
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 = "{\"Experience_Funds\":13,\"Experience_Other\":1,\"Experience_Partnerships\":2,\"Experience_Stocks\":3,\"ObjectiveID\":6,\"Horizon\":"I",\"Tolerance\":"H"}"
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