Difference between $select and select query parameter

Macháček Martin 56 Reputation points
2022-09-08T13:00:13.567+00:00

In Graph Explorer I'm testing select query parameter to return all properties and webDavUrl property

GET /v1.0/drives/{driveId}/items/{itemId}?$select=webDavUrl  

select without $

GET /v1.0/drives/{driveId}/items/{itemId}?select=webDavUrl   
GET /v1.0/drives/{driveId}/items/{itemId}?select=*,webDavUrl  

return webDavUrl property.

But

GET /v1.0/drives/{driveId}/items/{itemId}?$select=*,webDavUrl  

doesn't return webDavUrl property.

Is this some expected behavior or a bug?

Microsoft Graph
Microsoft Graph
A Microsoft programmability model that exposes REST APIs and client libraries to access data on Microsoft 365 services.
911 questions
Microsoft Graph Files API
Microsoft Graph Files API
A Microsoft API to create an app that connects with files across OneDrive, OneDrive for Business, and SharePoint document libraries.
327 questions
{count} votes

1 answer

Sort by: Most helpful
  1. Srinivasa Rao Darna - MSFT 6,346 Reputation points Microsoft Vendor
    2022-09-08T13:21:09.457+00:00

    Hi @Macháček Martin ,

    As per documentation query-parameters,
    On the /beta endpoint, the $ prefix is optional. For example, instead of $filter, you can use filter. On the v1 endpoint, the $ prefix is optional for only a subset of APIs. For simplicity, always include $ if using the v1 endpoint.

    Hence the same is applicable to select query parameter, $select is recommended to use for v1.

    239105-image.png

    Hope this helps.
    If the answer is helpful, please click "Accept Answer" and kindly upvote it. If you have extra questions about this answer, please click "Comment".