Introducing the LockerX API

December 4, 2019

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.

Get started with the LockerX API

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

Authorisation Code Flow

The Authorisation Code Flow is as follows:

Request user permission

To request the user permission, you need to open a browser window at the following url:

https://account.lockerx.co.uk/connect/authorize?response_type=code&state=<state>&client_id=<client_id>&redirect_uri=<redirect_uri>&scope=<scope>

Where the parameters are as follows:

Handle Redirect

Your application needs to handle the arguments passed to the redirect uri:

https://example.org/oidc-redirect?state=<state>&code=<code>

Where state has the same value passed previously and code is a short-lived code that you can exchange for an access token.

Token Exchange

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:

https://account.lockerx.co.uk/connect/token?grant_type=authorization_code&code=<code>&redirect_uri=<redirect_uri>

The parameters are as follows:

The LockerX identity server will reply with a json document that contains the access token.

Authenticating Requests

To authenticate requests to LockerX, set the request Authorization token to bearer <access_token>, where <access_token> is the token from the previous step.

Stay up to date

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.

Power up your wallet.
Start tacking back control on your crypto transactions. Join LockerX and create your first smart contract in minutes.
Start for free Now