Skip to content

Error in a request to download a file from a drive #344

@victorreis

Description

@victorreis

Error in a request to download a file from a drive

Prerequisites

  • Can you reproduce the problem? Yes.
  • Are you running the latest version? Yes.
  • Are you reporting to the correct repository? Yes.
  • Did you perform a cursory search? Yes.

Description

I'm developing a API to manage files from a drive and I'm getting error when I try to download a file by his ID. There is no error when trying in Postman or when trying via Axios.

The request is:
GET https://graph.microsoft.com/v1.0/sites('${siteId}')/drives('${driveId}')/items('${fileId}')/content

Here is my code:

The Microsoft Graph Client, configured to get the token:
image

Here is where I'm trying to download the file:
image

Console Errors:

image

DEBUGGING PERCEPTIONS:

Here is the correct functioning of the .get(), the token is present. I got this example of other request that works fine:
image

Here is the wrong functioning of the .get(), the token is not present and then I get an Error:
image

Usage Information

@microsoft/microsoft-graph-client version - 2.1.0
Node Version - 12.18.4

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions