Create Subscription 401

16 views
Skip to first unread message

Chris Chan

unread,
Jun 28, 2022, 11:46:25 PM6/28/22
to Strava API
I've been trying to create a subscription through nodejs and I keep getting a 401 response.

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!

Reply all
Reply to author
Forward
0 new messages