Skip to content

Instantly share code, notes, and snippets.

@uwe-schwarz
Created May 27, 2023 06:38
Show Gist options
  • Select an option

  • Save uwe-schwarz/ddcde8a2432ab14db482039b5b675678 to your computer and use it in GitHub Desktop.

Select an option

Save uwe-schwarz/ddcde8a2432ab14db482039b5b675678 to your computer and use it in GitHub Desktop.
javascript:(function(){
async function getRewards() {
var myHeaders = new Headers();
myHeaders.append("Authorization", "Bearer " + localStorage['id_token']);
var requestOptions = { method: 'GET', headers: myHeaders, redirect: 'follow' };
return await fetch("https://api.plutus.it/platform/transactions/pluton", requestOptions)
.then(response => response.json())
.then(jsonResponse => { return jsonResponse; })
.catch(err => console.warn(err));
}
async function getTransactions() {
var myHeaders = new Headers();
myHeaders.append("Authorization", "Bearer " + localStorage['id_token']);
var requestOptions = { method: 'GET', headers: myHeaders, redirect: 'follow' };
return await fetch("https://api.plutus.it/platform/transactions/contis", requestOptions)
.then(response => response.json())
.then(jsonResponse => { return jsonResponse; })
.catch(err => console.warn(err));
}
function download(json, filename) {
var downloadLink = document.createElement('a');
downloadLink.href = 'data:text/json;charset=utf-8,' + encodeURI(JSON.stringify(json));
downloadLink.download = filename + '.json';
downloadLink.click();
}
getRewards().then(response => download(response, "rewards"));
getTransactions().then(response => download(response, "transactions"));
})();
@meinname
Copy link
Copy Markdown

Did you already find the endpoint for the new cards?
as https://api.plutus.it/platform/transactions/contis only shows transactions from the old contis cards but not new modulr

@uwe-schwarz
Copy link
Copy Markdown
Author

Sorry, I gave up on Plutus after the (IMO) disaster with the new cards. I would have gotten my new card sometime last week, but I won't trust a company with my money/expenses when they can't give me correct updates (or any updates at all) if something changes.

@meinname
Copy link
Copy Markdown

Totally understandable.
I only use(d) it for the Perk.
Plus to get the MCC via the API 😆

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment