Get JWT token to authenticate all requests.
1 min
POST
/oauth/token
Body Parameters
- bodyTokenContextrequired
- grant_typestring
- client_idstring
- client_secretstring
Responses
200
401
- TokenError
- errorstring
- error_descriptionstring
curl
curl --request POST \
--url /oauth/token \
--header 'accept: application/json'javascript
var myHeaders = new Headers();
myHeaders.append("accept", "application/json");
myHeaders.append("content-type", "application/json");
var requestOptions = {
method: 'POST',
headers: myHeaders,
redirect: 'follow'
};
fetch("/oauth/token", requestOptions)
.then(response => response.text())
.then(result => console.log(result))
.catch(error => console.log('error', error));ruby
require "uri"
require "json"
require "net/http"
url = URI("/oauth/token")
http = Net::HTTP.new(url.host, url.port);
request = Net::HTTP::Post.new(url)
request["accept"] = "application/json"
request["content-type"] = "application/json"
response = http.request(request)
puts response.read_body
python
import requests
import json
url = "/oauth/token"
payload = {}
headers = {
'accept': 'application/json',
'content-type': 'application/json'
}
response = requests.request("POST", url, headers=headers, data=payload)
print(response.text)
200
// Generates a valid token
401
// Unable to match credentials
{
"error": "",
"error_description": ""
}