The $orderby parameter is used to sort the results by the receivedDateTime field.The $top parameter is used to specify a maximum of 25 items.The $select parameter is used to specify only the subject, from, and receivedDateTime fields.To achieve this, the app uses the following query parameters: The table displays a maximum of 25 rows, and should be sorted so that the most recently received message is at the top. The table only displays the subject, sender, and the date and time the message was received. Let's look at an example.Ĭonsider an app that displays messages in a table. It is recommended that apps use these parameters to limit the number of results that are returned and to limit the fields that are returned for each item. Refining the requestĪpps can control the behavior of GET requests by using OData query parameters. This will retrieve messages from the inbox. Since the app is retrieving messages, it will use an HTTP GET request to the URL. The Mail API Reference has all of the details. Once the app has an access token, it's ready to call the Mail API. Use one of the supported OAuth 2.0 flows to obtain an access token. In order to call the Mail API, the app requires an access token from the Microsoft identity platform. With the information in this guide, you can implement this in any language or platform capable of sending HTTP requests. You should use the Outlook APIs directly (via ) only if you require a feature that is not available on the Graph endpoints. Microsoft recommends using Microsoft Graph to access Outlook mail, calendar, and contacts. This tutorial will use Microsoft Graph to call the Mail API. It will cover the sequence of requests and responses that an app uses to authenticate and retrieve messages. Unlike the platform-specific getting started guides, this guide focuses on the OAuth and REST requests and responses. The purpose of this guide is to walk through the process of calling the Outlook Mail API to retrieve messages in Office 365 and. We'll go through the same set of steps using raw HTTP requests. If your preferred platform isn't listed yet, continue reading on this page. We'll guide you through the steps to write a simple application to retrieve messages from your inbox. Once you're done exploring the API, come back here and select your favorite platform on the left. You can use your own account, or one of our test accounts. ![]() Try out sample REST calls in the Graph Explorer.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |