Help / API

API Documentation

What is an API?
API stands for 'Application Programming Interface', in this case, it's a way for you to access your mojoLive data programmatically, without logging and loading up the website proper. This way you can build your own widgets or applications using your mojoLive data!
How do I use the mojoLive API?

We provide a RESTful, versioned, API interface. Which means that you just need to build URLs at request them, directly in your browser, or through whatever programming language that you choose.

All requests are sent to the following URL structure:
http://mojolive.com/api/v1/[ENDPOINT]
Wherein you replace [ENDPOINT] with whatever actual API endpoint you wish to access based upon the information that you are trying to read back in from us.

You will find more documentation in exactly what endpoints are available and what they return below.

What are API Keys?

Since all of the information currently available from the API is public data anyway, you can use the API completely anonymously. However we know there are often use-cases where you want a user to be able to uniquely identify themself as owning an account. To solve that in the simplest way at the moment, we've implemented API Keys.

An API Key is simple a randomly generated string, that you can find on your Account < 3rd Party Accounts page. You are able to connect to the API, and pass in your username as the apiuser parameter, and the API Key, to uniquely identify yourself and gain access to the API that way. When you do this, you can read in your own user information by default without having to pass in any additional information. Read on about API Parameters to understand exactly how to do this.

Realize that your API Key, is essentially like a 2nd password to your account, though only with read-only access to the API, and so you should guard it and only give it to people and applications that you trust. If you want to revoke access to to that key, you can generate a new one, which immediately stops the original key from working.

API Parameters

Passing Parameters
All parameters are simply passed to the endpoint as GET Query String parameters. So for example if you were requesting the user endpoint, and wanted to get username 'EliW', and call your app "MyTestApp", your call might look like:
http://mojolive.com/api/v1/user?username=EliW&appname=MyTestApp
List of valid parameters

Currently all parameters are valid against all endpoints, though this can & will change in the future as each endpoint may get additional parameters specific to it.

  • appname - required

    Every request must include an 'appname' parameter. The value of this parameter is up to you, but should be a unique phrase used to identify your application to mojoLive. We use this for tracking and like to know who using our service. Consider this your 'User Agent' for your API application.

  • apikey

    As mentioned above, you have the option of passing in a user's apikey. If you do this, you do not need to specify a user_id or username, and it will default to the user belonging to the apikey. If you pass in an apikey, you must specify the apiuser parameter described below. If you omit the apiuser parameter, your request will fail.

  • apiuser

    If you use the apikey parameter - you must also provide the apiuser parameter. This would specify the username of the user related to the apikey you used. If the apikey does not belong to the apiuser, your request will fail.

  • username

    Use this parameter to specify a specific username you want data about. You must provide either this, user_id, or use an apikey+apiuser.

  • user_id

    Use this parameter to specify a specific user by ID that you want data about. You must provide either this, username, or use an apikey+apiuser.

  • format

    This parameter is optional and lets you choose what format you want the results to be returned to you in. The two options are 'json', to return a JSON encoded version of the data, or 'php', which returns a serialized PHP format. If not specified this defaults to 'json'.

API Endpoints

user

The user endpoint returns information about the user requested, information such as their name, tagline, url, score, etc.

JSON:

PHP:

profile

The profile endpoint returns the entirety of a user profile on mojoLive. Everything that exists as part of their profile, including employers, schools, skills, portfolio, achievements, and involvement.

JSON:

PHP:

following

The following endpoint simply returns an array of user_id's that the requested user is following.

JSON:

PHP:

followers

The followers endpoint simply returns an array of user_id's that are following the requested user.

JSON:

PHP: