Dear Team,
I’m failing to update my creators access token as per Step 7 - Keeping up to date via Node.js. I always get a
status: '405', title: 'Method Not Allowed'
as response.
This is the code:
var CLIENT_ID = '<clientid>'
var CLIENT_SECRET = '<secret>'
token = '<actual CREATORS TOKEN>'
refresh_Token ='<refresh token>' //
url = 'https://www.patreon.com/api/oauth2/token'
options = {
method: 'POST',
headers:
{ 'Content-Type': 'application/x-www-form-urlencoded; charset=UTF-8',
'User-Agent': 'my bot' },
body:
`client_id=${CLIENT_ID}&client_secret=${CLIENT_SECRET}&refresh_token=${refresh_Token}&grant_type=refresh_token`,
params:
{ client_id: CLIENT_ID,
client_secret: CLIENT_SECRET,
refresh_token: refresh_Token,
grant_type: 'refresh_token'},
credentials: 'include',
compress: false
}
request.get(url, options, function (e, r, body) {
(...)
}
Any idea?
I tried to use the normal client token process for this, but I guess it has to look differently for the creators token, but I’m not sure…
Thanks!
Meffesino