使用Outlook Calendar REST API时出现“ErrorMissingEmailAddress”错误

I am using Outlook Calendar REST API to get events from the calendar via PHP in my localhost using the method describe here. Have registered the app at the Application Registration Portal and received the App Id and Password. Redirect URI is set. The event retrieval process is running fine till login to the hotmail account.

After sign in using my personal hotmail account, redirect url is called, but am getting http error code 400 and the curl response is saying,

ErrorMissingEmailAddress - When making a request as an account that does not have a mailbox, you must specify the mailbox primary SMTP address for any distinguished folder Ids.

The following headers are passed along with the request,

User-Agent: outlook-tutorial/1.0,Authorization: Bearer the-access-token, Accept: application/json, client-request-id: abcdef-abcd-wxyzu-xyzw-1121211213, return-client-request-id: true, X-AnchorMailbox: myemail@hotmail.com

The generated API url for curl is like,

https://outlook.office.com/api/v2.0/Me/Events?%24select=Subject%2CStart%2CEnd&%24top=10

The curl request is like,

$curl = curl_init($url);
curl_setopt($curl, CURLOPT_RETURNTRANSFER, true);
curl_setopt($curl, CURLOPT_HTTPHEADER, $headers);
$response = curl_exec($curl);
$httpCode = curl_getinfo($curl, CURLINFO_HTTP_CODE);

I googled alot to understand the reason for such a response, but couldn't find anything close to even tryout another way of implementing this. Any help is appreciated.

Thanks