Help Center/Technical Resources/Web Services API

Documentation for Web Services API (Version 1.0)

Nicole Kujawski
posted this on November 17, 2010 11:27 AM

CollegiateLink Web Services API

 

Version 1 of the API is now deprecated and will cease functioning in the coming months. Migrate to version 2 today.

Version 2 CollegiateLink API is now available.  Please read through the version 2 documentation and contact your consultant to get connected.

 

Overview

CollegiateLink uses the REST method for serving up web services to external client information systems. 

Security

Our API security model, keeping with our theme of easy web service access, is simple and yet highly secure. The backbone of our security is HTTPS and private key phrases. All requests without exception are transmitted over HTTPS connections. Additionally, the authentication credentials are passed to us on every request inside the request headers which are authenticated before every request can be processed.

The authentication process is not the typical username/password scheme. Applications wishing to integrate with our API must send our servers the current time stamp (represented in UTC format), your API key, and a hash of the aforementioned values plus the shared secret key phrase and the IP address. This may seem like a lot at first glance, but this combination of values achieves many things:

  1. The password for your API account is never transmitted.
  2. API requests have a limited window of time to be processed, due to the time stamp in the request header and hash. In the unlikely event a hacker were to know which URLs your applications were calling, the time window in which that request will successfully be processed is limited to 30 seconds.
  3. Because we're using HTTPS connections, packet sniffing will not yield the URL or any aspect of the request in unencrypted form.
  4. The hash is made up of static and dynamic values which change on each request making it nearly impossible for brute force attacks to work.

One result of this configuration that must be noted is that it gives you the same permissions to see information as a system administrator.

A Normal API Call

All authentication and request specific parameters must be on the request URL.

NOTE: You must use the GET method when making API calls.

Authentication Parameters

These are the required parameters for each web service call in order to properly authenticate the request.

Parameter Name Description
apikey Your institution’s API key as provided by CollegiateLink.
time The current time represented in milliseconds (UTC).
Time must be synchronized with an international time server.
Ex. http://tycho.usno.navy.mil/cgi-bin/timer.pl.
random A standard, newly created GUID.
hash

An hash created using a cryptographic hash function.

NOTE:
string prehash = apiKey + ipAddress + time + random + sharedKey;

Standard Optional Parameters

These are the optional parameters that can be used with all web service calls.

NameDescriptionTypeDefault

page Which page of results to retrieve integer 1
pagesize  How many results to bring back for each call (Max 500) integer 100
modelformatting Specifies whether or not the response is formatted normal/humanreadable normal

Example URL

https://hostname.domain.extension/ws/organization/list?apikey=TestK...

Please note this is not a working example URL you can call. The "hostname.domain.extension" value must be replaced with your institution's actual CollegiateLink hostname and domain extension (e.g., sitename.institution.edu), as well must the "apikey" value be replaced with your assigned key.

Successful Response

All successful web service responses will have the structure of:

<clwebService>
  <results>
    <page>
      <items>
      ...
      </items>
      <pageSize>100</pageSize>
      <pagenumber>1</pagenumber>
      <totalItems>561</totalItems>
      <totalPages>6</totalPages>
    </page>
  </results>
</clwebService>


The contents of the service response will be encapsulated in the <results> element. There will be a <page> element that will contain a single page of results and all of the additional metadata needed to implement additional requests to get the complete results from the service endpoint.

Name Description
page.items Container for query results. For example, it would it would be an array of <organization> elements from the sample request above.
page.pageSize Returns the number of items requested on a page for the request.
page.pageNumber Return the current page number for the response
page.totalItems The total number of items that are returned by the query.  In the example above, the response will contain 100 of the total 561 items that met the criteria of the request.
page.totalPages This is total number of pages resulting from the query

Failed Request

All failed web services requests will return a response structure of:

<clwebService>
    <results>
        <error>
            <message>Details on what went wrong</message>
            <type>TYPE_OF_ERROR</type>
        </error>
  </results>
</clwebService>

The contents of the service response will be encapsulated in the <results> element. There will be a <error> element.

Error Codes

Name Description
AUTHENTICATION_ERROR Logn failed. See message for details
VALIDATION_ERROR Required parameter is missing or optional parameter contains invalid values
UNKNOWN_SERVICE The request is to an invalid service endpoint
GENERAL_ERROR An unhandled exception has occurred on our end. Please contact support for assistance

 


