Menu

## Graph

Graph.php : 32

Class Graph

##### Tags

category

  Library

license

  https://opensource.org/licenses/MIT MIT License

link
  https://graph.microsoft.io/

### Table of Contents

$_accessToken : string
  The access_token provided after authenticating with Microsoft Graph (required)
$_apiVersion : string
  The api version to use ("v1.0", "beta") Default is "v1.0"
$_baseUrl : string
  The base url to call Default is "https://graph.microsoft.com"
$_proxyPort : string
  The port to use for proxy requests Null disables port forwarding
$_proxyVerifySSL : bool
  Whether SSL verification should be used for proxy requests
__construct() : mixed
  Creates a new Graph object, which is used to call the Graph API
createCollectionRequest() : GraphCollectionRequest
  Creates a new collection request object with the given Graph information
createRequest() : GraphRequest
  Creates a new request object with the given Graph information
setAccessToken() : Graph
  Sets the access token. A valid access token is required to run queries against Graph
setApiVersion() : Graph
  Sets the API version to use, e.g. "beta" (defaults to v1.0)
setBaseUrl() : Graph
  Sets the Base URL to call (defaults to https://graph.microsoft.com)
setProxyPort() : Graph
  Sets the proxy port. This allows you to use tools such as Fiddler to view requests and responses made with Guzzle

### Properties

#### $_accessToken

Graph.php : 40

The access_token provided after authenticating with Microsoft Graph (required)

`private string $_accessToken`

#### $_apiVersion

Graph.php : 47

The api version to use ("v1.0", "beta") Default is "v1.0"

`private string $_apiVersion`

#### $_baseUrl

Graph.php : 54

The base url to call Default is "https://graph.microsoft.com"

`private string $_baseUrl`

#### $_proxyPort

Graph.php : 61

The port to use for proxy requests Null disables port forwarding

`private string $_proxyPort`

#### $_proxyVerifySSL

Graph.php : 68

Whether SSL verification should be used for proxy requests

`private bool $_proxyVerifySSL`

### Methods

#### __construct()

Graph.php : 73

Creates a new Graph object, which is used to call the Graph API

`public __construct() : mixed`

##### Return values

mixed —

#### createCollectionRequest()

Graph.php : 172

Creates a new collection request object with the given Graph information

`public createCollectionRequest(string $requestType, string $endpoint) : GraphCollectionRequest`

##### Parameters

$requestType : string

  The HTTP method to use, e.g. "GET" or "POST"

$endpoint : string

  The Graph endpoint to call

##### Tags

throws
  GraphException

##### Return values

GraphCollectionRequest —

The request object, which can be used to make queries against Graph

#### createRequest()

Graph.php : 148

Creates a new request object with the given Graph information

`public createRequest(string $requestType, string $endpoint) : GraphRequest`

##### Parameters

$requestType : string

  The HTTP method to use, e.g. "GET" or "POST"

$endpoint : string

  The Graph endpoint to call

##### Tags

throws
  GraphException

##### Return values

GraphRequest —

The request object, which can be used to make queries against Graph

#### setAccessToken()

Graph.php : 114

Sets the access token. A valid access token is required to run queries against Graph

`public setAccessToken(string $accessToken) : Graph`

##### Parameters

$accessToken : string

  The user's access token, retrieved from MS auth

##### Return values

Graph —

object

#### setApiVersion()

Graph.php : 99

Sets the API version to use, e.g. "beta" (defaults to v1.0)

`public setApiVersion(string $apiVersion) : Graph`

##### Parameters

$apiVersion : string

  The API version to use

##### Return values

Graph —

object

#### setBaseUrl()

Graph.php : 86

Sets the Base URL to call (defaults to https://graph.microsoft.com)

`public setBaseUrl(string $baseUrl) : Graph`

##### Parameters

$baseUrl : string

  The URL to call

##### Return values

Graph —

object

#### setProxyPort()

Graph.php : 130

Sets the proxy port. This allows you to use tools such as Fiddler to view requests and responses made with Guzzle

`public setProxyPort(string $port[, bool $verifySSL = false ]) : Graph`

##### Parameters

$port : string

  The port number to use

$verifySSL : bool = false

  Whether SSL verification should be enabled

##### Return values

Graph —

object

## Search results