graph_request: Microsoft Graph request

graph_requestR Documentation

Microsoft Graph request

Description

Class representing a request to the Microsoft Graph API. Currently this is used only in building a batch call.

Format

An R6 object of class graph_request.

Methods

  • new(...): Initialize a new request object with the given parameters. See 'Details' below.

  • batchify(): Generate a list object suitable for incorporating into a call to the batch endpoint.

Details

The initialize() method takes the following arguments, representing the components of a HTTPS request:

  • op: The path of the HTTPS URL, eg ⁠/me/drives⁠.

  • body: The body of the HTTPS request, if it is a PUT, POST or PATCH.

  • options: A list containing the query parameters for the URL.

  • headers: Any optional HTTP headers for the request.

  • encode: If a request body is present, how it should be encoded when sending it to the endpoint. The default is json, meaning it will be sent as JSON text; an alternative is raw, for binary data.

  • http_verb: One of "GET" (the default), "DELETE", "PUT", "POST", "HEAD", or "PATCH".

This class is currently used only for building batch calls. Future versions of AzureGraph may be refactored to use it in general API calls as well.

See Also

call_batch_endpoint

Microsoft Graph overview, Batch endpoint documentation

Examples

graph_request$new("me")

# a new email message in Outlook
graph_request$new("me/messages",
    body=list(
        body=list(
            content="Hello from R",
            content_type="text"
        ),
        subject="Hello",
        toRecipients="bob@example.com"
    ),
    http_verb="POST"
)

AzureGraph documentation built on Sept. 8, 2023, 5:53 p.m.