The methods available for Activities are exposed under their respective URI's, which are described below.
If you are using the Activities by ActivityID PUT method, you will need to designate the TypeID as follows.
Activity Types(Default) | |
TypeID |
Type
|
1
|
Task
|
2
|
Appointment
|
3
|
Phone Call
|
4
|
Unassigned
|
These are just the default values. A database owner can create new types to use alongside the default values. To return a list of Activity Types that include the list of custom types, please see the Activity Type List Fetch method.
Method Type: GET
returns a paged list of Activities associated with a specific User
'/calendar/{userid}?startdate={StartDate}&enddate={EndDate}&page={Page}'
page = {#} equivalent to page #. non-supplied= page 1
startdate = 'MM-DD-YYYY' format. ex: January 1st, 2012 is '01-01-2012'
enddate= 'MM-DD-YYYY' format. ex: January 31st, 2012 is '01312012'
Activities by User Fetch (Basic)
Method Type: GET
returns a simplified paged list of Activities associated with a specific User
'/calendar/{userid}/basic?startdate={StartDate}&enddate={EndDate}&page={Page}'
page = {#} equivalent to page #. non-supplied= page 1
startdate = 'MM-DD-YYYY' format. ex: January 1st, 2012 is '01-01-2012'
enddate= 'MM-DD-YYYY' format. ex: February 15th, 2012 is '02-15-2012'
Activities by ActivityID Fetch
Method Type: GET
returns an Activity record by ActivityID
'/calendar/activities/{activityid}'
Method Type: PUT
creates or updates an Activity record
'/calendar/activities/{activityid}'
Method Type: PUT
updates an activity record as completed by ActivityID
'/calendar/activities/{activityid}/complete'
Method Type: GET
retrieves a list of recently added activity records
'/calendar/activities/recent?startdate={stardate}&page={page}'
page = {#} equivalent to page #. non-supplied= page 1
startdate = 'MM-DD-YYYY' format. ex: January 1st, 2012 is '01-01-2012'
Activities by User Fetch
The URI '/calendar/{userid}', when coupled with Method Type 'GET', returns a paged list of activities for a particular user between a specified startdate and enddate.
The startdate and enddate date format follows 'MM-DD-YYYY' format. ie: January 15 2012 is '01-15-2012'
https://api2.redtailtechnology.com/crm/v1/rest/calendar/{userid}?page={page}&startdate={startdate}&enddate={endddate}
example: https://api2.redtailtechnology.com/crm/v1/rest/calendar/41974?starddate=01-01-2012&enddate=05-01-2012&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/calendar/41974?starddate=01012012&enddate=05012012&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());
Activities by User Fetch (Basic)
The URI '/calendar/{userid}', when coupled with Method Type 'GET', returns a paged list of simplified activities for a particular user between a specified startdate and enddate.
The startdate and enddate date format follows 'MM-DD-YYYY' format. ie: January 15 2012 is '01-15-2012'
https://api2.redtailtechnology.com/crm/v1/rest/calendar/{userid}/basic?page={page}&startdate={startdate}&enddate={endddate}
example: https://api2.redtailtechnology.com/crm/v1/rest/calendar/41974/basic?starddate=01-01-2012&enddate=05-01-2012&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/calendar/41974"); 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());
Activities by ActivityID Fetch
The URI '/calendar/activities/{activityid}', when coupled with Method Type 'GET', returns a detailed activity record by the specified ActivityID.
https://api2.redtailtechnology.com/crm/v1/rest/calendar/activities/{activityid}
example: https://api2.redtailtechnology.com/crm/v1/rest/calendar/activies/{activityid}
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/calendar/41974"); 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());
Activity by ActivityID PUT
The URI '/calendar/activities/{activityid}', when coupled with Method Type 'PUT', Creates or Updates an Activity record by ActivityID. To create a new Activity Record, the ActivityID supplied in the URI should be 0. To Update an existing Activity, you will need to provide the unique identifier for the Activity record, the ActivityID. Note: The subject field has an 80 character limit.
https://api2.redtailtechnology.com/crm/v1/rest/calendar/activities/{activityid}
example: https://api2.redtailtechnology.com/crm/v1/rest/calendar/activities/0
Request Header example (C#)
HttpWebRequest req = (HttpWebRequest)HttpWebRequest.Create("https://api2.redtailtechnology.com/crm/v1/rest/calendar/activities/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 = "{""AccountID"":471604,""ActivityOwnerID"":41974,""ClientID"":384843,""CategoryID"":2,""EndDate"":""\/Date(1330880400000-0800)\/"",""Importance"":0,""Note"":""Test 1234567"",""PercentDone"":25,""Priority"":2,""Reminder"":false,""ReminderDate"":""\/Date(-62135568000000-0800)\/"",""RepeatParent"":4709555,""Repeat_EndDate"":""\/Date(-62135568000000-0800)\/"",""StartDate"":""\/Date(1330876800000-0800)\/"",""Subject"":""Set New Client up"",""TypeID"":2}";
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());
Activity Mark Complete PUT
The URI '/calendar/activities/{activityid}/complete', when coupled with Method Type 'PUT', Marks an Activity Record as Completed. The ActivityID is the unique identifier for the activity record and can be found in the Activity GET responses listed as 'RecID'.
https://api2.redtailtechnology.com/crm/v1/rest/calendar/activities/{activityid}/complete
example: https://api2.redtailtechnology.com/crm/v1/rest/calendar/activities/5170569/complete
Request Header example (C#)
HttpWebRequest req = (HttpWebRequest)HttpWebRequest.Create("https://api2.redtailtechnology.com/crm/v1/rest/calendar/activities/5170569/complete");
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#)
//Response stream.
HttpWebResponse resp = (HttpWebResponse)req.GetResponse();
System.IO.StreamReader sr = new System.IO.StreamReader(resp.GetResponseStream());
Recently Added Activities GET
The URI '/calendar/activities/recent', when coupled with Method Type 'GET', returns a paged list of recently added activities for a particular user backdating to the specified startdate.
The startdate format follows 'MM-DD-YYYY' format. ie: January 15 2012 is '01-15-2012'
https://api2.redtailtechnology.com/crm/v1/rest/calendar/activities/recent?page={page}&startdate={startdate}
example: https://api2.redtailtechnology.com/crm/v1/rest/calendar/activities/recent?starddate=01-01-2012&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/calendar/activities/recent?starddate=01-01-2012&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());
Comments