Actions


organization/list

Retrieves a list of all organizations regardless of status.

Example URL Call

https://hostname.domain.extension/ws/organization/list

Please note this is not a working example URL you can call. The "hostname.domain.extension" value must be replaced with your institution's actual CollegiateLink hostname and domain extension (e.g., sitename.institution.edu).

Optional Parameters

NameDescriptionTypeDefault

includeinactive Include inactive organizations in the returned list boolean false
includehidden Include hidden organizations in the returned list boolean false
category A specific category name to get organizations for string all categories
namecontains A string to search for in the organization name string none

Example Response

<clwebService>
     <results>
          <page>
               <items>
                    <organization>
                         <addresses>
                              <address>
                                   <city>Buffalo</city>
                                   <country> </country>
                                   <postalcode/>
                                   <state>NY</state>
                                   <street1>103 Campus Center</street1>
                                   <street2>Hometown University ATTN: Campus Radio</street2>
                                   <type>-1</type>
                              </address>
                         </addresses>
                         <categories>
                              <category>
                                   <id>1234</id>
                                   <ishidden>true</ishidden>
                                   <name>Media</name>
                              </category>
                         </categories>
                         <customfields/>
                         <description>
                              <p>This is a student-run campus radio station. Our goal is to expose the college and surrounding community to great new underground music. Our programming is separate from that of main stream rock radio to provide a variety of styles for every musical taste. In addition we hope to provide our members with the knowledge needed while working in a professional atmosphere whether it is a radio station or any other sort of business setting.</p>
                         </description>
                         <externalWebsiteUrl>http://studentlink.collegiatelink.net/radiostation</externalWebsiteUrl>
                         <id>12345</id>
                         <name>Radio Station</name>
                         <parentId>12340</parentId>
                         <shortName>Radio Station</shortName>
                         <siteUrl>http://studentlink.collegiatelink.net/organization/radiostation/</siteUrl>
                         <status>Active</status>
                         <type>Default</type>
                    </organization>
               </items>
               <pageNumber>1</pageNumber>
               <pageSize>100</pageSize>
               <totalItems>162</totalItems>
               <totalPages>2</totalPages>
          </page>
     </results>
</clwebService>

Response Details

XML Node & Attribute Name Description
items Will contain a list of all items returned from the query
organization Represents an organizational record with some basic details about it
organization.addresses Collection of addresses for the organization
organization.addresses.address The address of the organization
organization.addresses.address.city Organization's city
organization.addresses.address.country Organization's country
organization.addresses.address.postalcode Organization's postal/zip code
organization.addresses.address.state Organization's state/province
organization.addresses.address.street1 The first line of the street address of the organization
organization.addresses.address.street2 The second line of the street address of the organization
organization.addresses.address.type The address type
organization.categories Collection of categories that the organization is part of
organization.categories.category Category that the organization is part of
organization.categories.category.id Category ID
organization.categories.category.ishidden Is category visible to the public
organization.categories.category.name Category name
organization.customfields Collection of custom fields for the organization
organization.customfields.customfield Custom field for the organization
organization.description Custom field description
organization.externalwebsiteurl An external site the organization may be using
organization.id Organization ID
organization.name The full name
organization.parentid Organization ID of the parent organization
organization.shortname The short name (not all orgs have this specified)
organization.siteurl The URL of the organizations page on our site.
organization.status

NORMAL = The organization is shown on the website and is active

FROZEN = Disabled but not inaccessible

LOCKED = Disabled and inaccessible

INACTIVE = Disabled, inaccessible, and essentially archived

organization.type The type of the organization
pagenumber Which page of the results is returned

pagesize

How many organizations are returned in the current page

totalitems Total number of organizations identified by the query
totalpages Total number of pages of organizations identified by the query

organization/roster

Retrieves a list of all the members for the specified organization.

Example URL Call

https://hostname.domain.extension/ws/organization/roster

Please note this is not a working example URL you can call. The "hostname.domain.extension" value must be replaced with your institution's actual CollegiateLink hostname and domain extension (e.g., sitename.institution.edu).

Required Parameters

NameDescriptionType

