Today we have made the LockerX API available to all users and developers. We believe in giving users more control over their data and creating an open ecosystem.
With the newly introduced API, it will be possible to integrate LockerX with existing and new applications. Power users will also be able to automate their workflow.
To get started with the LockerX API, you first need to create an account.
After you have registered and confirmed your account, go to your account settings page to create a new OAuth 2 application. You need to provide some basic information that will be displayed to users such as your application name, description, and homepage. You also need to provide some OAuth-specific choices:
The Authorisation Code grant type is the most common type of OAuth grant type, it is used to get an access token after the user authorises your app. The Authorisation Code flow is used by web and mobile applications.
The Client Credentials is used to access the account used to create the application. This type of token is best used if you intend to automate part of your workflow, for example by creating scripts or small applications.
Scopes let you specify how you intend to access a user’s account. LockerX scopes contain the resource you intend to access, followed by the class of actions. The available scopes are:
After creating the application, you will have access to its Client Id and Secret.
The Authorisation Code Flow is as follows:
To request the user permission, you need to open a browser window at the following url:
Where the parameters are as follows:
Your application needs to handle the arguments passed to the redirect uri:
Where state has the same value passed previously and code is a short-lived code that you can exchange for an access token.
Your application is now ready to exchange the authorisation code with an access token. To do so, your application sends a POST request to the following url, authenticating using HTTP Basic Authentication with the Client Id as username and Client Secret as password:
The parameters are as follows:
The LockerX identity server will reply with a json document that contains the access token.
To authenticate requests to LockerX, set the request Authorization token to bearer <access_token>, where <access_token> is the token from the previous step.
To always find the most up-to-date information about LockerX API, check the Developer documentation page. There you can also find more information about the available endpoints.