Follow

Workflow Methods Draft

This article is under construction, with new methods to be added shortly....

 

Workflows_ByContactID_Fetch

Method Type: GET

returns a list of workflows associated with a contact.

'/contacts/{CONTACTID}/workflows?completed={COMPLETED}&page={PAGE}'

*completed- '0' = Not Completed | '1' = Completed| '2' = All

*page defaults to 1 if unstated. results are returned 50 records per page.

 

WorkflowTemplate_ByID_Fetch

Method Type: GET

returns a full Workflow Template by WorkflowID

'/workflows/templates/{TemplateID}'

 

WorkflowSteps_ByID_Fetch

Method Type: GET

returns the list of steps associated with a workflow template.

'/workflows/templates/{TemplateID}/steps'

 

 

Workflow_ByContactID_Put 

Method Type: PUT

CREATES and assigns a new Workflow instance.

'/contacts/{contactid}/workflow'

 

Workflow_CompleteCurrentStep_Put

Method Type: PUT

Updates a Workflow instance, completing the current step..

'/workflows/{workflowid}'

 

Workflow_UpdateAssignment_Put

Method Type: PUT

Updates a workflow instance's Owner and/or EndDate.

'/workflows/{workflowid}?duedate={EndDate}&owner={owner}

 

Workflows By ContactID Fetch

 The URI '/contacts/{CONTACTID}/workflows?completed={COMPLETED}&page={PAGE}', when paired with the Method Type 'GET',  returns a list of Workflows associated with a Contact. The Completed and Page parameters are optional and default to 0 and 1 respectively.*

*completed- '0' = Not Completed  | '1' = Completed | '2' = All

*page defaults to 1 if unstated. results are returned 50 records per page.

 

https://api2.redtailtechnology.com/crm/v1/rest/contacts/{CONTACTID}/workflows?completed={COMPLETED}&page={PAGE}

https://api2.redtailtechnology.com/crm/v1/rest/contacts/384843/workflows?completed=0&page=1

 

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/workflows?completed=0&page=1");
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.

1.png

 

WorkflowTemplate By ID Fetch

 The URI '/workflows/{WORKFLOWID}', when paired with the Method Type 'GET',  returns the workflow template associated by WorkFlowID.

https://api2.redtailtechnology.com/crm/v1/rest/workflows/templates/{TemplateID}

https://api2.redtailtechnology.com/crm/v1/rest/workflows/templates/508

 

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/workflows/templates/508");
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.

2.png

 

WorkflowTemplate Steps By WorkflowID Fetch

 The URI 'workflows/{WORKFLOWID}/steps', when paired with the Method Type 'GET',  returns the workflow template associated by WorkFlowID.

https://api2.redtailtechnology.com/crm/v1/rest/workflows/templates/{TemplateID}/steps

https://api2.redtailtechnology.com/crm/v1/rest/workflows/templates/508/steps

 

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/workflows/templates/508/steps");
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.

 

 

Workflow By ContactID Put

 The URI '/contacts/{contactid}/workflow', when coupled with Method Type 'PUT',  Creates and assigns a new work flow instance to a contact  record.

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

https://api2.redtailtechnology.com/crm/v1/rest/contacts/384843/workflow

 

Request Header example (C#)

HttpWebRequest req = (HttpWebRequest)HttpWebRequest.Create("https://api2.redtailtechnology.com/crm/v1/rest/contacts/384843/workflow");
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 = "{\"ClientID\":384843, \"EndDate\":\"\\/Date(1388476800000-0700)\\/\",\"StartDate\":\"\\/Date(1386921600000-0700)\\/\", \"GroupID\":102, \"RecID\":0, \"Owner\":41974, \"Note\":\"A Note would go here!\"}";
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());

 

Workflow CurrentStepComplete Put

 The URI '/workflows/{workflowid}', when coupled with Method Type 'PUT',  Updates a workflow instance, completing the current step.

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

https://api2.redtailtechnology.com/crm/v1/rest/contacts/384843/workflow

 

Request Header example (C#)

HttpWebRequest req = (HttpWebRequest)HttpWebRequest.Create("https://api2.redtailtechnology.com/crm/v1/rest/contacts/384843/workflow");
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 = "{\"ClientID\":384843, \"EndDate\":\"\\/Date(1388476800000-0700)\\/\",\"StartDate\":\"\\/Date(1386921600000-0700)\\/\", \"GroupID\":102, \"RecID\":0, \"Owner\":41974, \"Note\":\"A Note would go here!\", \"StepID\":297, \"ResultID\":361}";
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());

 

Workflow UpdateAssignment Put

 The URI '/workflows/{workflowid}', when coupled with Method Type 'PUT',  Updates a workflow instance's Owner and EndDate.

Both query string parameters are optional

https://api2.redtailtechnology.com/crm/v1/rest/contacts/{ContactID}/workflow?enddate={EndDate}&owner={Owner}

https://api2.redtailtechnology.com/crm/v1/rest/contacts/384843/workflow?enddate=2014-01-14&owner=41974

 

Request Header example (C#)

HttpWebRequest req = (HttpWebRequest)HttpWebRequest.Create("https://api2.redtailtechnology.com/crm/v1/rest/contacts/384843/workflow?enddate=2014-01-14&owner=41974");
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";

 

 

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

Comments

Powered by Zendesk