What is the correct way to include a fetched access token (JSON) in the endpoint URI using JavaScript?
Example of Returned JSON
{token_type: 'Bearer', expires_at: 1681425284, expires_in: 15892, refresh_token: 'fetched_refresh_token94f5c1f7f241bnh11', access_token: 'fetched_access_token8c13694dd4b34c01f44b51', ...}
JavaScript
async function getActivities(res) {
const fetched_access_token = res.access_token;
const activities_link = `https://www.strava.com/api/v3/segments/11111111?access_token=????what-to-put-here????`
I am trying to pass the retrieved access_token
into the endpoint URI for fetching JSON data.