From Exor Live

Jump to: navigation, search

The Exor Live client-side API is an easy-to-use API that enables rich integration with Exor Live using only client-side technologies.

This means that there is no need to use server-side webservice calls, store credentials or foreign keys.



If you are looking for the previous version of the documentation, then it can be found here.

Initial version
Support for OAuth and the new `data` api added.



The domain of the application is used to identify it, and so this must be registered in order for the API to function. For development purposes the `localhost` domain has also been whitelisted and so you can test using this domain.

Contact ExorLive to register your application.


Exor Live uses OAuth2 to provide its users to authorize third-party applications. If you need to use more than the ExorLive.app methods, you need to obtain a valid OAuth Access Token. This must be done with serverside code.

Javascript API

For easy integration we provide you with a Javascript library exposing most of ExorLive's functionality in an easy way. This allows for flexible integration between ExorLive and other single-page applications.

To use this, add the following code to your document:

// This will be called once the the Exor Live framework is ready
function init_ExorLive() {
	// The two following events MUST be handled in order to complete the OAuth flow
	// This data is easily obtained serverside with not need of a library and with very little code
	// In this example 'PageMethods.RequestAccessToken' is an AJAX method calling back to the server
	ExorLive.Events.on("access.code", function (code) {
		// We pass the Grant Token to the backend so that it can exchange this for an AccessToken
		PageMethods.RequestAccessToken(code, function (accessToken) {
			// Once obtained, update the API with the new token

	ExorLive.Events.on("access.expired", function () {
		// passing "" instead of the Grant Token signals to the backend that we want to refresh the existing token
		PageMethods.RequestAccessToken("", function (accessToken) {
			// Once obtained, update the API with the new token

	// Respond to default events from the API
	ExorLive.Events.on("access.missing", function (err) {
		var el = document.getElementById("divUserProfile");
		// Display a default Authorize widget
		el.innerHTML = " <div class=\"el-widget\" data-type=\"Authorize\" data-scope=\"read_profile read_workout\">Authorize</div>";

	ExorLive.Events.on("auth.success", function (profile) {
		// Display the profile data returned from Exor Live
		document.getElementById("divUserProfile").innerHTML = "Navn: " + profile.Firstname + " " + profile.Lastname + "<br/>" + "Email: " + profile.Email;

	// This is where you configure the API
		// The culture you want used
		culture: "en-US",
		// Your ExorLive Applications identifier
		clientId: "testkey",
		// In case the user needs to create an account, this will be used to populate the needed fields
		orderData: { // 
			firstName: "john",
			lastName: "doe",
			email: "user@domain.example"
		// If the user has already autorized you, then you can supply the token here
		accessToken: {
			// The token string
			AccessToken: "...................",
			// ISO8601 using UTC
			Expiration: "2011-09-21 12:33:10", 
			// The scopes authorized through this token. This will help the API give proper feedback.
			Scope: "read_profile read_workouts ...."
		// Whether the API should look for, and instantiate ExorLive Widgets
		parse: true

and include the following script

<script src="https://exorlive.com/api/bootstrapper.ashx" type="text/javascript"></script>

The document is now properly set up to provide the the user with a rich experience.


For reliable behavior, it is important that your document brings the browser into standards mode, preferably by using a valid doctype like

<!doctype HTML>

Supported browsers

This API supports all modern browsers as well as IE6 and IE7.

How to use it

The ExorLive Javascript API provides three levels of integration

  • 'Remote control' - the ability to interact with, and to instruct the ExorLive Webapplication
  • Data API - an api providing access to the same underlying infrastructure that the ExorLive Webapplication does
  • Widget API - an api providing easy access to render prebuilt widgets showing data from ExorLive

All levels of integration requires that the user authorize you application with the appropriate scopes.

Premade Projects

We have a few premade project which you can use. The examples are Visual Studio 2010 projects and uses C#.

Full API example. This one requires registration and server side code.

Client side only example. This uses only HTML and javascript, and no authorization necessary. You will need to run this from a webserver (localhost or If you run it as a file, the javascript will NOT run.

Personal tools