Using Node.js I’m attempting to use the V2 API. However, no matter what I do, I always get a 401 when attempting to access any V2 endpoint. I’ve registered my app, authorized it with my Patreon account, got the code, used said code to generate an access_token and refresh_token, but still I’m getting a 401 no matter which endpoint I try to hit. Am I missing something?
Here’s my code
request(
{
url: "https://www.patreon.com/api/oauth2/v2/identity",
headers: {
Authorization: "Bearer " + access_token,
},
},
(err, result, body) => {
if (err) {
console.log(err);
} else {
body = JSON.parse(body);
console.log(body);
}
}
);
response:
{
errors: [
{
code: 1,
code_name: 'Unauthorized',
detail: "The server could not verify that you are authorized to access the URL requested. You either supplied the wrong credentials (e.g. a bad password), or your browser doesn't understand how to supply the credentials required.",
id: '3c6c5fe3-7bef-50b6-9f4a-794f01928a00',
status: '401',
title: 'Unauthorized'
}
]
}
Any help is appreciated, I feel like I’m banging my head against a wall.