cURL
curl -X POST "https://api.light.inc/oauth/token" \
-H "Authorization: Basic YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"client_id": "string",
"client_secret": "string",
"grant_type": "string",
"code": "string",
"redirect_uri": "string",
"refresh_token": "string"
}'
JavaScript
const res = await fetch("https://api.light.inc/oauth/token", {
method: "POST",
headers: {
Authorization: `Basic ${process.env.LIGHT_API_KEY}`,
"Content-Type": "application/json",
},
body: JSON.stringify({
"client_id": "string",
"client_secret": "string",
"grant_type": "string",
"code": "string",
"redirect_uri": "string",
"refresh_token": "string"
}),
});
const data = await res.json();
Python
import os, requests
res = requests.post(
"https://api.light.inc/oauth/token",
headers={
"Authorization": f"Basic {os.environ['LIGHT_API_KEY']}",
},
json={
"client_id": "string",
"client_secret": "string",
"grant_type": "string",
"code": "string",
"redirect_uri": "string",
"refresh_token": "string"
},
)
data = res.json()
Example requestGenerated
{
"client_id": "string",
"client_secret": "string",
"grant_type": "string",
"code": "string",
"redirect_uri": "string",
"refresh_token": "string"
}
Generated from the schema: shapes and types are real, values are placeholders, and fields that exclude each other are all shown. Do not send it unchanged.
Example responseGenerated
{
"access_token": "string",
"expires_in": 100000,
"token_type": "string",
"refresh_token": "string"
}
Generated from the schema: shapes and types are real, values are placeholders.