id Organization ID to get roster for integer

Optional Parameters

NameDescriptionTypeDefault

currentonly Include only currently active members boolean false

Example Response

<clwebService>
<results>
<page>
<items>
<member>
<affiliation/>
<campusemail>sstudent@hometown.edu</campusemail>
<firstname>Sam</firstname>
<id>123456</id>
<lastname>Student</lastname>
<positions>
<position>
<enddate>-1</enddate>
<name>Member</name>
<startdate>1218412800000</startdate>
<userenddate>-1</userenddate>
<userstartdate>-1</userstartdate>
</position>
<position>
<enddate>1233014400000</enddate>
<name>Member</name>
<startdate>1218412800000</startdate>
<userenddate>1233014400000</userenddate>
<userstartdate>-1</userstartdate>
</position>
</positions>
<preferredemail/>
<username>user123</username>
</member>
               </items>
               <pageNumber>1</pageNumber>
               <pageSize>100</pageSize>
               <totalItems>1</totalItems>
               <totalPages>1</totalPages>
          </page>
     </results>
</clwebService>

Response Details

XML Node & Attribute Name Description
items Will contain a list of all items returned from the query
member Represents a member of an organization with some basic details about it
member.affiliation Collection of addresses for the organization
member.campusemail The email of the member
member.firstname First name of the member
member.id Member ID
member.lastname Last name of the member
member.positions Collection of positions that the member holds in the organization
member.positions.position Position that the member holds
member.positions.position.enddate Date that the position ended represented in milliseconds (UTC)
member.positions.position.name Name of the position
member.positions.position.startdate Date that the position started represented in milliseconds (UTC)
member.positions.position.userenddate Date that the member specified as a start date represented in milliseconds (UTC)
member.positions.position.userstartdate Date that the member specified as an end date represented in milliseconds (UTC)
member.position.positionTemplate Name of the template for the position
member.position.positionType Name of the type for the position
member.preferredemail An email address other than the campus email
member.username The campus username of the member
pagenumber Which page of the results is returned
pagesize How many items are returned in the current page
totalitems Total number of items identified by the query
totalpages Total number of pages of items identified by the query

user/memberships

Retrieves a list of the organizations that a user is a member of.

Example URL Call

https://hostname.domain.extension/ws/user/memberships

Please note this is not a working example URL you can call. The "hostname.domain.extension" value must be replaced with your institution's actual CollegiateLink hostname and domain extension (e.g., sitename.institution.edu).

Required Parameters

NameDescriptionType

id User ID to get memberships for integer

Optional Parameters

NameDescriptionTypeDefault

currentonly Include only the organizations that the user is currently active in boolean true

Example Response

<clwebService>
<results>
<page>
<items>
<membership>
<organizationDescription>
<p>The Social Justice League is a student run group on campus that aims to educate and promote social justice on a local, national, and international basis, through student action. We have focused our events in the past on issues such as homelessness, genocide, and fair trade, but we are always looking for new ideas from members!</p>
</organizationDescription>
<organizationId>12347</organizationId>
<organziationName>Social Justice League</organziationName>
<position>
<enddate>-1</enddate>
<name>Member</name>
<startdate>1251936000000</startdate>
<userenddate>-1</userenddate>
<userstartdate>1251936000000</userstartdate>
<positionTemplate>President</positionTemplate>
</position>
<user>
<campusemail>sstudent@hometown.edu</campusemail>
<firstname>Sam</firstname>
<id>123456</id>
<lastname>Student</lastname>
<preferredemail/>
<username>user123</username>
</user>
</membership>
               </items>
               <pageNumber>1</pageNumber>
               <pageSize>100</pageSize>
               <totalItems>1</totalItems>
               <totalPages>1</totalPages>
</page>
</results>
</clwebService>

Response Details

