Hi @Kiran Kumar ,
As per line#15 in your code , you are trying use /me Graph API endpoint in your application and as the error message states, /me Graph API endpoint is only valid with delegated authentication flow & delegated permissions scope but not with application client credential flow & application permissions scope.
Since you are using application client credential flow & application permissions scope , you would have to change line#15 in your above code like mentioned below and refer line#4 in the below example and also make sure that "Files.Read.All" application permissions are granted for your application. Your user ID should be mentioned in the below code at line#4.
var stream = await graphClient.Users["{User-Id}"].Drive.Items["{Item-Id}"].Request().GetAsync();
Example :
var stream = await graphClient.Users["4993994c-87b7-48b2-a7ff-2812a481b587"].Drive.Items["91XVQLL722MEU2FCVLXNHLORAJTNPKUZLM"]
.Request()
.GetAsync();
Here {User-Id} can be Id or UserPrincipalName and {Item-Id} can be Id of the item which needs to be accessed.
**Please ensure to mention your user ID or UserPrincipalName in the above code (at line#4).**
Here is the example output in Postman using equivalent graph API endpoint (GET /users/{user-id}/drive/items/{item-id}):
Hope this helps.
If the answer is helpful, please click "Accept Answer" and kindly upvote it. If you have further questions about this answer, please click "Comment".