I'm writing the javascript code to save file in onedrive helping with https://dev.onedrive.com/sdk/js-v6/js-picker-save.htm
For the same,I am using my personal account *@live.com and had added the application in microsoft and pass the app_id as client id in javascript tag.
But faced that issue to get the token and open the one drive exprorer.
We are unable to issue tokens from this api version for a Microsoft account. Please contact the application vendor as they need to use version 2.0 of the protocol to support this.
<script type="text/javascript" src="https://js.live.net/v6.0/OneDrive.js" id="onedrive-js" client-id="78ef3a97-45fe-416c-a8ed-b618caee43c9"></script>
<div>
<div class="pickerDemo hidden-xs visible-sm visible-md visible-lg">
<div class="row">
<span class="cell heading">File</span><span class="cell">
<input id="inputFile" name="inputFile" type="file">
</span>
</div><div class="row">
<span class="cell heading">File name</span><span class="cell">
<input id="fileName" type="text" name="fileName">
<label>Default: the file's local name</label>
</span>
</div><div class="row">
<span class="cell heading">Button</span><span class="cell">
<button onclick="javascript:launchOneDriveSaver();" title="Save to OneDrive">
<img src="https://js.live.net/v5.0/images/SkyDrivePicker/SkyDriveIcon_white.png" style="vertical-align: middle; height: 16px;">
<span class="oneDriveButton">Save to OneDrive</span>
</button>
</span>
</div><div> </div><div class="row">
<span class="cell heading" style="vertical-align: top;">Result</span><span class="cell">
<div id="saverConsole" class="console">Save a file to OneDrive to see the return result</div>
</span>
</div>
</div>
</div>
<script type="text/javascript">
function launchOneDriveSaver(){
var saveOptions = {
file: "inputFile", /* The id of a file type input element or a valid data URI string */
fileName: "file.txt", /* Required if `saverOptions.file` is a data URI string */
openInNewWindow: true,
success: function () { /* upload is complete */ },
progress: function (p) { /* upload is progressing */ },
cancel: function () { /* upload was cancelled */ },
error: function (e) { /* an error occurred */ }
}
OneDrive.save(saveOptions);
}
</script>