Getting OneDrives by OneDrive ID

In this article

    You can get a resource representation of OneDrive with the specified ID that belongs to an organization user with the specified ID.

    Request

    GET https://<hostname>:4443/v6/Organizations/{organizationId}/Users/{userId}/OneDrives/{oneDriveId}

    Request Headers

    The request header must contain an authorization token of the current session.

    Request Parameters

    The following parameters must be specified in the URL of the request:

    Parameter

    Type

    Description

    organizationId

    string

    Specifies the identification number of the Microsoft 365 organization. For more information on how to get this parameter, see Getting Organizations.

    userId

    string

    Specifies the identification number of the user. For more information on how to get this parameter, see Getting Organization Users.

    oneDriveId

    string

    Specifies the identification number of OneDrive. For more information on how to get this parameter, see Getting OneDrives.

    Request Body

    None.

    Response

    The server returns the following response to the client.

    Response Codes

    A successfully completed operation returns a response code 200 OK.

    Response Headers

    The response to this request contains the following headers. The response may also include additional standard HTTPS headers.

    Header

    Description

    Content-length

    The length of the response body.

    Content-type

    The media type and syntax of the response body message: application/json; charset=utf-8

    Response Body

    The response body contains the following properties:

    Property

    Type

    Description

    id

    string

    Specifies the OneDrive ID.

    url

    string

    Specifies the OneDrive path.

    name

    string

    Specifies the OneDrive name.

    _links

    Dictionary of string [key] and Object [value]

    Links to related resources (navigation property).

    Example

    The example returns a resource representation of the OneDrive with the ID 18113f79-5344-43bf-962c-44dfdd4160db70e7bee3-08ea-48ac-ba1a-16863f06e1e2 that belongs to the organization user with the ID f8ec2f9d-d5af-4776-9084-014a048a77c400000000-0000-0000-0000-000000000000.

    Request:

    GET https://abc.tech.local:4443/v6/Organizations/e60dfb9c-ac58-4463-879f-9855ac35576b/Users/f8ec2f9d-d5af-4776-9084-014a048a77c400000000-0000-0000-0000-000000000000/OneDrives/18113f79-5344-43bf-962c-44dfdd4160db70e7bee3-08ea-48ac-ba1a-16863f06e1e2

     

    Request Header:

    Authorization: Bearer <Access-Token>

     

    Response:

    200 OK

     

    Response Body:

    {

     "id": "18113f79-5344-43bf-962c-44dfdd4160db70e7bee3-08ea-48ac-ba1a-16863f06e1e2",

     "name": "User 1",

     "url": "https://abc-my.sharepoint.com/personal/user1_abc_onmicrosoft_com",

     "_links": {

       "self": {

         "href": "v6/organizations/e60dfb9c-ac58-4463-879f-9855ac35576b/users/f8ec2f9d-d5af-4776-9084-014a048a77c400000000-0000-0000-0000-000000000000/onedrives/18113f79-5344-43bf-962c-44dfdd4160db70e7bee3-08ea-48ac-ba1a-16863f06e1e2"

       },

       "user": {

         "href": "v6/organizations/e60dfb9c-ac58-4463-879f-9855ac35576b/users/f8ec2f9d-d5af-4776-9084-014a048a77c400000000-0000-0000-0000-000000000000"

       }

     }

    }