onedrive

OneDrive/SharePoint OAuth invalid audience error

家住魔仙堡 提交于 2019-12-01 22:34:16
问题 My goal is to write some code to enable an Office 365 user to access files in OneDrive for Business via REST API. I have registered an application in Azure AD (Web App/multi tenant) and added permissions to access SharePoint online. I want to use the "delegated user identity with OAuth" scenario where my app accesses OneDrive for Business via REST APIs using user impersonation. The permissions in the app's manifest like this: "oauth2Permissions": [ { "adminConsentDescription": "Allow the

skydrive System.Dynamic.DynamicObject

夙愿已清 提交于 2019-12-01 21:18:32
I'm trying to get a listing of all the folders for a signed in user on SkyDrive. LiveOperationResult operationResult = await client.GetAsync("me/skydrive/files"); dynamic result = operationResult.Result; I'd like to be able to do something like this: Dictionary<string, object> folderData = (Dictionary<string, object>)result; List<object> folders = (List<object>)folderData["data"]; foreach (object item in folders) { Dictionary<string, object> folder = (Dictionary<string, object>)item; if (folder["name"].ToString() == "Folder Name") { showToastMessage(folder["id"].ToString()); return; } }

OneDrive/SharePoint OAuth invalid audience error

◇◆丶佛笑我妖孽 提交于 2019-12-01 19:15:47
My goal is to write some code to enable an Office 365 user to access files in OneDrive for Business via REST API. I have registered an application in Azure AD (Web App/multi tenant) and added permissions to access SharePoint online. I want to use the "delegated user identity with OAuth" scenario where my app accesses OneDrive for Business via REST APIs using user impersonation. The permissions in the app's manifest like this: "oauth2Permissions": [ { "adminConsentDescription": "Allow the application to access AppName on behalf of the signed-in user.", "adminConsentDisplayName": "AppName", "id"

how to handle multiple tenants with onedrive picker

谁说胖子不能爱 提交于 2019-12-01 13:08:58
I am facing a problem with onedrive picker with https://js.live.net/v5.0/OneDrive.js I have different redirect url's like http://dev.example.com http://dev1.example.com by giving these two urls i am facing problem like this when i give redirect url it is not working. and i tried using https://js.live.net/v7.0/OneDrive.js while i am using this one in pop only the redirect url is loading and redirecting and closing the pop up i am not getting the call back success <script type="text/javascript" src="https://js.live.net/v5.0/OneDrive.js" id="onedrive-js" client-id="APP_ID"></script> <script type=

OneDrive API Node.js - Can´t use :/createUploadSession Content-Range Error

自闭症网瘾萝莉.ら 提交于 2019-12-01 11:58:47
My problem was that I couldn´t upload files bigger than 4MB so I used the createuploadsession according to createuploadsession I successfully get the uploadUrl value from the createuploadsession response. Now I try to make a PUT request with this code var file = 'C:\\files\\box.zip' fs.readFile(file, function read(e, f) { request.put({ url: 'https://api.onedrive.com/rup/545d583xxxxxxxxxxxxxxxxxxxxxxxxx', headers: { 'Content-Type': mime.lookup(file), 'Content-Length': f.length, 'Content-Range': 'bytes ' + f.length } }, function(er, re, bo) { console.log('#324324', bo); }); }); But I will get as

MS Graph API: OneDrive resource not found

时间秒杀一切 提交于 2019-12-01 11:27:29
I'm building a Windows service that connects to OneDrive for Business via the Graph API using this method: https://graph.microsoft.io/en-us/docs/authorization/app_only I've successfully authenticated my application and have a token for making calls to Graph API. I have given my Azure AD application permissions to both Windows Azure Active Directory and Microsoft Graph (all application and delegated permissions have been selected for both). My goal is to get the contents of a folder that resides in a specific user's OneDrive. I need to make the following Graph API call: //graph.microsoft.com/v1

Access publicly shared OneDrive folder via API

无人久伴 提交于 2019-12-01 10:38:16
I have a publicly shared OneDrive folder with some various sub-folders and files. I.e. I have shared it via a link, so anyone with this link can access them. Is there a way I can access these files from either client-side JavaScript or some server-side code via a REST API of some sort? Without having to use any sort of user-specific credentials? What I've been trying I've been looking at the Accessing Shared Content page, and it looks like what I want, but can't figure out how to use it. I've taken something that looks like an id from the shared URL, which looks to be a long hexadecimal number

Downloading a publicly-shared file from OneDrive

孤街浪徒 提交于 2019-12-01 08:42:15
问题 When I create a share link in the UI with the "Anyone with this link can view this item" option, I get a URL that looks like https://onedrive.live.com/redir?resid=XXX!YYYY&authkey=!ZZZZZ&ithint=<contentType> . What I can't figure out is how to use this URL from code to download the content of the file. Hitting the link gives HTML for a page to show the file. How can I construct a call to download the file? Also, is there a way to construct a call to get some (XML/JSON) metadata about the file

Get all SharePoint files and folders of a drive using Microsoft Graph API

岁酱吖の 提交于 2019-12-01 08:40:46
问题 My problem is: if I call https://graph.microsoft.com/v1.0/sites/{site-id}/drives/{drive-id}/root/children all I get are the top-level items of that drive. How can I achieve to get all the subfolders and files of the drive? 回答1: There's no endpoint to get all items in a drive with every file from every subfolder at once. Below endpoint maps to a test library MyDoc3. /sites/siteid/drives/{drive-id} Then, below endpoint use to get children of FolderA in MyDoc3. /sites/siteid/drives/{drive-id}

Convert to PHP REST CURL POST

落花浮王杯 提交于 2019-12-01 08:16:23
How can we convert this code to PHP REST CURL POST? POST https://apis.live.net/v5.0/me/skydrive/files?access_token=ACCESS_TOKEN Content-Type: multipart/form-data; boundary=A300x --A300x Content-Disposition: form-data; name="file"; filename="HelloWorld.txt" Content-Type: application/octet-stream Hello, World! --A300x-- $url = 'POST https://apis.live.net/v5.0/me/skydrive/files'; $ch = curl_init(); curl_setopt($ch,CURLOPT_URL, $url); curl_setopt($ch,CURLOPT_POSTFIELDS, array('access_token' => TOKEN, 'name' => 'file', 'filename' => "@HelloWorld.txt")); curl_setopt($ch, CURLOPT_RETURNTRANSFER, true