Update 2 on the Office 365 unified API

Office Add-ins team

Following up on our recent post, today we are announcing another set of breaking changes in the preview (/beta) of Office 365 unified API. This changes will roll out on 10/19 at 12:00pm PST, after that if your code has been accessing files for either users or groups, those requests will most likely break. Please take note of this so you can update your code as soon as the change is released.

First, the /beta endpoint of Office 365 unified API will now target OneDrive API for OneDrive for Business files and group files. There are significant changes between Files API and OneDrive API. You can learn more about OneDrive API in http://dev.onedrive.com. With this update the /files navigation property will be no longer available under users or groups. Now to get access to all items (files, folders, images, etc) that are under the user’s OneDrive, or a given group, you need to reference the root resource /drive and then enumerate the children under that collection. Here is an example on how to get the items under the default drive for the user:

  GET https://graph.microsoft.com/beta/me/drive/root/children  HTTP/1.1  Authorization: Bearer …  Content-Type: application/json  Response:  HTTP/1.1 200 OK  {    "@odata.context": "https://graph.microsoft.com/beta/microsoft.com/$metadata#users('yinaa%40contoso.com')/drive/root/children",    "value": [      {        "@odata.type": "#Microsoft.Graph.item",        "@odata.id": "users/yinaa%40microsoft.com/drive/root/children/01IA7XGM3",        "@odata.etag": ""{B137FA94-F084-49A9-BCD4-C28DC2529A1B},7"",        "createdBy": {          "user": {            "id": "48d4f951-709d-4c13-81da-a111afbdcda2",            "displayName": "Yina Arenas"          }        },        "createdDateTime": "2014-12-17T00:04:27Z",        "cTag": ""c:{B137FA94-F084-49A9-BCD4-C28DC2529A1B},5"",        "eTag": ""{B137FA94-F084-49A9-BCD4-C28DC2529A1B},7"",        "file": {},        "id": "01IA7XGM3",        "lastModifiedBy": {          "user": {            "id": "48d4f951-709d-4c13-81da-a111afbdcda2",            "displayName": "Yina Arenas"          }        },        "lastModifiedDateTime": "2014-12-17T00:04:47Z",        "name": "ThisIsAFile.docx",        "parentReference": {          "driveId": "b!NiG9WWhUokyk3jNpREAnSpXVWdyrs1lHpqFf_pcIfvKyL03US8kTRKXhiC25cvQv",          "id": "01IA7XGM3",          "path": "/drive/root:"        },        "size": 18846,      }      …    ]  }  

All the documentation for OneDrive API is here. With this change the Office 365 unified API now targets the converged API between OneDrive and OneDrive for Business. Make sure to check the release notes for OneDrive for Business as it also applies for its exposure in Office 365 unified API. There are some additional functionality gaps that we are addressing soon, including support for $expand and support for navigating to items using colon notation.

The next change in this update is to contacts. With this change you’ll be able to get personal and organizational contacts (previously this was only organizational contacts).

Remember Office 365 unified API is currently in preview, we are working hard to release it soon, as part of this we will continue making some changes, including breaking changes, in /beta to incorporate feedback and improve the API as we get ready for V1.0.

Please continue to provide your feedback and questions via stackoverflow and uservoice. Thank you for your input and happy coding

~ Yina Arenas for the Office 365 unified API team

Feedback usabilla icon