XML Node & Attribute Name Description
items Will contain a list of all items returned from the query
membership Represents an organization that a user is a member of
membership.organizationDescription Description of the organization
membership.organizationId Organization ID
membership.organizationName Name of the organization.
membership.position Position that the member holds in the organization
membership.position.enddate Date that the position ended represented in milliseconds (UTC)
membership.position.name Name of the position
membership.position.startdate Date that the position started represented in milliseconds (UTC)
membership.position.userenddate Date that the member specified as a start date represented in milliseconds (UTC)
membership.position.userstartdate Date that the member specified as an end date represented in milliseconds (UTC)
membership.position.positionTemplate Name of the template for the position
membership.position.positionType Name of the type for the position
membership.user.campusemail The email of the member
membership.user.firstname First name of the member
membership.user.id Member ID
membership.user.lastname Last name of the member
membership.user.preferredemail An email address other than the campus email
membership.user.username The campus username of the member
pagenumber Which page of the results is returned
pagesize How many items are returned in the current page
totalitems Total number of items identified by the query
totalpages Total number of pages of items identified by the query

user/position

Retrieves a list of the user who occupy a position based on a position template in the various organizations.

Example URL Call

https://hostname.domain.extension/ws/user/position

Please note this is not a working example URL you can call. The "hostname.domain.extension" value must be replaced with your institution's actual CollegiateLink hostname and domain extension (e.g., sitename.institution.edu).

Required Parameters

NameDescriptionType

name Name of the position template string

Optional Parameters

NameDescriptionTypeDefault

currentonly Include only the positions that the user is currently active in boolean true

Example Response

<clwebService>
<results>
<page>
<items>
<membership>
<organizationDescription>
<p>The Social Justice League is a student run group on campus that aims to educate and promote social justice on a local, national, and international basis, through student action. We have focused our events in the past on issues such as homelessness, genocide, and fair trade, but we are always looking for new ideas from members!</p>
</organizationDescription>
<organizationId>12347</organizationId>
<organziationName>Social Justice League</organziationName>
<position>
<enddate>-1</enddate>
<name>Member</name>
<startdate>1251936000000</startdate>
<userenddate>-1</userenddate>
<userstartdate>1251936000000</userstartdate>
<positionTemplate>President</positionTemplate>
</position>
<user>
<campusemail>sstudent@hometown.edu</campusemail>
<firstname>Sam</firstname>
<id>123456</id>
<lastname>Student</lastname>
<preferredemail/>
<username>user123</username>
</user>
</membership>
               </items>
               <pageNumber>1</pageNumber>
               <pageSize>100</pageSize>
               <totalItems>1</totalItems>
               <totalPages>1</totalPages>
</page>
</results>
</clwebService>

Response Details

XML Node & Attribute Name Description
items Will contain a list of all items returned from the query
membership Represents an organization that a user is a member of
membership.organizationDescription Description of the organization
membership.organizationId Organization ID
membership.organizationName Name of the organization.
membership.position Position that the member holds in the organization
membership.position.enddate Date that the position ended represented in milliseconds (UTC)
membership.position.name Name of the position
membership.position.startdate Date that the position started represented in milliseconds (UTC)
membership.position.userenddate Date that the member specified as a start date represented in milliseconds (UTC)
membership.position.userstartdate Date that the member specified as an end date represented in milliseconds (UTC)
membership.position.positionTemplate Name of the template for the position
membership.position.positionType Name of the type for the position
membership.user.campusemail The email of the member
membership.user.firstname First name of the member
membership.user.id Member ID
membership.user.lastname Last name of the member
membership.user.preferredemail An email address other than the campus email
membership.user.username The campus username of the member
pagenumber Which page of the results is returned
pagesize How many items are returned in the current page
totalitems Total number of items identified by the query
totalpages Total number of pages of items identified by the query

event/list

Retrieves a list of events in a given date range.

Example URL Call

https://hostname.domain.extension/ws/event/list

Please note this is not a working example URL you can call. The "hostname.domain.extension" value must be replaced with your institution's actual CollegiateLink hostname and domain extension (e.g., sitename.institution.edu).

Required Parameters

NameDescriptionType

startdate Minimum date that returned events will occur represented in milliseconds (UTC) long
enddate Maximum date that returned events will occur represented in milliseconds (UTC) long

Optional Parameters

NameDescriptionTypeDefault

currentonly Include only the events that are currently active boolean true

Example Response

