Skip to content

Instantly share code, notes, and snippets.

@fr34kyn01535
Created September 14, 2017 21:21
Show Gist options
  • Save fr34kyn01535/8331a33f82f1b3af4e99dbd1d2d226ce to your computer and use it in GitHub Desktop.
Save fr34kyn01535/8331a33f82f1b3af4e99dbd1d2d226ce to your computer and use it in GitHub Desktop.
let request = require("request");
var token = "XXXXXXXXXXXXXXX";
request.get({ url : "https://my.sevdesk.de/api/v1/CheckAccountTransaction/?limit=-1", headers : { "Authorization" : token } },
function (error, response, body) {
let transactions = JSON.parse(body);
for(var transaction of transactions.objects){
if(transaction.checkAccount.id === "157622"){
request.delete({ url : "https://my.sevdesk.de/api/v1/CheckAccountTransaction/"+transaction.id+"/", headers : { "Authorization" : token } });
}
}
}
);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment