Announcements
From 28 September 2026, Community private messages will no longer be available. If you have any private messages you'd like to keep, please save or copy them using these steps before this date. Thank you.

Help Wizard

Step 1

NEXT STEP

Refresh token replying with ETIMEDOUT

Refresh token replying with ETIMEDOUT

When getting an access_token using a refresh_token i get a ETIMEDOUT error. I have used your code from this page: https://developer.spotify.com/documentation/general/guides/authorization/code-flow/ under the section Request a refreshed Access Token

 

Here is my code:

var authOptions = {
      headers: {
        Authorization:
          "Basic " +
          new Buffer(client_id + ":" + client_secret).toString("base64"),
      },
      form: {
        grant_type: "refresh_token",
        refresh_token: refreshToken,
      },
      json: true,
    };

    request.post(authOptions, function (error, response, body) {
      if (!error && response.statusCode === 200) {
        var access_token = body.access_token;
        res.send({
          access_token: access_token,
        });
      } else {
        console.log(error);
      }
    });
Reply
0 Replies

Suggested posts

Let's introduce ourselves!

Hey there you,   Yeah, you! 😁   Welcome - we're glad you joined the Spotify Community!   While you here, let's have a fun game and get…

ModeratorStaff / Moderator/ 5 years ago  in Social & Random