MicrosoftGraph.Client (Microsoft Graph API Client v0.1.0)

Client for the Microsoft Graph API.

usage

Usage

client = MicrosoftGraph.Client.client("client_id", "client_secret", "tenant_id")
|> MicrosoftGraph.Client.get_token!(scope: "https://graph.microsoft.com/.default")

MicrosoftGraph.Users.User.list_users(client)
# {:ok, response}

MicrosoftGraph.Users.Photo.get_user_photo(client, "user_id")
# {:ok, response}

Link to this section Summary

Functions

Create a new Microsoft Graph API client.

Default scope string helper

Gets a token and puts the correct json header for the API

Link to this section Functions

Create a new Microsoft Graph API client.

examples

Examples:

iex> Microsoft.client("client_id", "client_secret", "tenant_id")
%OAuth2.Client{}

# Use an existing Ueberauth config
iex> Microsoft.client(Application.get_env(:ueberauth, Ueberauth.Strategy.Microsoft.OAuth))
%OAuth2.Client{}
Link to this function

client(client_id, client_secret, tenant_id)

Link to this function

default_scope()

Default scope string helper

Link to this function

get_token!(client, params \\ [], headers \\ [], opts \\ [])

Gets a token and puts the correct json header for the API