{"metadata":{"image":[],"title":"","description":""},"api":{"url":"/oauth/ro","auth":"required","settings":"56d4ec911c4de4130005d7bf","examples":{"codes":[]},"method":"post","params":[{"name":"client_id","type":"string","default":"FP3iP1blgJbdmmSRYS1I96byb1nXryTs","desc":"Use client_id `FP3iP1blgJbdmmSRYS1I96byb1nXryTs` to get a token valid for Boomtrain","required":false,"in":"body","ref":"","_id":"56d5f41e2417921500c4669f"},{"name":"username","type":"string","default":"","desc":"Enter your Boomtrain username here","required":true,"in":"body","ref":"","_id":"56d4edc473dcd20b00fb8772"},{"name":"password","type":"string","default":"","desc":"Enter your Boomtrain password here","required":true,"in":"body","ref":"","_id":"56d4edc473dcd20b00fb8771"},{"name":"connection","type":"string","default":"Username-Password-Authentication","desc":"Use connection `Username-Password-Authentication`.","required":false,"in":"body","ref":"","_id":"56d5f41e2417921500c466a0"},{"name":"scope","type":"string","default":"openid app_metadata name email user_id","desc":"Use scope `openid app_metadata name email user_id` to get a valid token.","required":false,"in":"body","ref":"","_id":"56d5f41e2417921500c4669e"},{"name":"grant_type","type":"string","default":"password","desc":"Use grant_type `password` to get a valid token.","required":false,"in":"body","ref":"","_id":"56d5f41e2417921500c4669d"}],"results":{"codes":[{"status":200,"language":"json","code":"{\n  \"id_token\":\"<JWT>\", // Use this token for subsequent API requests in a header in the form of \"Authorization: Bearer <JWT>\"\n  \"access_token\":\"Oauth Access Token\",\n  \"token_type\":\"bearer\"\n}","name":""},{"status":400,"language":"json","code":"{\"error\":\"invalid_request\",\"error_description\":\"Description of error\"}","name":""}]}},"next":{"description":"","pages":[]},"title":"Authorization API","type":"endpoint","slug":"authorization-api","excerpt":"The Authorization API allows you to get a valid JSON Web Token based on your ZetaHub username and password.","body":"In order to access routes that use token-based authorization, you will need to generate a JSON Web Token (JWT).\n\nYou can generate an id_token by supplying your username and password to this route with the following data fields:\n[block:code]\n{\n  \"codes\": [\n    {\n      \"code\": \"{\\n  \\\"client_id\\\": \\\"FP3iP1blgJbdmmSRYS1I96byb1nXryTs\\\", \\n  \\\"username\\\": \\\"<Your User Name>\\\",\\n  \\\"password\\\": \\\"<Your Password>\\\",\\n  \\\"connection\\\": \\\"Username-Password-Authentication\\\",\\n  \\\"grant_type\\\": \\\"password\\\",\\n  \\\"scope\\\":  \\\"openid app_metadata name email user_id\\\"\\n}\",\n      \"language\": \"json\"\n    }\n  ]\n}\n[/block]\nThe id_token returned will be valid for 10 hours after issue, and should be passed as a header into the routes that need authorization, in the format `Authorization: Bearer <id_token>`.","updates":["59bc732f2b480b0010010dff"],"order":0,"isReference":true,"hidden":false,"sync_unique":"","link_url":"","link_external":false,"_id":"56d4ec8573dcd20b00fb876a","user":"566887ff8639090d00759415","githubsync":"","__v":15,"project":"56aff08c3a5b810d00745d99","version":{"version":"1","version_clean":"1.0.0","codename":"","is_stable":true,"is_beta":false,"is_hidden":false,"is_deprecated":false,"categories":["56aff08d3a5b810d00745d9d","56aff24f3a5b810d00745da0","56aff25dbc304a0d00ace207","56aff287e0b1e40d00c53798","56aff2b260a37a0d00ed8883","56aff2b8e0b1e40d00c53799","56aff2bd5b1f01170014dc7b","56aff2c9d21e9c0d00b62993","56aff493aef9a21700da0e67","56aff4ce1486990d009c0f64","56aff4da5b1f01170014dc7d","56aff4dfe0b1e40d00c537a2","56aff4e59d32e30d0006d3e9","56aff4e91486990d009c0f65","56aff4f93a5b810d00745da2","56aff4fe9d32e30d0006d3ea","56b91c7ab1e03e0d001057c5","56c4f51aba4a540d0091b9a2","56cd09488c4a331d002c1e44","56d4ec4773dcd20b00fb8769","56e79bc515f96b2200878e54","56ec25c538ff1d2200d56cc2","56ec3a6f36bc8e0e00f190c8","56ec3e308ea7ce0e00a3d8b0","5724d8fe4255580e005938b2","5724dc842ad0bc1700122803","5776ef2a04f7500e0095dc37","57ab9f70b5e8742000e17eb9","57d7117646dcc30e007dd21f","58e6abd5b1eece19008b7d31","59288c65e2653627003e1221","5a8f4797a44f8600128e75ee","5bbf8833eb416300039a2c14","5ea811617bf4b5007328a0af"],"_id":"56aff08c3a5b810d00745d9c","project":"56aff08c3a5b810d00745d99","releaseDate":"2016-02-01T23:55:56.544Z","__v":34,"createdAt":"2016-02-01T23:55:56.544Z"},"category":{"sync":{"isSync":false,"url":""},"pages":["56d4ec8573dcd20b00fb876a"],"title":"Server-Side Integration REST API","slug":"authorization","order":3,"from_sync":false,"reference":true,"_id":"56d4ec4773dcd20b00fb8769","__v":1,"version":"56aff08c3a5b810d00745d9c","createdAt":"2016-03-01T01:11:35.547Z","project":"56aff08c3a5b810d00745d99"},"createdAt":"2016-03-01T01:12:37.071Z","editedParams":true,"editedParams2":true,"parentDoc":null}

