Getting a Bearer Token

Getting a Bearer Token

There are two ways you can get a Bearer Token from the Access Token URL in the Lex Machina API.

In the first method, you can send in the parameters of client_id, client_secret and grant_type as form URL encoded parameters in the body of the POST. This requires setting the Content-Type header appropriately

curl -i -X POST 'https://api.lexmachina.com/oauth2/token' 
--header 'Content-Type: application/x-www-form-urlencoded'  
--data-urlencode 'client_id=XXXXX' 
--data-urlencode 'client_secret=XXXXX'
--data-urlencode 'grant_type=client_credentials'