Terra Dotta Software API Documentation
Back to Terra Dotta Software API Documentation Return to Public Site
Top
Top
Using our original call:
(the following XML packet is formatted for readability)
We can modify the call to return the data in SOAP format by specifying
(the following XML packet is formatted for readability)
We can modify the call to return the data in JSON format by specifying
(the following JSON packet is formatted for readability)
The data returned using JSON encoding is wrapped within the callback function,
Example 1: Following is an example of using ColdFusion to call the API and returning the data in a SOAP envelope:
Run Example 1 Top
(if your installation does not have any data, this example will not return anything)
Back to Terra Dotta Software API Documentation Top
getProgramDeadlines
Returns a list of all available locations or locations specific to a program.URL
http://{site root}/piapi/index.cfm?callName=getProgramDeadlines
The value for {site root} would represent your installation URL. The values returned from this function are in the following table.
- Table 1: Input arguments for getProgramDeadlines
- Table 2: Return values for getProgramDeadlines
- Example 1: Calling getProgramDeadlines with ColdFusion
Top
Standard Input Parameters (jump to call specific input arguments) | |||
---|---|---|---|
Argument | Type | Required | Meaning |
ResponseEncoding | String | Optional | The data format to be returned by the API call. The value for ResponseEncoding can be one of the following values:
(case insensitive) |
CallBack | Boolean | Optional | Used with JSON only to specify if a callback function will be used or not. |
CallBackName | String | Optional | Used with JSON only to specify the callback function to use. |
Call-specific Input Parameters (jump to standard input arguments) | |||
Argument | Type | Required | Meaning |
program_id | Integer | Required | Program ID for which to gather deadlines for |
ReturnType (internal call) |
String | Optional | Specifies the Return type of the function.
(case insensitive) This is only used in the internal call to api_getProgramDeadlines() . For URL (RESTful) and SOAP calls, this is unnecessary and does nothing. This argument is only used from calls made from within ColdFusion.
|
DefaultQuerySort (internal call) |
Date | Optional | By default, it sorts the query results based on application deadline.
(case insensitive) This is only used in the internal call to api_getProgramDeadlines() . For URL (RESTful) and SOAP calls, this is unnecessary and does nothing. This argument is only used from calls made from within ColdFusion.
|
GracePeriodInDay (internal call) |
Integer | Optional | This is the number of days to allow, after the deadline has expired. This is only used in the internal call to api_getProgramDeadlines() . For URL (RESTful) and SOAP calls, this is unnecessary and does nothing. This argument is only used from calls made from within ColdFusion. |
Top
Return Value | Type | Meaning |
---|---|---|
app_deadline | Date | Global term deadline date. |
override | Date | Program-specific term deadline date override. |
app_decision | Date | Global term decision date |
override2 | Date | Program-specific term decision date override. |
app_term | String | Term name. |
app_term_year | String |
Full term and year, concatenated by a pipe character, as in: APP YEAR|APP TERM
|
app_year | String | Term numeric year, represented as YYYY. |
bdualyearterm | Boolean | Whether or not it's a dual-year term. 1 is yes, 0 or NULL is no. |
term_end | Date | Program term end date |
term_start | Date | Program term start date |
program_term_date_info | String | Program term notes. |
benabledatenotes | Boolean | Whether or not the program term notes are visible to applicants on the program brochure page. 1 is yes, 0 or NULL is no. |
Using our original call:
http://{site root}/piapi/index.cfm?callName=getProgramDeadlines&ResponseEncoding=xml&Program_ID=10001
We would receive a packet of data in XML format (the default), that might resemble the following:
(the following XML packet is formatted for readability)
<deadlines>
<recordcount>2</recordcount>
<deadline>
<app_deadline>2010-11-15 00:00:00.0</app_deadline>
<app_decision>2010-10-30 00:00:00.0</app_decision>
<app_term>Spring</app_term>
<app_term_year>Spring|2011</app_term_year>
<app_year>2011</app_year>
<bdualyearterm></bdualyearterm>
<benabledatenotes></benabledatenotes>
<override>2010-11-15 00:00:00.0</override>
<override2>2010-10-30 00:00:00.0</override2>
<program_term_date_info></program_term_date_info>
<term_end></term_end>
<term_start></term_start>
</deadline>
<deadline>
<app_deadline>2011-05-15 00:00:00.0</app_deadline>
<app_decision>2011-05-30 00:00:00.0</app_decision>
<app_term>Academic Year</app_term>
<app_term_year>Academic Year|2011</app_term_year>
<app_year>2011</app_year>
<bdualyearterm>1</bdualyearterm>
<benabledatenotes></benabledatenotes>
<override>2011-05-15 00:00:00.0</override>
<override2>2011-05-30 00:00:00.0</override2>
<program_term_date_info></program_term_date_info>
<term_end></term_end>
<term_start></term_start>
</deadline>
</deadlines>
<recordcount>2</recordcount>
<deadline>
<app_deadline>2010-11-15 00:00:00.0</app_deadline>
<app_decision>2010-10-30 00:00:00.0</app_decision>
<app_term>Spring</app_term>
<app_term_year>Spring|2011</app_term_year>
<app_year>2011</app_year>
<bdualyearterm></bdualyearterm>
<benabledatenotes></benabledatenotes>
<override>2010-11-15 00:00:00.0</override>
<override2>2010-10-30 00:00:00.0</override2>
<program_term_date_info></program_term_date_info>
<term_end></term_end>
<term_start></term_start>
</deadline>
<deadline>
<app_deadline>2011-05-15 00:00:00.0</app_deadline>
<app_decision>2011-05-30 00:00:00.0</app_decision>
<app_term>Academic Year</app_term>
<app_term_year>Academic Year|2011</app_term_year>
<app_year>2011</app_year>
<bdualyearterm>1</bdualyearterm>
<benabledatenotes></benabledatenotes>
<override>2011-05-15 00:00:00.0</override>
<override2>2011-05-30 00:00:00.0</override2>
<program_term_date_info></program_term_date_info>
<term_end></term_end>
<term_start></term_start>
</deadline>
</deadlines>
We can modify the call to return the data in SOAP format by specifying
ResponseEncoding=SOAP
:
http://{site root}/piapi/index.cfm?callName=getProgramDeadlines&ResponseEncoding=SOAP&Program_ID=10001
We would receive a packet of XML wrapped within a SOAP envelope that might resemble the following:
(the following XML packet is formatted for readability)
<soapenv:Envelope
xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/"
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<soapenv:Body>
<deadlines>
<recordcount>2</recordcount>
<deadline>
<app_deadline>2010-11-15 00:00:00.0</app_deadline>
<app_decision>2010-10-30 00:00:00.0</app_decision>
<app_term>Spring</app_term>
<app_term_year>Spring|2011</app_term_year>
<app_year>2011</app_year>
<bdualyearterm></bdualyearterm>
<benabledatenotes></benabledatenotes>
<override>2010-11-15 00:00:00.0</override>
<override2>2010-10-30 00:00:00.0</override2>
<program_term_date_info></program_term_date_info>
<term_end></term_end>
<term_start></term_start>
</deadline>
<deadline>
<app_deadline>2011-05-15 00:00:00.0</app_deadline>
<app_decision>2011-05-30 00:00:00.0</app_decision>
<app_term>Academic Year</app_term>
<app_term_year>Academic Year|2011</app_term_year>
<app_year>2011</app_year>
<bdualyearterm>1</bdualyearterm>
<benabledatenotes></benabledatenotes>
<override>2011-05-15 00:00:00.0</override>
<override2>2011-05-30 00:00:00.0</override2>
<program_term_date_info></program_term_date_info>
<term_end></term_end>
<term_start></term_start>
</deadline>
</deadlines>
</soapenv:Body>
</soapenv:Envelope>
xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/"
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<soapenv:Body>
<deadlines>
<recordcount>2</recordcount>
<deadline>
<app_deadline>2010-11-15 00:00:00.0</app_deadline>
<app_decision>2010-10-30 00:00:00.0</app_decision>
<app_term>Spring</app_term>
<app_term_year>Spring|2011</app_term_year>
<app_year>2011</app_year>
<bdualyearterm></bdualyearterm>
<benabledatenotes></benabledatenotes>
<override>2010-11-15 00:00:00.0</override>
<override2>2010-10-30 00:00:00.0</override2>
<program_term_date_info></program_term_date_info>
<term_end></term_end>
<term_start></term_start>
</deadline>
<deadline>
<app_deadline>2011-05-15 00:00:00.0</app_deadline>
<app_decision>2011-05-30 00:00:00.0</app_decision>
<app_term>Academic Year</app_term>
<app_term_year>Academic Year|2011</app_term_year>
<app_year>2011</app_year>
<bdualyearterm>1</bdualyearterm>
<benabledatenotes></benabledatenotes>
<override>2011-05-15 00:00:00.0</override>
<override2>2011-05-30 00:00:00.0</override2>
<program_term_date_info></program_term_date_info>
<term_end></term_end>
<term_start></term_start>
</deadline>
</deadlines>
</soapenv:Body>
</soapenv:Envelope>
We can modify the call to return the data in JSON format by specifying
ResponseEncoding=JSON
:
http://{site root}/piapi/index.cfm?callName=getProgramDeadlines&ResponseEncoding=JSON&Program_ID=10001
We would receive a JSON-encoded packet:
(the following JSON packet is formatted for readability)
_cb_getProgramDeadlines(
{
"recordcount":4,
"columnlist":"app_deadline,app_decision,app_term,app_term_year,app_year,bdualyearterm,benabledatenotes,override,override2,program_term_date_info,term_end,term_start",
"data":{
"app_deadline":[
"2010-11-15 00:00:00.0",
"2011-05-15 00:00:00.0",
"2011-05-15 00:00:00.0",
"2012-05-15 00:00:00.0"
],
"app_decision":[
"2010-10-30 00:00:00.0",
"2011-05-30 00:00:00.0",
"2011-05-30 00:00:00.0",
"2012-06-16 00:00:00.0"
],
"app_term":[
"Spring",
"Academic Year",
"Fall",
"Fall"
],
"app_term_year":[
"Spring|2011",
"Academic Year|2011",
"Fall|2011",
"Fall|2012"
],
"app_year":[
2011,
2011,
2011,
2012
],
"bdualyearterm":[
"",
1,
"",
""
],
"benabledatenotes":[
"",
"",
"",
""
],
"override":[
"2010-11-15 00:00:00.0",
"2011-05-15 00:00:00.0",
"2011-05-15 00:00:00.0",
"2012-05-15 00:00:00.0"
],
"override2":[
"2010-10-30 00:00:00.0",
"2011-05-30 00:00:00.0",
"2011-05-30 00:00:00.0",
"2012-06-16 00:00:00.0"
],
"program_term_date_info":[
"",
"",
"",
""
],
"term_end":[
"",
"",
"",
""
],
"term_start":[
"",
"",
"",
""
]
}
}
);
{
"recordcount":4,
"columnlist":"app_deadline,app_decision,app_term,app_term_year,app_year,bdualyearterm,benabledatenotes,override,override2,program_term_date_info,term_end,term_start",
"data":{
"app_deadline":[
"2010-11-15 00:00:00.0",
"2011-05-15 00:00:00.0",
"2011-05-15 00:00:00.0",
"2012-05-15 00:00:00.0"
],
"app_decision":[
"2010-10-30 00:00:00.0",
"2011-05-30 00:00:00.0",
"2011-05-30 00:00:00.0",
"2012-06-16 00:00:00.0"
],
"app_term":[
"Spring",
"Academic Year",
"Fall",
"Fall"
],
"app_term_year":[
"Spring|2011",
"Academic Year|2011",
"Fall|2011",
"Fall|2012"
],
"app_year":[
2011,
2011,
2011,
2012
],
"bdualyearterm":[
"",
1,
"",
""
],
"benabledatenotes":[
"",
"",
"",
""
],
"override":[
"2010-11-15 00:00:00.0",
"2011-05-15 00:00:00.0",
"2011-05-15 00:00:00.0",
"2012-05-15 00:00:00.0"
],
"override2":[
"2010-10-30 00:00:00.0",
"2011-05-30 00:00:00.0",
"2011-05-30 00:00:00.0",
"2012-06-16 00:00:00.0"
],
"program_term_date_info":[
"",
"",
"",
""
],
"term_end":[
"",
"",
"",
""
],
"term_start":[
"",
"",
"",
""
]
}
}
);
The data returned using JSON encoding is wrapped within the callback function,
_cb_getProgramDeadlines()
.
By default, all JSON calls are returned within a callback wrapper function in form of:
_cb_callName()
Where callName
represents the name of the function you originally called.
To override this, you can specify the callBackName
argument, as in:
http://{site root}/piapi/index.cfm?callName=getProgramDeadlines&Program_ID=10001&ResponseEncoding=JSON&callBackName=MyCallBackFunction
This call would return the JSON packet wrapped within the callback function, MyCallBackFunction
, as in:
_cb_MyCallBackFunction(...json-encoded data...)
In your custom pages, you would then create a corresponding function to handle this custom callback function:
<script language="JavaScript" type="text/javascript">
<!--
// <![CDATA[
function _cb_MyCallBackFunction(data)
{
// put additional routines here
}
// ]]>
//-->
</script>
If you would like to receive the data without a callback function, you can use the argument <!--
// <![CDATA[
function _cb_MyCallBackFunction(data)
{
// put additional routines here
}
// ]]>
//-->
</script>
callBack
to override this. Specifying a value of false
for the callBack
argument returns the data without the callback function, as in:
http://{site root}/piapi/index.cfm?callName=getProgramDeadlines&ResponseEncoding=JSON&Program_ID=10001&callBack=false
Note: specifying callBack=true
is implied and is unnecessary for returning JSON data with a callback function.
Example 1: Following is an example of using ColdFusion to call the API and returning the data in a SOAP envelope:
Run Example 1 Top
(if your installation does not have any data, this example will not return anything)
<!---// local variables //--->
<cfparam name="responsePacket" default="[ no response ]" />
<cfparam name="url.program_id" default="10001" />
<!---// connect to the API (GET or POST) //--->
<cfhttp result="httpCall" method="post" url="#REQUEST.CurrentAccount.AccountURL()#piapi/index.cfm">
<cfhttpparam name="callName" type="url" value="getProgramDeadlines" />
<cfhttpparam name="ResponseEncoding" type="url" value="SOAP" />
<cfhttpparam name="Program_id" type="url" value="#url.program_id#" />
</cfhttp>
<!---// ensure the response is in XML format //--->
<cfif isXml(httpCall.fileContent)>
<!---// parse response //--->
<cfset responsePacket = xmlParse(httpCall.fileContent) />
<!---// check to see if an error was thrown //--->
<cfset err = xmlSearch(responsePacket, "//extrainfo") />
<!---// an error was thrown //--->
<cfif isArray(err) and not arrayIsEmpty(err)>
<!---// throw error //--->
<cfthrow message="#err[1].xmlText#" />
<cfabort />
</cfif>
<cfelse>
<!---// additional error checking //--->
</cfif>
<!---// additional code goes here //--->
<h2>Output for 'responsePacket':</h2>
<cfdump VAR="#responsePacket#" />
For additional techniques, be sure to visit the other program calls within these documentation pages.
<cfparam name="responsePacket" default="[ no response ]" />
<cfparam name="url.program_id" default="10001" />
<!---// connect to the API (GET or POST) //--->
<cfhttp result="httpCall" method="post" url="#REQUEST.CurrentAccount.AccountURL()#piapi/index.cfm">
<cfhttpparam name="callName" type="url" value="getProgramDeadlines" />
<cfhttpparam name="ResponseEncoding" type="url" value="SOAP" />
<cfhttpparam name="Program_id" type="url" value="#url.program_id#" />
</cfhttp>
<!---// ensure the response is in XML format //--->
<cfif isXml(httpCall.fileContent)>
<!---// parse response //--->
<cfset responsePacket = xmlParse(httpCall.fileContent) />
<!---// check to see if an error was thrown //--->
<cfset err = xmlSearch(responsePacket, "//extrainfo") />
<!---// an error was thrown //--->
<cfif isArray(err) and not arrayIsEmpty(err)>
<!---// throw error //--->
<cfthrow message="#err[1].xmlText#" />
<cfabort />
</cfif>
<cfelse>
<!---// additional error checking //--->
</cfif>
<!---// additional code goes here //--->
<h2>Output for 'responsePacket':</h2>
<cfdump VAR="#responsePacket#" />
Back to Terra Dotta Software API Documentation Top