let stravaForm = new FormData();
stravaForm.append("client_id", CLIENT_ID);
stravaForm.append("client_secret", CLIENT_SECRET);
stravaForm.append("callback_url", CALLBACK_URL);
stravaForm.append("verify_token", VERIFY_TOKEN);
let config = {
headers: {
// ...stravaForm.getHeaders(),
'Accept': 'application/json',
'Authorization': `Bearer ${access_token}`
}
}
return axios.post(stravaUrl + "/api/v3/push_subscriptions", stravaForm,
config
)}
I'm not sure if I have to include the bearer token for the user or not, but I've tried with and without it with no luck.
However, using curl and putting in the same info (both with and without authorization header), I get a successful response.
Thanks in advance!