As your issue is realted to Office development, but the tag "office-deployment" focus more on general issues of Office deployment, to better help you, it's recommended to post a new thread on the following forum.
Office developer community
Thanks for your understanding.
According to the sentence from your shared link, "The API relies on Microsoft Azure Active Directory and the OAuth2 protocol for authentication and authorization", I personally suggest you check whether you have registered a user in Azure AD and configures it with permissions at the appropriate scope,
which could help applications request OAuth2 access tokens necessary for calling the API.
If an Answer is helpful, please click "Accept Answer" and upvote it.
Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.