I think you have an issue with your token since the error occurs already in line 1. Where are you getting it from? I'm a big fan of Graph, but in this case, it might be easier to use the Exchange Online module...