Step 1: Register your app

To start things off, the rain gods need to know about your application. This can be done by visiting make.lono.io, and clicking Login in the upper right. Login with your Lono account, and click the dev settings button in the navbar.

Dev Portal

Click Add a new Application, and fill out the required fields. Because we are making a single user application, choose "Just Me" for the user quantity.

Add a new application

After clicking Create my app, mon!, Lono knows about your application!

Step 2: Record your keys and make a request

Make sure to keep track of your Client Id and Client Secret - you'll need these later! Next, click Test OAuth Request - this will prompt you for authorization for your third party application to be given write access to your Lono. If you are thinking of deploying your app publicly, then this is the place you'll want to send new users. After allowing the request, you will be redirected, and you'll want to go back to make.lono.io to continue with the next step.

Step 3: Find your keys!

If everything was done correctly, your auth token should show up under Client Secret in the respective app. If it isn't there, make sure you chose "Just Me" for the user quantity during application setup and that you completed an OAuth request by clicking Test OAuth Request. This is the last bit of information you need to start commanding the rain gods!

Step 4: Get your session token

If you are setting up a single-user application, then right below the auth token is a button that will generate an access token. However, if you'd prefer to do it manually, just run the curl below:

curl -X POST -H "Content-Type: application/json" -d '
{
  "grant_type": "authorization_code",
  "client_id": "[CLIENT ID HERE]",
  "client_secret": "[CLIENT SECRET HERE]",
  "code": "[ACCESS TOKEN HERE]"
}' http://make.lono.io/oauth/token

This query returns, on success:

{
  "access_token": "[ACCESS TOKEN]",
  "token_type": "bearer"
}

Step 5: Do some stuff!

Now, with an access token, you can command the rain gods! Take a look to the right for all the API calls you can make!