2021年4月27日星期二

Deleting an event returns success but not worked actually

I am trying to delete an event using Microsoft Graph API.

My issue is that I couldn't delete an event even the response returns success. (regarding the official doc, success returns null)

My technical stack is CakePHP v4.x and I code like the following.

$http = new Client();  $appToken = $this->getRequest()->getSession()->read('appToken');    if ($this->request->is('ajax')) {      $this->autoRender = false;  }    $url = "https://graph.microsoft.com/v1.0/users/{user-id}/calendar/events/{event-id}";  $response_delete = json_decode($http->delete($url, [], [              'headers' => ['Authorization' => 'Bearer '. $appToken]          ])->getBody()->getContents(), true);  // $response_delete = null  

$appToken is the application token so a company user can delete an event.

The token works fine and also I already have the full permissions on Azure active directory.

But real strange thing is that the same code works properly on my local side.

I merged my all updated codes using Git and compared the codebase several times, but I didn't have any luck.

I am not sure why it does happen.

Thanks in advance.

https://stackoverflow.com/questions/67293271/deleting-an-event-returns-success-but-not-worked-actually April 28, 2021 at 11:18AM

没有评论:

发表评论