<clwebService>
<results>
<page>
<items>
<event>
<categories>
<category>
<id>41</id>
<ishidden>false</ishidden>
<name>Event Category</name>
</category>
</categories> <customfield> <name>Custom Question Text</name>
<values>
<string>Custom Answer One</string>
<string>Custom Answer Two</string>
</values>
</customfield>
<description>
<p>Planning of any summer riding at Haskins, any summer fundraisers, and the year-end trail ride. And last, but certainly not least, a chance to say goodbye to our seniors.</p>
</description>
<endDate>1290532500000</endDate>
<id>23456</id>
<location>30 Smith Street, Buffalo, New York 14201</location>
<name>End of the Year Club Meeting</name>
<organization>
<addresses>
<address>
<city>Buffalo</city>
<country> </country>
<postalcode>14201</postalcode>
<state>NY</state>
<street1>30 Smith St</street1>
<street2>Haskins Farm</street2>
<type>-1</type>
</address>
</addresses>
<categories>
<category>
<id>1235</id>
<ishidden>true</ishidden>
<name>Club Sports</name>
</category>
</categories>
<customfields/>
<description>
<p>The <b><u>Equestrian Club</u></b> is comprised of a group of students dedicated to the sport of horseback riding. Members have the option to compete against other colleges in Hunt Seat and Dressage divisions or can just take regular riding lessons with the coach of the team.</p>
</description>
<externalWebsiteUrl>http://www.haskinsfarm.net</externalWebsiteUrl>
<id>12347</id>
<name>Equestrian Club </name>
<parentId>12340</parentId>
<shortName>Equestrian</shortName>
<siteUrl>http://studentlink.collegiatelink.net/organization/equestrianclub/</siteUrl>
<status>Active</status>
<type>Default</type>
</organization>
<startDate>1290528900000</startDate>
<status>Approved</status>
<urlLarge/>
<urlSmall/>
</event>
</items>
               <pageNumber>1</pageNumber>
               <pageSize>100</pageSize>
               <totalItems>1</totalItems>
               <totalPages>1</totalPages>
</page>
</results>
</clwebService>

Response Details

XML Node & Attribute Name Description
items Will contain a list of all items returned from the query
event Represents an event in the organization
event.customfields A collection of the custom fields and values for the event
event.categories A collection of the categories an event is part of
event.categories.category A category that the event is part of
event.description Description of the event
event.enddate Date the event ends represented in milliseconds (UTC)
event.id ID of the event
event.location Location of the event
event.name Name of the event
event.organization The organization that has the event
event.organization.addresses A collection of addresses for the organization
event.organization.addresses.address An address for the organization
event.organization.addresses.address.city Organization's city
event.organization.addresses.address.country Organization's country
event.organization.addresses.address.postalcode Organization's post/zip code
event.organization.addresses.address.state Organization's state
event.organization.addresses.address.street1 The first line of the street address of the organization
event.organization.addresses.address.street2 The second line of the street address of the organization
event.organization.addresses.address.type The address type
event.organization.categories A collection of the categories that the organization is part of
event.organization.categories.category A category that the organization is part of
event.organization.categories.category.id The ID of the category
event.organization.categories.category.ishidden Whether the category is hidden or not
event.organization.categories.category.name The name of the category
event.organization.customfields A collection of the custom fields and values for the organization
event.organization.description Description of the organization
event.organization.externalwebsiteurl The external website address of the organization
event.organization.id The ID of the organization
event.organization.name The name of the organization
event.organization.parentid The ID of the parent organization if available
event.organization.shortname The short name of the organization
event.organization.siteurl The address of the organization's web site
event.organization.status The status of the organization
event.organization.type The type of the organization
event.startdate The start date of the event represented in milliseconds (UTC)
event.status The status of the event
event.urllarge The address of the large thumbnail for the flyer
event.urlsmall The address of the small thumbnail for the flyer

 


