OAuth
Last updated
Was this helpful?
Last updated
Was this helpful?
Was this helpful?
// Step 1: Redirect user to authorization URL
const authUrl = `https://app.listenlayer.com/oauth/authorize?
client_id=${CLIENT_ID}&
redirect_uri=${REDIRECT_URI}&
response_type=code&
scope=read:events`;
// Step 2: Exchange code for token
const response = await fetch('https://api.listenlayer.com/oauth/token', {
method: 'POST',
body: JSON.stringify({
grant_type: 'authorization_code',
client_id: CLIENT_ID,
client_secret: CLIENT_SECRET,
code: authorizationCode,
redirect_uri: REDIRECT_URI
})
});
const { access_token } = await response.json();