I used the API from microsoft graph
https://developer.microsoft.com/en-us/graph and created a microsoft azure app with the OAuth 2.0 client credentials grant flow. So with a GET request, you can have your token, and a PUT request to submit the file, and no need for user interaction.