I have an Excel file added to the drive. I want to get data from it so in the first place I added permission (Files.ReadWrite) according to the documentation to my application on the azure portal.
First, I get an access token from this url: https://login.microsoftonline.com/common/oauth2/v2.0/token
I receive a token, which I then use to complete the GET request from the url:
https://graph.microsoft.com/v1.0/me/drive/items/{drive-item-id}/workbook/worksheets/XX/range(address='A4:C4)
I set headers a token according to the documentation of course
'headers' => [
'Accept' => 'application/json',
'Authorization' => 'Bearer ' . $this->token
]
And in response I get:
Message: Client error: GET https://graph.microsoft.com/v1.0/me... resulted in a 400 Bad Request response: {"error": {"code": "BadRequest", "message": "Current authenticated context is not valid for this request. (truncated ...) "
How should I do authorize/get token that it to work?
Best regards