Office 365 统一 API returns 只有 10 个联系人

Office 365 Unified API returns only 10 contacts

我正在为 Office 365 使用统一图 api v1.0,当我进行如下查询时:

https://graph.microsoft.com/v1.0/me/contacts

它 returns 我只有 10 个联系人。 但是当我这样做时:

https://graph.microsoft.com/v1.0/me/contacts/$count

我可以看到我有 943 个联系人

我试图通过以下方式强制 api returns 我的 943 联系人:

https://graph.microsoft.com/v1.0/me/contacts?$top=943

但我最多只能检索到 499 个联系人。

有什么方法可以一次检索它们,如果没有,我可以用什么方法对它们进行分页?

我的文档参考是:
http://graph.microsoft.io/docs/overview/query_parameters

http://graph.microsoft.io/docs/api-reference/v1.0/api/user_list_contacts

非常感谢您的帮助

您需要使用 $skipToken (Microsoft Graph optional query parameters) 对回复进行分页:

In some response, you'll see an @odata.nextLink value. Some of them include a $skipToken value. The $skipToken value is like a marker that tells the service where to resume for the next set of results. The following is an example of a @odata.nextLink value from a response.

"@odata.nextLink": "https://graph.microsoft.com/v1.0/users?$orderby=displayName&$top=3&$skiptoken=X%2783630372100000000000000000000%27"

For example, to return the next set of users in your organization, limiting the number to 3 at a time in the results, the syntax is as follows.

GET  https://graph.microsoft.com/v1.0/users?$orderby=displayName&$top=3&$skiptoken=X%2783630372100000000000000000000%27