MS ToDo API is giving error for few users when using following endpoint :
https://outlook.office.com/api/v2.0/me/taskfolders
Here is the piece of code :
$accessToken = "eyJ0eXAiOiJKV1QiLCJub25jZSI6I*******sYVg0X0";
$url = "https://outlook.office.com/api/v2.0/me/taskfolders";
$ch = curl_init();
curl_setopt($ch,CURLOPT_URL,$url);
curl_setopt($ch,CURLOPT_RETURNTRANSFER,true);
curl_setopt_array($ch, array(
CURLOPT_HTTPHEADER => array('Authorization: Bearer '.$accessToken)
));
$output=curl_exec($ch);
Here is the error which I am getting :
stdClass Object (
[error] => stdClass Object
(
[code] => ErrorItemNotFound
[message] => The specified object was not found in the store.
)
)
As per the documentation of MS, we should get the list of default folder.
Here is the MS documentation link
That means, I should get default folder list in response and which I am getting in case of other users. I checked the token validity, it is alive.
Any help is appreciated and thank you in advance.