postAuthorization API

The Authorization API allows you to get a valid JSON Web Token based on your ZetaHub username and password.

Definition

{{ api_url }}{{ page_api_url }}

Parameters

Body Params

client_id:
stringFP3iP1blgJbdmmSRYS1I96byb1nXryTs
Use client_id `FP3iP1blgJbdmmSRYS1I96byb1nXryTs` to get a token valid for Boomtrain
username:
required
string
Enter your Boomtrain username here
password:
required
string
Enter your Boomtrain password here
connection:
stringUsername-Password-Authentication
Use connection `Username-Password-Authentication`.
scope:
stringopenid app_metadata name email user_id
Use scope `openid app_metadata name email user_id` to get a valid token.
grant_type:
stringpassword
Use grant_type `password` to get a valid token.

Result Format


Documentation

In order to access routes that use token-based authorization, you will need to generate a JSON Web Token (JWT). You can generate an id_token by supplying your username and password to this route with the following data fields: [block:code] { "codes": [ { "code": "{\n \"client_id\": \"FP3iP1blgJbdmmSRYS1I96byb1nXryTs\", \n \"username\": \"<Your User Name>\",\n \"password\": \"<Your Password>\",\n \"connection\": \"Username-Password-Authentication\",\n \"grant_type\": \"password\",\n \"scope\": \"openid app_metadata name email user_id\"\n}", "language": "json" } ] } [/block] The id_token returned will be valid for 10 hours after issue, and should be passed as a header into the routes that need authorization, in the format `Authorization: Bearer <id_token>`.

User Information

Try It Out

post
{{ tryResults.results }}
Method{{ tryResults.method }}
Request Headers
{{ tryResults.requestHeaders }}
URL{{ tryResults.url }}
Request Data
{{ tryResults.data }}
Status
Response Headers
{{ tryResults.responseHeaders }}