title: Upload file to OneDrive from a Java Application
body: <p>I'm trying to use a Java application to upload a file to OneDrive and am somewhat struggling with the process. I think my main issue is that I don't quite get the Drives and Folders concept as Microsoft defines them. And so am unable to see what the URL should be to upload to.</p>
  
  <p>For now I would be ecstatic just to upload a file to my own OneDrive folder that I see whenever I log into my company's "Sharepoint" site. So this would not be a personal OneDrive upload. 
  Eventually though I will need to be able to construct a URL that points to whatever folder that the requirements call for to deposit the file.</p>
  
  <p>Scouring the WEB (and Stackoverflow) I have found people specifying 2 different types of URLs to upload a file to.</p>
  
  <ol>
  <li><a href="https://apis.live.net/v5.0/me/skydrive/files?access_token=" rel="nofollow noreferrer">https://apis.live.net/v5.0/me/skydrive/files?access_token=</a>"+sAccessToken - This first one appears to be a MS URL that is somehow supposed to figure out what my folder is.</li>
  <li><a href="https://mycompanyname.sharepoint.com/me/drive?access_token=" rel="nofollow noreferrer">https://mycompanyname.sharepoint.com/me/drive?access_token=</a>"+sAccessToken - This one is specific to my company. And in my mind points to my default directory. But for the life of me I cannot get it to work. Even in Chrome Postman let alone in my Java application.</li>
  </ol>
  
  <p>I consistently get either a 401 or 404 error. Now 401 is an authorization error so do I think it's a URL issue. Well, because I created the application and gave the ReadWrite rights that myself. And I used the secret from this application to obtain the AccessKey which does work.
  So my guess is that I am accessing an incorrect folder, i.e. not mine but someone else's and as a result am getting the 401 message.</p>
  
  <p>I'm not posing the Java code since I can't even get this to work in Postman. So if I left anything out please let me know.</p>
  
  <p>Thank you to all in advance</p>