Call Microsoft Graph with AL Microsoft Graph module

Important

This content is archived and is not being updated. For the latest documentation, go to What's new or changed in Business Central. For the latest release plans, go to Dynamics 365, Power Platform, and Cloud for Industry release plans.

Enabled for Public preview General availability
Admins, makers, marketers, or analysts, automatically - Jan 10, 2024

Business value

The AL Microsoft Graph module contains methods to support calling Microsoft Graph with just a few lines of code.

Feature details

The AL Microsoft Graph module contains methods to support the following scenarios:

  • Create Microsoft Graph authorization
  • Initialize the Microsoft Graph Client
  • Process GET,PATCH,POST,DELETE requests with Microsoft Graph

Here are some examples that use the Microsoft Graph module.

> //Create Microsoft Graph Authorization
> MicrosoftGraphAuthorization := MicrosoftGraphAuth.CreateAuthorizationWithClientCredentials(TenantId, ClientId, ClientSecret, 'https://graph.microsoft.com/.default');
> 
> //Initialize Microsoft Graph Client
> MicrosoftGraphClient.Initialize(Enum::"Microsoft Graph API Version"::"v1.0", MicrosoftGraphAuthorization);
> 
> ResponseInStream := TempBlob.CreateInStream();
> 
> //Create Microsoft Graph GET,PATCH,POST,DELETE
> if not MicrosoftGraphClient.Get('groups', ResponseInStream) then
> 		Error(MicrosoftGraphClient.GetDiagnostics().GetResponseReasonPhrase());
> ResponseInStream.Read(ResponseContent);
> Message(ResponseContent);

Note

We'd like to thank our community for making this valuable contribution through our System Application open-source repo on GitHub

Tell us what you think

Help us improve Dynamics 365 Business Central by discussing ideas, providing suggestions, and giving feedback. Use the forum at https://aka.ms/bcideas.

Thank you for your idea

Thank you for submitting this idea:

We listened to your idea, along with comments and votes, to help us decide what to add to our product roadmap.