Looks like when i use my personal access token, it just randomly changes and breaks everything.
I need to replace this method w/ one that uses client secret key:
module.exports.getPledgeData = async () => {
const { campaignId, creatorAccessToken } = require("../config/server");
const get = `https://www.patreon.com/api/oauth2/api/campaigns/${campaignId}/pledges?page%5Bcount%5D=10000`;
return await axios
.get(get, {
headers: { authorization: `Bearer ${creatorAccessToken}` }
})
.then(res => {
return res.data;
})
.catch(err => {
console.log(
"Error Fetching Patreon Data: ",
err.response.status,
err.response.statusText
);
return jsonError(err.response.statusText);
});
};
Please help.