API Basics

API Documentation

For integration with various school technologies, Digication provides a web-based API that allows other applications to access and modify a school's data if authorized to do so.

For example, a school may want to add a Digication login form to their school homepage to make it easier for students to access their Digication accounts. In this case, the program that displays the login form and receives the username and password data from it may pass that data to the Digication API to authenticate the user. Then the program might send the user directly to their Digication account if the login attempt was successful.

Interaction with the API is done through one or more API requests. Each API request is an HTTP request to http://campus.digication.com/api The details of the request are sent as GET parameters to that URL, and the content returned will contain the appropriate response resulting from the request.

The GET parameters should include:

method: The identifier of the specific action the API should perform, i.e. "user.login"

key: The secret api key that uniquely identifies your school.  This will be the same as your import key, if your school uses CSV imports.

systemid: Your schools system id within Digication

Any additional parameters, specific to the function/method you are calling, should also be GET parameters.

For example, here is a URL that might be generated for the login situation described above.

https://campus.digication.com/api?method=user.login&key=ae7f9bc6ae5fc48a&systemid=123&username=mjones&password=ilovemydog

For additional security (recommended), the key parameter may be sent according to this format: concat(md5(concat(key,”;”,unixtimestamp)),”;”,unixtimestamp)

The response will be a url encoded set of key/value pairs representing the data returned from the method called. Among those variables there will always be one named “success” which indicates whether an error occurred while processing the request. There are two conditions.

If success = 1, there will also be a variable called "result" that may contain a multidimensional array of results.
If success = 0, there will also be a variable called "errorcode" containing the error identifier of the error encountered (i.e. usernotfound) and a variable called "error" containing a human readable message describing the error.

Here is an example of the response from user.login when an incorrect password is provided:

errorcode=usernotfound&error=No+user+with+that+otherid&success=0

Here is an example of the response from user.login when login is successful:

result%5Bloginkey%5D=aceff76fe536ea8023afdf1842d55a941937e7ac8&success=1

This is the format accepted by PHP's parse_str function.

Have more questions? Submit a request

0 Comments

Please sign in to leave a comment.