'How do I use the OneDrive API to upload a file and also check if the file already exists

I have to upload a file to OneDrive, sometimes small files, sometimes larger files. This Service should run in the background so i have to check, if the file already exists, and if it already exists, add a timestamp to the filename, or in some cases don't even upload a new version.

I cant just install the OneDrive App and copy to a linked Folder. I have to use the API which requires a clientID etc.

Maybe someone could help me out with this.

Thank you alot



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source