Example API Request (C#)

This is a .NET 3.5+ Windows Console Application that will call the default Organization List service, and print all pages of organizations to the console window

using System;
using System.Collections.Specialized;
using System.IO;
using System.Net;
using System.Net.Security;
using System.Security.Cryptography;
using System.Security.Cryptography.X509Certificates;
using System.Text;
using System.Xml;

namespace Collegiatelink.WebService.ConsoleApplication
{
    class Program
    {
        /// <summary>
        /// Example Windows console application to access the CollegiateLink Web Service API.
        /// </summary>
        static void Main()
        {
            int page = 1;
            int totalPages;
            do
            {
NameValueCollection parameters = new NameValueCollection();
parameters.Add("page",page.ToString());              

/// Note that "localhost" below will be your institutions' CollegiateLink host address
string url = BuildRequestUrl("localhost", "ws/organization/list", BuildQueryString(parameters));
WebRequest request = WebRequest.Create(url); 
try
                { 
WebResponse response = request.GetResponse();
if (response == null)
    throw new Exception("Null response recieved on request."); 

Stream responseStream = response.GetResponseStream();

  XmlDocument responseDocument = ReadResponse(responseStream);

totalPages = ProcessDocument(responseDocument);
                  
Console.Write(responseDocument.OuterXml); 
Console.ReadLine();
  }
catch (Exception ex)
  {   
Console.WriteLine(ex.Message); 
Console.ReadLine(); 
break;
  }              
page++;
      } while (page <= totalPages);
}

        /// <summary>
        /// Create validate Url from Base service path and querystring
        /// </summary>
        /// <param>your site name <example>schoolname.collegiatelink.net</example></param>
        /// <param>the complete path to service endpoint<example>ws/organization/list</example></param>
        /// <param>the querystring, including all required and optional parameters for request</param>
        /// <returns>complete url for service request</returns>
        private static string BuildRequestUrl(string hostName, string commandPath, string queryString)
        {
            UriBuilder builder = new UriBuilder("https", hostName)
            {
               Path = commandPath,
               Query = queryString          
};
            return builder.Uri.AbsoluteUri;
        }

        /// <summary>
        /// Builds base authentication query string and appends any optional parameters
        /// </summary>
        /// <param>a collection of key/value pairs that will be appended to base authentication query string</param>
        /// <returns>complete query string</returns>
        private static string BuildQueryString(NameValueCollection additionalParameters)
        {
            //The ApiKey is the username the assigned during setup
            const string apiKey = "testkey";

            //The external IP Address that the CollegiateLink web services API will see when it resovles the client IP Adress of the request
            const string ipAddress = "192.168.11.145";

            //This is the password, that is matched with the Apiky and IP Address 
            const string sharedKey = "c0306f9091fb4f549c6385a3fccb4949";

            //Just an easy way to create something unique in the request
            Guid random = Guid.NewGuid();
            string time = GetTotalMilliseconds();

            //combine all the elements in correct order so that we can create md5 hash
            string prehash = apiKey + ipAddress + time + random + sharedKey;
            string hash = HashString(prehash);

            StringBuilder queryBuilder = new StringBuilder();
            queryBuilder.AppendFormat("apikey={0}&random={1}&time={2}&hash={3}", apiKey, random, time, hash);
            if (additionalParameters != null)
            {
               foreach (string key in additionalParameters.AllKeys)
               {
                   queryBuilder.AppendFormat("&{0}={1}", key, additionalParameters[key]);               }
            }
            return queryBuilder.ToString();
        }
 
        /// <summary>
        /// Converts web response to an Xml Document
        /// </summary>
        /// <param>the web response stream</param>
        /// <returns>The response to service request as Xml Document</returns>
        private static XmlDocument ReadResponse(Stream responseStream)
        {
            if (responseStream == null || !responseStream.CanRead)
               throw new Exception("Unable to Read response.");

            XmlDocument document = new XmlDocument();
            using (StreamReader reader = new StreamReader(responseStream))
            {
               document.LoadXml(reader.ReadToEnd());
            }
            return document;
        }

        /// <summary>
        /// Checks for Error in response document, if no error gets the totalpages to allow us to request all pages of this query
        /// </summary>
        /// <param>The response as an Xml Document</param>
        /// <returns>total pages of results available for this query</returns>
        private static int ProcessDocument(XmlDocument responseDocument)
        {
            if (responseDocument.DocumentElement == null)              
throw new Exception("Invalid Response received.");

            XmlNode error = responseDocument.DocumentElement.SelectSingleNode("result/error");
            if (error != null)
               throw new Exception(error.OuterXml);

            XmlNode totalPagesNode = responseDocument.DocumentElement.SelectSingleNode("results/page/totalPages");
            int totalPages;

            return int.TryParse(totalPagesNode.InnerXml, out totalPages) ? totalPages : 0;
        }

        /// <summary>
        /// Gets valid timestamp.
        /// </summary>
        /// <returns>The number of miliseconds since 1/1/1970</returns>
        private static string GetTotalMilliseconds()
        {
            var baseDate = DateTime.Parse("1/1/1970");
            var span = DateTime.UtcNow.Subtract(baseDate);
            return ((long)span.TotalMilliseconds).ToString();
        }
 
        /// <summary>
        /// Creates required Authentication MD5 Hash
        /// </summary>
        /// <param>the string to be hashed</param>
        /// <returns>a string respresentation of the MD5 hash</returns>
        private static string HashString(string input)
        {
            MD5 md5Hasher = MD5.Create();
            byte[] byteHash = md5Hasher.ComputeHash(Encoding.Default.GetBytes(input));
 
            StringBuilder hashBuilder = new StringBuilder();
 
            foreach (byte b in byteHash)
            {
               hashBuilder.Append(b.ToString("x2"));
            }
 
            return hashBuilder.ToString();
        } 
    }
}

<clwebService>

<results>

                <page>

<items>

<member>

<affiliation/>

<campusemail>bjones@bridgew.edu</campusemail>

<firstname>Brian</firstname>

<id>251706</id>

<lastname>Jones</lastname>

<positions>

<position>

<enddate>-1</enddate>

<name>Member</name>

<startdate>1218412800000</startdate>

<userenddate>-1</userenddate>

<userstartdate>-1</userstartdate>

</position>

<position>

<enddate>1233014400000</enddate>

<name>Member</name>

<startdate>1218412800000</startdate>

<userenddate>1233014400000</userenddate>

<userstartdate>-1</userstartdate>

</position>

</positions>

<preferredemail/>

</member>

 

Comments

User photo
Candy Hamblin
Rollins College

This code worked beautifully.  In order to save the xml document to my machine, I added these 2 lines of code:

document.PreserveWhitespace =true;

document.Save("C:/data.xml");

directly underneath the existing code:

document.LoadXml(reader.ReadToEnd());

Thanks!

 

January 30, 2012 03:15 PM
User photo
Dan Rossiter
University of Texas at San Antonio

Does the API make documents uploaded for a given organization available? I'm not seeing anything in the above writeup, but it would be very useful for our current project to be able to retrieve all documents.

September 02, 2012 06:47 PM
User photo
Dan Rossiter
University of Texas at San Antonio

"One result of this configuration that must be noted is that there's no role-based security to the web service API. This API gives you the same permissions to see information as a system administrator."

This is a significant limitation. Being able to query only a specific organization would be invaluable for individual organizations.

September 05, 2012 06:14 PM
User photo
Colin Knapp
University of Rochester

Here is a sample source of a PHP implementation of connecting to and pulling data from the API: http://pastebin.com/ViS0wFrQ

Enjoy! 

October 22, 2012 10:13 AM
User photo
Tom Dooner
Case Western Reserve University

For any Ruby folks out there, I'm working on a Ruby client library that is really nice. It takes care of all the XML parsing headaches and gives you back objects.

https://rubygems.org/gems/CollegiateLink

Feel free to reach out to me (email is in the README) if you're using this and run into problems.

November 13, 2012 09:52 PM
User photo
Colin Knapp
University of Rochester

@Dan - The best way to do this is to force your users to log in and restrict them to only retrieving specific data. E.g. your own login type system.

November 19, 2012 01:34 PM
User photo
Thomas DeMeo
Rochester Institute of Technology

I am interested in being able to POST data, in particular to track attendance for events.  If there was an API to POST names and IDs as well as a specific event number/code that would be excellent.  Is anything like this in the works currently? If not could you provide any insight into why not or if others have requested this functionality?

 

Thanks!

January 17, 2013 01:17 AM
User photo
Colin Knapp
University of Rochester

Wanted to note that the link I posted with PHP code is now outdated (and doesn't work well). So I have been re-writing it and can give you this link: http://pastebin.com/uhXkEF6A instead. I was asked by another programmer about it today and felt like I should post an update if it's getting used!

This is the 2nd version of the code I have developed. This is much faster and will parse "organization" and "member" XML's into properly formed arrays.

Enjoy!

June 14, 2013 04:47 PM