Sign up for Office 365
Learn more about Office 365
I introduced the Graph Explorer (http://graphExplorer.cloudapp.net) in my last post , as an easy to use tool to explore using the Graph API. Now I’d like to show a few extra filtering commands, so you get a feel for what is available from the Graph API. I find that by hand-writing these queries, it helps me to understand these queries in more detail, which helps to write and trouble shoot my code later on. So let’s show some examples:
1. https://graph.windows.net/contoso.com/users?$filter=department eq 'IT'&api-version=4/5/2013
Returns, users who are in the “IT” department.
2. https://graph.windows.net/Contoso.com/users?$filter=displayName ge 'A' and displayName le 'F'&api-version=4/5/2013
Returns users whose displayName fall within the range => “A” and <= “F”
Return users whose displayName starts with “Admin”
Returns a page of 100 user objects – if there are more users, then a skip token is returned, which can be used in the subsequent query, and combined with another $top= argument, to retrieve the next page of results. Maximum number objects to be specified is 999 – if $top is not specified, the default page size is 100.
Retrieves the thumbnail photo for a user – by default, user’s thumbnail photo is not returned as part of the user object due to size, but it can be explicitly requested as shown by this call.
Retrieve the user’s Manager – if the user has a manager, then the manager’s user object is returned. Similar request can be made using “/directReports”, returning a users’ direct reports.
Retrieves all users whose SMTP proxy address starts with “SMTP:AD” – users’ can have multiple SMTP proxy addresses, so this query will find all users based upon the query.
A quick note: $top, $filter, and comparators eq, ge, le are supported. The following are not supported at this time: $count, $expand, $select, $skip, $sort - something we're evaluating for future releases.
As you can see, there's some good flexibility to construct queries, and we'd like to continue building on top of this functionality. The Graph Explorer is a good tool to play with these queries, and can also be used as a quick reference/test tool.
Next, I'll show how to authenticate, and execute queries in Fiddler, and then jump into some basic C# code, and use a Graph Helper Class to assist with authentication and constructing the queries.
Lien he hotro.19006611.NguyenDucHiep.firstname.lastname@example.org.MicrosoftLabs.hai phong vn
241 Microsoft Team blogs searched, 59 blogs have new articles. 259 new articles found searching from
In my previous post, I showed some more advanced filtering capabilities using the Graph Explorer . The