question

RufengXuFriedman-5115 avatar image
0 Votes"
RufengXuFriedman-5115 asked RufengXuFriedman-5115 answered

What is skipToken in QueryRequestOptions

Hi I am using ResourceGraphClient, the default returns 1000 records.

The document says it could return up to 5000, and it can be controlled by options with top, skip and skipToken.

How do I get skipToken ?

Here is the link I am referring to ?
https://docs.microsoft.com/en-us/javascript/api/@azure/arm-resourcegraph/queryrequestoptions?view=azure-node-latest#skipToken

With az graph, I can get default 5000 records. But I do not know how to get 5000 records with sdk ResourceGraphClient ?

Could someone please give me an example ?

microsoft-graph-sdk
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

DianaWanjuhi-1579 avatar image
0 Votes"
DianaWanjuhi-1579 answered

Hello @RufengXuFriedman-5115 Thank you for reaching out. When a result set spans multiple pages, Microsoft Graph returns an`@odata.nextLink` property in the response that contains a URL to the next page of results . This will look like this:

132377-skiptokenquery.png

You can retrieve the next page of results by sending the URL value of the @odata.nextLink property to Microsoft Graph. Depending on the API that the query is being performed against, the @odata.nextLink URL value will contain either a $skiptoken or a $skip query parameter. The URL also contains all the other query parameters present in the original request. Do not try to extract the $skiptoken or $skip value and use it in a different request.

From the documentation you shared, the Query Response contains the skiptoken property which can be passed on to subsequent requests. In your case, the response containing the first 1000 records will contain this value that you can use to get the next page of results.


Let me know whether this helps and if you have further questions,

Diana.



skiptokenquery.png (91.3 KiB)
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

RufengXuFriedman-5115 avatar image
0 Votes"
RufengXuFriedman-5115 answered

Thank you so much !
I understand now. The value $skiptoken is the response. I wish the document says something about it, as I could not understand what $skiptoken means. The doc only says "str". It would be better if it mentions that this is one the parameter from the return response.

Thanks for your response.

5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.