Graph API returning 401

Anonymous
2025-10-30T21:01:54.87+00:00

We are trying to use the Graph API to send emails automatically through a no-reply account. We have followed the Microsoft guide on https://learn.microsoft.com/en-us/graph/tutorials/python-email to the tee, and have tried multiple other python approaches. However, each time we get:

kiota_abstractions.api_error.APIError:

APIError

Code: 401

message: The server returned an unexpected status code and the error registered for this code failed to deserialize: <class 'NoneType'>

The same goes for trying to manage graph permissions through Connect-ExchangeOnline - each time, we are unable to get access, yielding

+ CategoryInfo : OperationStopped: (:) [], UnauthorizedAccessException

+ FullyQualifiedErrorId : UnAuthorized

Is it possible that our Azure subscription does not have this enabled? Is there anything we can do from our end? We have tried multiple different scripts, auth approaches and app registrations.

Hope anyone can help us out!

//Andreas from DokuDok

Microsoft Security | Microsoft Entra | Microsoft Entra ID

1 answer

Sort by: Most helpful
  1. Deleted

    This answer has been deleted due to a violation of our Code of Conduct. The answer was manually reported or identified through automated detection before action was taken. Please refer to our Code of Conduct for more information.


    Comments have been turned off. Learn more

Your answer

Answers can be marked as 'Accepted' by the question author and 'Recommended' by moderators, which helps users know the answer solved the author's problem.