Setting headers on Graph API request

Last updated on
19 May 2023

There is a possibility to add headers to your custom request to the Office 365 Graph API. For an example, see below:

<?php

// Add ConsistencyLevel: eventual to the header.
$headers = [
  'ConsistencyLevel' => 'eventual',
];

$UsersData['manager-tree'] = $this->o365Graph->getGraphData('/users/' . $user_id . '/?expand=manager($levels=50;$select=id,displayName)&$count=true', 'GET', FALSE, 'beta', [], FALSE, $headers);

Help improve this page

Page status: No known problems

You can: