I am trying to implement client side paging using the Microsoft OneDrive API / SDK. For this I need the total number of elements as a response from the API and based on the skip value and the maximum value passed to the API, the response should be received.
The List Items link mentions that we can achieve this using the query strings here . Based on this assumption, I create the URL of the API call, as shown 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 ok according to the information in the above URL, but I get a "Bad Request" message from the server with an 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 done using the REST API or the Microsoft Graph SDK?
PS: skipToken, , , .