I am attempting to connect to any of the Business Central Web Services via postman using the grant type client_credentials.
I can receive a token from the call below ok:
Images removed as contained sensitive Data.
However, if I attempt to use this token in the call below I receive error 401.
Images removed as contained sensitive Data.
I have the App Registration set up with the following granted permissions:
Images removed as contained sensitive Data.
I also have the Azure Application registered and granted in Business Central.
Any help is appreciated.
Edit: RESOLVED!
The issue was that I was calling the incorrect token URL. This should have been
https://login.microsoftonline.com/{tenant ID}/oauth2/v2.0/token
Answers
I think that the problem is the URL that you are calling, I assume that you are calling a codeunit, so the URL must to be:
https://api.businesscentral.dynamics.com/v2.0/47fe7048-3f97-4ada-b80f-9e03f8a9b48a/Upgrade/ODataV4/ws_Charity_Conta?company='CRONUS%20UK%20Ltd.'