Once authentication is set up, you can start making API requests to access your content.
// JavaScript example using fetch async function getArticles() { // First, get the access token const tokenResponse = await fetch('https://your-site.com/oauth/token', { method: 'POST', headers: { 'Content-Type': 'application/x-www-form-urlencoded', }, body: new URLSearchParams({ 'grant_type': 'client_credentials', 'client_id': 'YOUR_CLIENT_ID', 'client_secret': 'YOUR_CLIENT_SECRET', }) }); const { access_token } = await tokenResponse.json(); // Then use the token to fetch articles const articlesResponse = await fetch('https://your-site.com/jsonapi/node/article?include=field_image&sort=-created', { headers: { 'Authorization': `Bearer ${access_token}`, 'Accept': 'application/vnd.api+json', } }); return articlesResponse.json(); }