Office 365 Files REST API - Get direct children in the root of the default document library

I'm trying to work with Office 365 Files REST API which works just fine except one thing that I'm struggling with.
What I need for my application is to make an explorer like browse capability for OneDrive for business Document Library.
My problem is that I don't know how to get the direct children in the root of the Document library
The API request
GET ../_api/files will
retrieve all files and folders in the default document library, including files and folders from sub-directories.
What I need is basically the functionality of the API request
GET ../_api/files(<folder_path>)/Children
that works also for the root folder of the Document library. The problem is that I couldn't find a way set <folder_path> as the root folder. 
I found out that the API call ../_api/web/getfolderbyserverrelativeurl(<folder_server_relative_path>)/Folders and _api/web/getfolderbyserverrelativeurl(<folder_server_relative_path>)/Files works as expected resulting the only the direct
children of the root folder if the folder_server_relative_path is the path of the document library. The problem with this API call is that it's requires server relative path of the (default) document library (which i don't have) and the result has a different
schema compared to the ../_api/files REST API call.
Can somebody help me with this problem?
David

First thanks for the fast answer. Let me explain my use case in more details.
I'm trying to work with the new summer release of the
Office 365 API tool for Visual Studio 2013 (update 3)
I found no reasonable way to retrieve the direct children of the root folder from my One Drive for business Document Library using the newly added SharePointClient library.
The API call of `SharePointClient.Files` will retrieve all the files and folders from the whole document library including sub-folders. So in order to get only the direct children I have to page through all the documents and folders and analyze their URL, which
is not acceptable for my application scenario. For a sub-folder I can get the direct children like this: `SharePointClient.Files["<folder_id>"].ToFolder().Children` This is what I need but it can't be applied to the root folder.
So what I did I've checked what REST API calls this library makes and I've tried to find out if there is a way to achieve my goal at least using direct REST API call. It seems like the functionality is missing from the REST API itself. 
The http://site
url/_api/web/lists/GetByTitle(‘libraryname’)/items API call also retrieves all the items hierarchy from the library (including items from sub-folders) and the result XML "schema" (fields and the meaning of the ID) differs from the one used
by the calls by SharePointClient library. (for example the "Id" is a number when the /items is called but when
/_api/files is called the "Id" is the relative path to the document library)
Basically what I need can be achieved with the call to http://site url/_api/web/lists/GetByTitle(‘libraryname’)/rootfolder/files and http://site
url/_api/web/lists/GetByTitle(‘libraryname’)/rootfolder/folders but again the schema of the result differs from the one used in SharePointClient
library. This means that in order to get  the direct children of the root I will need to re-implement a good part of the SharePointClient library. It seams like there is 2 kind of REST API is implemented. ( missing  "Id" and "url"
fields, etc)
Also there is no convenient way to get the Name or the GUID of the default document library which the SharePointClient.Files
(https://site_url/_api/file) automatically
uses. The DiscoveryContext.DiscoverCapability for "MyFiles" doesn't gives any hint either.
David

Similar Messages

  • Office 365 Files REST API and chunked upload

    Hello,
    I am currently working on integration with OneDrive for Business and I need to upload large files in chunks. I need to do something like  this but using
    the O365 Files REST API. As far as I understand this is currently not supported.
    Are there any plans to support
    uploading in chunks? If yes, can you please provide some (rough) estimate?
    Thanks
    Andrey

    Thank you for the quick answer!
    We are trying to upload the files using javascript and we are currently working with this API:
    https://msdn.microsoft.com/en-us/office/office365/api/files-rest-operations
    We have also noticed that the roadmap for Office 365
    http://roadmap.office.com/en-us contains SharePoint API Partial File Upload Support. 
    Does the update pointed in the roadmap refer to the API we are using? Or if you are saying we can already do chunked upload using it, can you please point us to a working sample?
    Thanks
    Andrey

  • How to Get user profile properties in provider -cloud hosted app in sharepoint online - office 365 using REST API?

    How to Get user profile properties in provider -cloud hosted app in sharepoint online - office 365 using REST API?
    any idea?

    Hi,
    From your description, my understanding is that you want to get user profile properties in provider-hosted app in SharePoint online using REST API.
    Here is sample code for getting user profile properties:
    http://www.vrdmn.com/2013/07/sharepoint-2013-get-userprofile.html
    Here is a blog below about accessing data from the provider-host apps:
    http://dannyjessee.com/blog/index.php/2014/07/accessing-sharepoint-data-from-provider-hosted-apps-use-the-right-context/
    Best Regards,
    Vincent Han
    TechNet Community Support
    Please remember to mark the replies as answers if they help, and unmark the answers if they provide no help. If you have feedback for TechNet Support, contact
    [email protected]

  • Adobe pdf can not be completedly displaced by Adobe reader XI while it is inserted into a Excel2013(office 365) file

    adobe pdf can not be completedly displaced by Adobe reader XI while it is inserted into a Excel2013(office 365) file

    Sorry
    should be “displaying”
    Like when open a drawing pdf which is inserted into Excel(office 365) as an object, some lines, dimensions with remark can not be displayed and only few graph can be displayed.
    But if the drawing is a separate PDF file, not inserted into Excel(office 365)as an object, the Adobe XI reader can always open it with all graphs, figures, texts, lines etc. smoothly.
    发自 Windows 邮件
    发件人: Claudio González
    发送时间: 2014年10月13日, 星期一 17:38
    收件人: Alex Ye
    adobe pdf can not be completedly displaced by Adobe reader XI while it is inserted into a Excel2013(office 365) file
    created by Claudio González in Adobe Reader - View the full discussion 
    Please explain in full detal what you are trying to do and what happens when you try. I don't understand what you mean by "displacing a pdf (file?)".
    Please note that the Adobe Forums do not accept email attachments. If you want to embed a screen image in your message please visit the thread in the forum to embed the image at https://forums.adobe.com/message/6819113#6819113
    Replies to this message go to everyone subscribed to this thread, not directly to the person who posted the message. To post a reply, either reply to this email or visit the message page:
    To unsubscribe from this thread, please visit the message page at . In the Actions box on the right, click the Stop Email Notifications link.
    Start a new discussion in Adobe Reader by email or at Adobe Community
    For more information about maintaining your forum email notifications please go to http://forums.adobe.com/thread/416458?tstart=0.

  • FILES REST API url to list specific folder content

    I need to retrieve the items/documents in a specific folder of our Office 365 hosted SharePoint site, but I always get an resource error. I'm trying to use the FILE REST API for this, documented here:
    https://msdn.microsoft.com/office/office365/APi/files-rest-operations
    The url to the SharePoint site with the files is
    https://informationresourcemanager.sharepoint.com/irm/fido/1074/Forms/AllItems.aspx
    and according to the MSDN documents the call should be
    GET {base-url}/Files/{folder-id}/children
    and "base-url" should in the case of SharePoint be
    https://{tenant}.sharepoint.com/{site-path}/_api/v1.0
    Now, I've tried 10 different combinations without getting any good results, so I guess I'm doing something wrong with the base-url or the site-path. Is the correct base-url this for my site
    https://informationresourcemanager.sharepoint.com/irm/fido/_api/v1.0/
    or just
    https://informationresourcemanager.sharepoint.com/irm/_api/v1.0/
    /Johan

    Hi,
    According to your description, my understanding is that you want to get all the content in a specific folder using Office 365 rest api.
    For the base url, it needs to specify the site collection name in the url. In my environment, I have a site collection called "ZhengyuGuo", so we can get all the file in such site collection like below firstly:
    https://xxx.sharepoint.com/sites/zhengyuGuo/_api/v1.0/files/
    Then you can get the content in a specific folder using the "getByPath" method like below, in my environment, I will get the all file contents in document library folder.
    https://xxx.sharepoint.com/sites/zhengyuGuo/_api/v1.0/files/getByPath('/')/children
    The json data return like the capture below:
    Thanks
    Best Regards,
    Jerry Guo
    TechNet Community Support
    Please remember to mark the replies as answers if they help, and unmark the answers if they provide no help. If you have feedback for TechNet Support, contact
    [email protected]

  • Ctrl+S and file save just get ignored and I have to close the file to save docs

    I am using DW CS5.5.
    Ctrl+S and file>save just get ignored and I have to close the file to save docs.
    Any ideas? Thanks

    "If this configuration folder is the one in the Program Files hierarchy, you may have shot yourself in the foot.  Never mess with those."
    I had a neighbor one time who was annoyed that "that darn bolt on the bottom of my engine" kept scraping on the curb when he'd pull in or out of his driveway, so he ground it down till it was flat with the oil pan. It wasn't till about a year later when he took the car in to have the oil changed that he realized the error of his ways. Cost him $500 to have the pan pulled and replaced.
    If you don't know what it does, find out first or leave it alone.

  • New iMac. Flash drive is primary for OS and apps.  I want to use my HD 2 (1 TB hard drive) for my bulky photo and music files.  Can I direct iPhoto and iTunes to use the larger hard drive as the primary target when importing?

    New iMac. Flash drive is primary for OS and apps.  I want to use my HD 2 (1 TB hard drive) for my bulky photo and music files.  Can I direct iPhoto and iTunes to use the larger hard drive as the primary target when importing?

    Yes.  Unfortunately, I don't know the specifics because I don't use iPhoto anymore and I completely copied over 15 years of MP3 files recently when I installed 10.7.  Needless to say, I have not opened iTunes since and probably never will again - not because of iTunes but because of my stupidity.  I did have some of the files backed up but I hadn't backed up in a while.......anyway....
    When I imported my CD's, I had them go directly to my external firewire.  I can't remember exactly how to set it, but in the preference section of iTunes you can specify an import destination to any drive that's available to your machine.  I did this with iPhoto as well way back at one point when I was using Tiger, but I don't remember the specifics on that either.  I can't imagine they would have discontinued support for that feature since then. 
    Sorry I couldn't help more.

  • How to Get Choices as a Dropdown from a different Column for the same Item In a Document Library?

    Hello All,
    I was trying to see if there is any way that we can get the choices for a Field from another filed in the same item in a Document Library.
    To be specific.
    I have Created a Project Document Set, Which has a Column called "Project Members" where all the members will be listed. This will be inherited to all the documents in that Project Document Set. This is used to grant Permission using Workflow.
    I also have "Document Members" Column(This is only for Documents) who will be given Edit permissions to that Document using a Workflow. This can be any type of column(choice, People or Group etc) As long as I can select multiple values.
    I am looking for a way to get the "Project Members"(Values or Users) as choices for "Document Members". I know this is possible in the List as you can customize in the InfoPath Form. But not sure in the Document Library.
    Document Members can only be the members from the Project Members, In order to grant granular Permissions for the project And Documents using a Workflow
    Document Library
    Project Document Set Name
    File Name
    Project Members
    Document Members
    Project A
    User1;User2;User3
    Doc1
    User1;User2;User4
    User1;
    Doc2
    User1;User2;User5
    User1;User2;
    Doc3
    User1;User2;User6
    User1;User2;User3;
    Project B
    User5;User6;User7;
    Doc1
    User5;User6;User7;
    User7;User5
    Doc2
    User5;User6;User7;
    User7;User5
    Doc3
    User5;User6;User7;
    User5;User6;User7;
    Thanks for your time.

    >
    Jenny Karunakaran wrote:
    > Hi Jung,
    >
    > Thanks for the reply. But I dont know how to assign value set to this attribute(i.e. Context atribute to which filter value property is bound). Can I use a supply function for this ?
    >
    >
    > Regards,
    > Jenny
    No. A value set and a supply function are two completely different things. You use this Context API to populate the value set for an attribute:
    IF_WD_CONTEXT_NODE_INFO=>SET_ATTRIBUTE_VALUE_SET
    Value Sets are also how ByKey UI elements (like the DropDownByKey) are built.  Here is a help document that discusses value sets - but in the context of the ByKey UI elements.  The process is the same for creating the value set however:
    http://help.sap.com/saphelp_nw70ehp1/helpdata/en/bb/69b441b0133531e10000000a155106/frameset.htm

  • Accessing files outside the root of the site.

    Hi All
    On my web host space I have access to a directory outside the
    root of the
    website i.e. "private"
    I want to store files there for download after users have
    purchased them.
    I want to put them here to stop people ripping the files off
    by guessing the
    link or useing a website copier.
    What I plan to do is send a link to the user via email, this
    link will then
    go to a download page which records the user has accessed the
    file and then
    have the page automatically download the file.
    I can do this no problem if I have the files in a directory
    under the root
    of the site but how can I link to the files outside the root?
    TIA
    Bren
    Why do I climb mountains? Simple! because they are there
    www.3peakschallenge.co.uk

    Sorry forgot to mention I am using ASP VB
    Cheers
    Bren
    "Bren" <[email protected]> wrote in message
    news:ejgd9n$427$[email protected]..
    > Hi All
    >
    > On my web host space I have access to a directory
    outside the root of the
    > website i.e. "private"
    > I want to store files there for download after users
    have purchased them.
    > I want to put them here to stop people ripping the files
    off by guessing
    > the link or useing a website copier.
    > What I plan to do is send a link to the user via email,
    this link will
    > then go to a download page which records the user has
    accessed the file
    > and then have the page automatically download the file.
    > I can do this no problem if I have the files in a
    directory under the root
    > of the site but how can I link to the files outside the
    root?
    >
    > TIA
    > Bren
    > --
    > Why do I climb mountains? Simple! because they are there
    > www.3peakschallenge.co.uk
    >

  • Office 365 API with Visual studio 2013 using file REST API

    Hi,
    I had configured MVC application for getting files from office 365 one drive, I am able to seen all file on last day but Now I am getting below issue 
    <?xml version="1.0" encoding="utf-8"?><m:error xmlns:m="http://schemas.microsoft.com/ado/2007/08/dataservices/metadata"><m:code>-1, System.ApplicationException</m:code><m:message xml:lang="en-US">Error
    in the application.</m:message></m:error>
    when I want to see again all files. and most important I didn't make any changes in my previous code...
    Please share your suggestion....

    Hi,
    If you are developing an app for SharePoint, the app can call into a user’s MySite site collection and access their OneDrive for Business documents using REST or CSOM.
    The REST call to get to the file would be:
    https://YourO365DomainHere-my.sharepoint.com/personal/YourUserName_YourO365DomainHere_onmicrosoft_com/_api/web/GetFileByServerRelativeUrl('/personal/YourUserName_YourO365DomainHere_onmicrosoft_com/Documents/Shared%20with%20Everyone/myDocument.docx')/$value
    More information is here:
    http://blogs.msdn.com/b/sharepointdev/archive/2013/08/13/access-skydrive-pro-using-the-sharepoint-2013-apis.aspx
    Best regards
    Dennis Guo
    TechNet Community Support

  • Office 365 files api with php not responding.

    I am trying to access OneDrive for Business using the office 365 rest api. Our code is in php and we can access email, contacts etc fine but the files api doesn't return any kind of response to our requests. We already have a combine access token from
    the consent process. I do get a Unknown SSL protocol error in connection to ... error from curl but thats all. Can anyone help?

    Hi,
    As this question is more relate to Office 365 and PHP development, I suggest you post it to Office 365 or PHP Forum, you will get more help and confirmed answers from there.
    Or use the Fiddler to monitor the requests and responses data.
    http://www.telerik.com/fiddler
    Best Regards
    TechNet Community Support
    Please remember to mark the replies as answers if they help, and unmark the answers if they provide no help. If you have feedback for TechNet Support, contact
    [email protected]

  • Office 365 files won't open from network drive

    I can’t open any office  documents from a mapped network drive. I can however go to file explorer and go straight the server directory (\\servername\share) and open any document. As a workaround, I created a shortcut on the desktop that points
    to the share to allow the user to continue working.
    I have checked permission and added the path in Trust Center. I know it’s not the computer because I have logged in with other users and everything works fine. I have also logged into other computer with the user that is having the problem and again
    everything works. I'm convinced it some setting I'm missing within the user profile on the computer.
    windows 7 x64
    office 365 bussiness

    Hi,
    This is the forum to discuss questions and feedback for Microsoft Office, the issue is more related to the user profile. I'll move your question to Windows server forum.
    http://social.technet.microsoft.com/Forums/windowsserver/en-US/home?forum=winservergen
    The reason why we recommend posting appropriately is you will get the most qualified pool of respondents, and other partners who read the forums regularly can either share their knowledge or learn from your interaction with us. Thank you for your understanding.
    George Zhao
    TechNet Community Support

  • Office 365 files do not open

    I recently loaded Office 365 on my Windows 7 desktop.  I cannot open any file created in Excel by doubleclicking on the file.  I have used the repair function many times, uninstalled the previous version of Office -- no good.  I cannot open
    Word documents by doubleclicking on the file, but I can open them by opening Word first, then browsing for the file.  
    If I try to open an Excel file by doubleclicking it, nothing happens.  If I try to open it after opening Excel, the file will briefly flash on the screen and then the program crashes.  I could open Excel files created in Office 365 by opening Excel
    2007, then opening the file from Excel 2007.  That's not an option now, as I have uninstalled Excel 2007.
    I have tried to run Excel/exe/regserver, and get the error message "Windows cannot find 'Excel.exe/regserver.'  Make sure you typed the name correctly, and then try again."
    I see that this seems to be a fairly common issue, but I can't find any solution that lets me open Excel files.  Hoping that you have a better solution.

    Hi,
    When uninstalling an Office version while leaving another version installed on the computer, you should repair the version of Office remaining after the uninstallation process, to make sure that file type associations will work correctly.
    If you choose to re-register the application, as Diane mentioned above, please note the space in the command.
    Thanks,
    Ethan Hua CHN
    TechNet Community Support

  • Project 2013 REST API - getting all tasks assigned to a user

    I'm trying to get all tasks assigned to a user to display something like you would see in "My Tasks" using the REST API.
    I found this: http://social.technet.microsoft.com/Forums/projectserver/en-US/a5d8760d-8e27-432b-8187-592cadf302ae/get-my-tasks-tasks-via-rest-api-or-web-services?forum=sharepointdevelopment
    But it doesn't seem to pertain to Project 2013.
    Any idea on how I could do this?
    As an aside, I'm having some trouble with finding guidance in the documentation. Are there any Project 2013 developer resources that break things down a little more than the SDK? Everything I've found is pretty Sharepoint-centered, not really getting into
    the specifics of Project.

    Check the samples folder which gets installed with SDK, there you will find some samples, however may not be the REST but with CSOM you could try something like this, i am sure you would be able to convert this pretty easily, in case required
    projContext = new ProjectContext(pwaPath);
    var PrjList = projContext.LoadQuery(projContext.Projects.Where(Prj => Prj.Name == newProjName));
    projContext.ExecuteQuery();
    var GotPrj = PrjList.First();
    //DraftProject projCheckedOut = GotPrj.CheckOut();
    projContext.Load(GotPrj.Tasks);
    projContext.ExecuteQuery();
    foreach (var tsk in GotPrj.Tasks)
    this.textBox1.Text += Environment.NewLine + "Task Name: " + tsk.Name + " || Task Work: " + tsk.Work +" || Task Remaining Work: " +tsk.RemainingWork;
    projContext.Load(tsk.Assignments);
    projContext.ExecuteQuery();
    foreach (var tskAssgn in tsk.Assignments)
    projContext.Load(tskAssgn.Resource);
    projContext.ExecuteQuery();
    this.textBox1.Text += Environment.NewLine + tskAssgn.Resource.Name + "--Res ID--" + tskAssgn.Resource.Id +
    "----Assgn ID: " + tskAssgn.Id + " || Actual Work: " + tskAssgn.ActualWork +
    " || Assgn Remaining Work: " + tskAssgn.RemainingWork
    + " || Assgn minDate: " + tskAssgn.Start
    + " || Assgn maxDate: " + tskAssgn.Finish
    Thanks | epmXperts | http://epmxperts.wordpress.com

  • Office 365 Reseller - Provision of new Office 365 business using API's?

    Hi,
    I couldn't work out which category to put this into. We have built our own provisioning and billing portal which is currently used to provision phone services. We currently resell hosted exchange and are looking to resell Office 365. Are there any API's
    available for Office 365 for the creation, management, deletion of businesses and users within that business. We want all of the functionality of the office 365 partner and admin portal but we want all tasks to be completed within our own provisioning portal
    using API calls to the office 365 admin tools?
    For example, you can purchase office 365 from the godaddy website, we want to be able to do that.
    Thanks.

    Hi,
    Could anyone advise on this matter ?
    Thanks,
    Kind regards.

Maybe you are looking for

  • Immediate help required with decode statement in scheduling jobs

    Hi Iam trying to change a job that runs my procedure using dbms_job.. Here is the output I got. Can someone help me why this is giving me errors. <code> SQL> exec dbms_job.next_date(395,decode(sign(substr(to_char(sysdate,'dd/mm/yy hh24:mi'),10,2)-17)

  • How do I get rid of "Apple Photo Streams.exe has stopped working" on Windows 7

    The error message "Apple Photo Stream.exe has stopped working" keeps popping up when I start my PC which has a 64 bit Windows 7 OS. How do I get rid of this?

  • Installing Oracle R12 Express Installation

    Dear All, Is it possible to install Oracle R12 Express Installation on Windows XP SP2 which is on a WorkGroup and not a part of Domain. How to convert the Workgroup into Domain. Please Guide. Regards Hitesh Parsawala

  • Macbook late 2007 can't use remote disc

    Snow Leopard retail disc won't load so I'm trying to do remote install.  I can see remote disc under devices but when I Boot with option key pressed there is no option for the remote disc to boot to.  I'm connected via ethernet to a windows 7 compute

  • Publishing desktop calendar to Mobile Me : error message

    Hi, I have been trying to publish a calendar created by ICal which is in my "On my Mac" folder and not in " XXXX Mac"to my Mobile Me account. These are all the messages I am getting, but I can't figure out what the problem is. FYI, I am using OS X 10