I am trying to implement client side paging using Microsoft OneDrive API/SDK. For that I need the total count of items as response from the API, and based on the skip and maximum limit value passed to the API, the response should be fetched.
In the List Items link, it is mentioned that we can achieve this using the query strings provided here. Based on this assumption, I am building the URL for API call as below:
string.Format("https://graph.microsoft.com/v1.0/me/drive/root/children?$skip={0}&$top={1}&$count=true",topValue*page, topValue)
Everything seems to be fine as per the info in the above mentioned URL, but I am getting "Bad Request" from the server with error message as shown below:
{
"error": {
"code": "",
"message": "The query specified in the URI is not valid. Query option 'Skip' is not allowed. To allow it, set the 'AllowedQueryOptions' property on EnableQueryAttribute or QueryValidationSettings.",
"innerError": {
"request-id": "384693d7-65bd-4dc6-8d60-afde68e01555",
"date": "2017-04-25T10:28:15"
}
}
}
{
"error": {
"code": "",
"message": "The query specified in the URI is not valid. Query option 'Count' is not allowed. To allow it, set the 'AllowedQueryOptions' property on EnableQueryAttribute or QueryValidationSettings.",
"innerError": {
"request-id": "2188a06f-10cf-402c-9c49-bd296b9db614",
"date": "2017-04-25T10:29:05"
}
}
}
Can this be achieved using REST APIs or Microsoft Graph SDK?
PS: I saw the concept of skipToken but that won't fit into our requirements as it does not return the total count and only incremental navigation is supported.