Microsoft Graph (Generic) v2
Call any Microsoft Graph endpoint: paging, batch and five sign-in methods
Calls any Microsoft Graph endpoint with paging, $batch and binary download; signs in by secret, certificate, device code, auth code or managed identity.
microsoft-graph-generic-v2_3.0.1.tgz
Community code that runs on your platform. A maintainer reviewed this exact source; the download is rebuilt from it. Follow the to install it.
A generic Microsoft Graph REST API connector. The Execute Graph Request operation (and its newer name, Execute API Request) calls any Graph endpoint with any HTTP method, a JSON body, query parameters and extra headers, so every Graph surface your app registration can reach is available without connector updates. Paginate follows @odata.nextLink and merges the pages into one list, bounded by Max Pages. Graph Batch sends up to 20 requests in one $batch call and returns each response plus the failed ids. Execute Graph Request can also download a binary GET response as base64. Sign-in uses MSAL with five methods: client secret, client certificate, device code, authorization code with PKCE, and managed identity. Delegated tokens persist in the connector configuration between playbook runs. Full URLs are refused, and nextLinks are followed only when they point at the configured Graph host.
Live-tested on FortiSOAR 8.0.1 against a Microsoft 365 lab tenant.
Authentication needs a Microsoft Entra ID app registration with the Graph permissions your playbooks use, admin consented. Client secret, client certificate and managed identity use application permissions. Device code and authorization code act for the signed-in user and use delegated permissions. The sample playbooks need the application permission User.Read.All.
Not live-tested:
- complete_device_login: needs a person to sign in at the device login page. The lab run without that sign-in returned "No pending device login". The success shape is covered offline by a synthetic mock.
- complete_auth_login: needs a person to sign in through the browser and paste the redirected URL. The lab run without it returned "No pending auth-code login". The success shape is covered offline by a synthetic mock.
- Client Certificate and Managed Identity sign-in: not exercised on the lab tenant (the lab record used client secret, device code and authorization code). Covered by the offline suite only.
- HTTP 429 (throttling): the error mock is synthetic, because throttling cannot be provoked on demand. HTTP 400, 401, 403 and 404 error mocks were captured live.
Configuration · 16 fields
- Authentication Method
auth_methodselect requiredHow access tokens are acquired. Client Secret and Client Certificate use app permissions (client credentials). Device Code and Authorization Code act on behalf of a signed-in user (delegated permissions) and need their one-time login operations. Managed Identity uses the identity of the Azure VM or Arc server FortiSOAR runs on.
Options Client SecretClient CertificateDevice CodeAuthorization CodeManaged Identity - Tenant ID
tenant_idtextMicrosoft Entra ID tenant (directory) ID or domain. Required for every method except Managed Identity.
- Client ID
client_idtextApplication (client) ID of the Entra ID app registration. Required for every method except Managed Identity (where it selects a user-assigned identity).
- Client Secret
client_secretpasswordClient secret of the app registration. Required for the Client Secret method.
- Private Key (PEM)
private_keypasswordPEM private key of the certificate uploaded to the app registration (Client Certificate method). A private-key File field is also accepted.
- Public Certificate (PEM)
public_certificatetext(Optional, Client Certificate method) PEM public certificate matching the private key. With MSAL 1.35+ the SHA-256 thumbprint is computed from it; it also enables Subject Name/Issuer authentication.
- Certificate Thumbprint
thumbprinttext(Optional, Client Certificate method) SHA-1 thumbprint of the certificate as shown in the app registration. Provide this or the public certificate.
- Private Key Passphrase
certificate_passphrasepassword(Optional, Client Certificate method) Passphrase if the private key is encrypted.
- Managed Identity Client ID
managed_identity_client_idtext(Optional, Managed Identity method) Client ID of the user-assigned managed identity. Leave empty for the system-assigned identity.
- Authority Host
authority_hosttextMicrosoft Entra ID authority host. Default: https://login.microsoftonline.com; sovereign clouds use their own, for example https://login.microsoftonline.us or https://login.china.cloudapi.cn.
- Graph Host
graph_hosttextMicrosoft Graph endpoint host. Default: graph.microsoft.com; national clouds use their own, for example graph.microsoft.us or microsoftgraph.chinacloudapi.cn.
Default
graph.microsoft.com - API Version
api_versionselectGraph API version used for relative URLs. An explicit /v1.0/ or /beta/ prefix on the operation URL overrides it.
Default
v1.0Options v1.0beta - Scopes
scopestext(Optional) Space- or comma-separated scopes. Default: https://<graph host>/.default. Delegated methods always add offline_access so tokens can be refreshed.
- Redirect URL
redirect_urltext(Authorization Code method) Redirect URI registered on the app as a Mobile and desktop application platform. Default: http://localhost.
Default
http://localhost - Verify SSL
verify_sslcheckboxSpecifies whether SSL certificates are to be verified.
Default
true - Request Timeout (seconds)
timeouttextPer-request timeout in seconds applied to token and Graph calls.
Default
30
Operations · 8
Health Check
health_checkhealth_checkVerify the configuration end to end: acquire a token with the configured method and GET /$metadata, the one Graph endpoint any valid token can read.
No parameters.
ReturnstypepropertiesExecute Graph Request 9 params
execute_graph_requestexecute_graph_requestCalls any Microsoft Graph endpoint with any HTTP method. The URL is a Graph path such as /v1.0/users or me/sendMail (a full URL is refused so the token only ever goes to the configured Graph host). Optionally follows @odata.nextLink to collect every page, or downloads a binary response as base64.
- URL
urltext requiredGraph path, with or without a leading version segment (/v1.0/users, /beta/..., users).
- Method
methodselectHTTP method. Defaults to GET.
Default
GETOptions GETPOSTPUTPATCHDELETE - Query Parameters
query_paramsjson(Optional) JSON object of query string parameters, for example {"$select": "displayName,mail", "$top": 25}.
- Request Body
request_bodyjson(Optional) JSON body sent with POST, PUT and PATCH. Non-JSON text is sent as plain text.
- Extra Headers
extra_headersjson(Optional) JSON object of extra request headers, for example {"ConsistencyLevel": "eventual"} for advanced queries.
- Paginate
paginatecheckboxFollow @odata.nextLink and merge every page's value array into one items list. GET requests only.
Default
falseWhen Paginate is true
- Max Pages
max_pagesinteger(Optional) Stop after this many pages. Default 10, at most 100.
Default
10
- Max Pages
max_pagesinteger(Optional, with Paginate) Stop after this many pages. Default 10, at most 100.
Default
10 - Download
downloadcheckboxReturn a binary GET response as base64 content (content_base64, content_type, size), for example a file or photo.
Default
false - API Version
api_versionselect(Optional) Override the configured API version for this request.
Options v1.0beta
ReturnstypepropertiesExecute API Request 9 params
execute_api_requestexecute_api_requestGeneric pass-through for any Microsoft Graph endpoint, using the connector's own auth. Same behaviour as Execute Graph Request (the name used by earlier playbooks); use this name in new playbooks.
- URL
urltext requiredGraph path, with or without a leading version segment (/v1.0/users, /beta/..., users).
- Method
methodselectHTTP method. Defaults to GET.
Default
GETOptions GETPOSTPUTPATCHDELETE - Query Parameters
query_paramsjson(Optional) JSON object of query string parameters, for example {"$select": "displayName,mail", "$top": 25}.
- Request Body
request_bodyjson(Optional) JSON body sent with POST, PUT and PATCH. Non-JSON text is sent as plain text.
- Extra Headers
extra_headersjson(Optional) JSON object of extra request headers, for example {"ConsistencyLevel": "eventual"} for advanced queries.
- Paginate
paginatecheckboxFollow @odata.nextLink and merge every page's value array into one items list. GET requests only.
Default
falseWhen Paginate is true
- Max Pages
max_pagesinteger(Optional) Stop after this many pages. Default 10, at most 100.
Default
10
- Max Pages
max_pagesinteger(Optional, with Paginate) Stop after this many pages. Default 10, at most 100.
Default
10 - Download
downloadcheckboxReturn a binary GET response as base64 content (content_base64, content_type, size), for example a file or photo.
Default
false - API Version
api_versionselect(Optional) Override the configured API version for this request.
Options v1.0beta
ReturnstypepropertiesGraph Batch 2 params
graph_batchgraph_batchSubmit a JSON array of requests as one Graph $batch POST (at most 20 requests, relative URLs, each with id, method and url). Returns every individual response plus the ids that failed.
- Requests
requestsjson requiredJSON array of up to 20 batch requests with relative URLs.
- API Version
api_versionselect(Optional) Override the configured API version for the batch call.
Options v1.0beta
ReturnstypepropertiesStart Device Login
start_device_loginstart_device_loginBegins the device code flow (Auth Method: Device Code): returns a user code and the microsoft.com/devicelogin URL. Sign in there with the account, then run Complete Device Login. The pending flow is stored in the connector configuration.
No parameters.
ReturnstypepropertiesComplete Device Login 1 param
complete_device_logincomplete_device_loginFinishes the device code flow started by Start Device Login: polls Entra ID until you have signed in (bounded by Wait Seconds), stores the tokens in the connector configuration, and reports the signed-in user.
- Wait Seconds
wait_secondsinteger(Optional) How long to wait for you to finish signing in, between 5 and 600. Default 120.
Default
120
ReturnstypepropertiesGet Auth Code URL
get_auth_code_urlget_auth_code_urlBegins the delegated authorization code flow with PKCE (Auth Method: Authorization Code): returns the sign-in URL for the configured redirect URL. Open it, sign in as the user, then pass the address you were redirected to (including ?code=...) to Complete Auth Login.
No parameters.
ReturnstypepropertiesComplete Auth Login 2 params
complete_auth_logincomplete_auth_loginFinishes the authorization code flow: pass the full redirected URL (or just the code) from the sign-in. Validates the state, stores the tokens in the connector configuration for later operations, and reports the signed-in user.
- Redirected URL
redirected_urltextThe full address the sign-in redirected you to. Either this or Code is required.
- Code
codetext(Optional) Just the authorization code, if you did not paste the full URL.
Returnstypeproperties