diff --git a/README.md b/README.md index 3c9bef87760..ea246b362dc 100644 --- a/README.md +++ b/README.md @@ -61,7 +61,7 @@ $tokenRequestContext = new AuthorizationCodeContext( ``` Note that your application will need to handle redirecting the user to the Microsoft Identity login page to get the `authorization_code` that's passed into the `AuthorizationCodeContext`. [See](https://docs.microsoft.com/en-us/azure/active-directory/develop/v2-oauth2-auth-code-flow) for more on the `authorization_code` grant flow. -To keep your user signed in across multiple requests within a session, see section on [access token management](docs/Examples.md#access-token-management) +To keep your user signed in across multiple requests within a session, see section on [access token management](docs/authentication_samples.md#access-token-management) ### Initialize a GraphServiceClient @@ -79,9 +79,9 @@ $scopes = ['User.Read', 'Mail.ReadWrite']; $graphServiceClient = new GraphServiceClient($tokenRequestContext, $scopes); ``` -To initialize the `GraphServiceClient` with an already acquired access token or to retrieve the access token that the SDK fetches on your behalf, see section on [access token management](docs/Examples.md#access-token-management). +To initialize the `GraphServiceClient` with an already acquired access token or to retrieve the access token that the SDK fetches on your behalf, see section on [access token management](docs/authentication_samples.md#access-token-management). -For more on Graph client configuration, see [more examples](docs/Examples.md#creating-a-graph-client) +For more on Graph client configuration, see [more examples](docs/authentication_samples.md#creating-a-graph-client) ### Call Microsoft Graph using the v1.0 endpoint and models @@ -142,7 +142,7 @@ try { * [Documentation](docs/README.md) -* [Examples](docs/Examples.md) +* [Examples](docs/README.md#using-the-sdk) * [Microsoft Graph website](https://aka.ms/graph) diff --git a/UPGRADING.md b/UPGRADING.md index c90d963d620..927045b388e 100644 --- a/UPGRADING.md +++ b/UPGRADING.md @@ -67,22 +67,22 @@ respects the `Retry-After` header values. It also exponentially backs-off should This would be mostly helpful for handling [throttling scenarios](https://docs.microsoft.com/en-us/graph/throttling) on the Microsoft Graph API. -See [this example](docs/Examples.md#customizing-middleware-configuration) on how to customize middleware. +See [this example](docs/general_samples.md#customizing-middleware-configuration) on how to customize middleware. ## Improved support for paged collections For performance reasons, collections of entities are often split into pages and each page is returned with a URL to the next page. The `PageIterator` class simplifies consuming of paged collections. `PageIterator` handles enumerating the current page and requesting subsequent pages automatically. -See [this example](docs/Examples.md#paging-through-a-collection) +See [this example](docs/general_samples.md#paging-through-a-collection) ## Support for Batch Requests Combine multiple requests in a single call with ease. Up to 20 individual requests can be batched together to reduce network latency of making each request separately. The `BatchRequestBuilder` allows you to make requests to the `/$batch` endpoint of the Microsoft Graph API. -See [this example](docs/Examples.md#batching-requests) +See [this example](docs/general_samples.md#batching-requests) ## Support for resumable large file uploads To upload files larger than 3MB, Microsoft Graph API supports uploads using resumable upload sessions where several bytes are uploaded at a time. The SDK provides a LargeFileUpload task that slices your file into chunks and progressively uploads them until completion. -See [this example](docs/Examples.md#uploading-large-files) +See [this example](docs/uploads_samples.md#uploading-large-files) # Breaking Changes The following breaking changes were introduced in v2.0.0 with more detailed upgrade steps in the following section: @@ -128,7 +128,7 @@ $graphServiceClient = new GraphServiceClient($tokenRequestContext); ``` With version 2's configuration, all your requests are authenticated without additional effort. -See [this example](docs/Examples.md#creating-a-graph-client) on how to customise the Guzzle HTTP client configuration. +See [this example](docs/general_samples.md#creating-a-graph-client) on how to customise the Guzzle HTTP client configuration. ## Changes to Graph request functionality @@ -152,7 +152,7 @@ $requestConfig->top = 5; $messages = $graphClient->me()->messages()->get($requestConfig)->wait(); ``` -See [the examples](docs/Examples.md) on how to pass headers and query parameters in your requests. +See [the examples](docs/general_samples.md#passing-request-headers) on how to pass headers and query parameters in your requests. ## Exception Handling diff --git a/docs/README.md b/docs/README.md index f5e7a1ab3b5..3708a6e647f 100644 --- a/docs/README.md +++ b/docs/README.md @@ -14,7 +14,18 @@ Users can begin developing immediately by connecting with the REST API directly View the [getting started steps](../README.md#get-started-with-microsoft-graph) to make your first request with Graph. ## Using the SDK -- [Usage Examples](Examples.md) +### Common Examples +- [General](/docs/general_samples.md) - General usage examples and common patterns. +- [Authentication](/docs/authentication_samples.md) - Detailed examples of different authentication methods and token +- [FAQ](/docs/FAQ.md) - Frequently asked questions and troubleshooting common problems. +### More Examples +- [Users](/docs/users_samples.md) - Examples of working with user-related Graph API endpoints. +- [Application](/docs/application_samples.md) - Examples of working with application-level Graph API operations. +- [Drives](/docs/drives_samples.md) - Examples for working with OneDrive and SharePoint drives. +- [Groups](/docs/groups_samples.md) - Code samples for managing Microsoft 365 groups. +- [Uploads](/docs/uploads_samples.md) - Examples showing how to upload files, including large file upload support. +- [Sharepoint](/docs/sharepoint_samples.md) - Samples demonstrating SharePoint-specific functionality. + To make calls to the Beta Microsoft Graph API, check out our [Microsoft Graph Beta SDK](https://packagist.org/packages/microsoft/microsoft-graph-beta). ## Support diff --git a/docs/general_samples.md b/docs/general_samples.md index f02d24e047f..85856aa598c 100644 --- a/docs/general_samples.md +++ b/docs/general_samples.md @@ -1,4 +1,4 @@ - Usage Examples +# Usage Examples ## Creating a Graph client This creates a default Graph client that uses `https://graph.microsoft.com` as the default base URL and default configured Guzzle HTTP client to make the requests.