{"_id":"55a47339e75ca60d00a39335","category":{"_id":"55a4fb7e1a5f991700a940f0","pages":["55a4fbe51a5f991700a940f4"],"project":"55a47338e75ca60d00a3932f","__v":1,"version":"55a47338e75ca60d00a39332","sync":{"url":"","isSync":false},"reference":false,"createdAt":"2015-07-14T12:07:26.177Z","from_sync":false,"order":0,"slug":"getting-started","title":"Getting Started"},"project":"55a47338e75ca60d00a3932f","__v":11,"user":"55a472ec68c7e20d0036d4dc","version":{"_id":"55a47338e75ca60d00a39332","project":"55a47338e75ca60d00a3932f","__v":8,"createdAt":"2015-07-14T02:26:00.724Z","releaseDate":"2015-07-14T02:26:00.724Z","categories":["55a47339e75ca60d00a39333","55a4fb7e1a5f991700a940f0","55a6702b80c8a30d00b32684","55a6703b80c8a30d00b32685","55a6ea5516d20b1900ed8f53","55b23ad2329f363900fbc92f","55b23b0a329f363900fbc932","55b2426a0e11590d008f7950"],"is_deprecated":false,"is_hidden":false,"is_beta":true,"is_stable":true,"codename":"","version_clean":"1.0.0","version":"1.0"},"updates":[],"next":{"pages":[],"description":""},"createdAt":"2015-07-14T02:26:01.994Z","link_external":false,"link_url":"","githubsync":"","sync_unique":"","hidden":false,"api":{"results":{"codes":[]},"settings":"","auth":"required","params":[],"url":""},"isReference":false,"order":1,"body":"Step 1: Register your app\n---\nTo 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.\n\n![Dev Portal](http://make.lono.io/docs/devportal.png)\n\nClick `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.\n\n![Add a new application](http://make.lono.io/docs/newapp-single.png)\n\nAfter clicking `Create my app, mon!`, Lono knows about your application!\n\nStep 2: Record your keys and make a request\n---\nMake 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.\n\nStep 3: Find your keys!\n---\nIf 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!\n\nStep 4: Get your session token\n---\nIf 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:\n\n```bash\ncurl -X POST -H \"Content-Type: application/json\" -d '\n{\n  \"grant_type\": \"authorization_code\",\n  \"client_id\": \"[CLIENT ID HERE]\",\n  \"client_secret\": \"[CLIENT SECRET HERE]\",\n  \"code\": \"[ACCESS TOKEN HERE]\"\n}' http://make.lono.io/oauth/token\n```\nThis query returns, on success:\n\n```json\n{\n  \"access_token\": \"[ACCESS TOKEN]\",\n  \"token_type\": \"bearer\"\n}\n```\n\nStep 5: Do some stuff!\n---\nNow, with an access token, you can command the rain gods! Take a look to the right for all the API calls you can make!","excerpt":"","slug":"getting-started-single-user","type":"basic","title":"Getting Started with Lono: Single User Application"}

Getting Started with Lono: Single User Application


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](http://make.lono.io/docs/devportal.png) 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](http://make.lono.io/docs/newapp-single.png) 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: ```bash 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: ```json { "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!