Many Microsoft Graph SDKs use the v1.0 Microsoft Graph endpoint by default. The SDKs can be used with the beta endpoint for nonproduction applications. The method for accessing the beta endpoint depends on your SDK.
Important
APIs under the /beta
version in Microsoft Graph are subject to change. Use of these APIs in production applications is not supported. To determine whether an API is available in v1.0, use the Version selector.
To call the API, you must install the Microsoft.Graph.Beta package. Usage is the same as the Microsoft.Graph
package.
// Version 5.x
using Microsoft.Graph.Beta;
// Version 4.x and earlier
// using Microsoft.Graph;
// Create a new instance of GraphServiceClient.
GraphServiceClient graphClient = new GraphServiceClient(...);
To call the API, you must install the Microsoft Graph Beta SDK for Go package.
import (
graphbeta "github.com/microsoftgraph/msgraph-beta-sdk-go"
)
client := graphbeta.NewGraphServiceClientWithCredentials(credentials, scopes)
To call the API, you must install the Microsoft Graph Beta Java SDK. Usage is the same as the nonbeta SDK.
GraphServiceClient graphClient = new GraphServiceClient(tokenCredential, scopes);
To use the Microsoft Graph Beta SDK for Python, install the SDK for the beta endpoint with the following command:
pip install msgraph-beta-sdk
Use the SDK for the beta endpoint in the same way as the SDK for the v1 endpoint.
The Microsoft Graph JavaScript Client Library can call the beta API in one of two ways.
You can set the version on the MicrosoftGraph.Client
when you create it. All requests made by the client go to the specified version.
const clientOptions: ClientOptions = {
defaultVersion: 'beta',
...
};
// Initialize Graph client
const client = MicrosoftGraph.Client.initWithMiddleware(clientOptions);
You can set the version on a specific request by using the version
function on the GraphRequest
object.
const user = await client
.api('/me')
.version('beta')
.get();
Related content
SDKs in preview or GA status.