I would like to connect to the Field Service API. I have a username and password for the webapp. How would I get a client id and secret in order to auth via OAuth2 ( which is required by the API)?
Thanks.
Did you figure this out? I have same issues. Scope is not working for me here. I get 401
This is an old thread but did someone find an answer?
Having the same problem when trying to get the an access token for Dynamics 365 Business Central api using MSAL.
I get the token but get Unauhtorized -error when trying to call the api using the token. Graph api sample works fine so I'm suspecting the problem is with the scope, currently using "https://api.businesscentral.dynamics.com/.default" as scope.
The docs lead me here: github.com/.../confidential_client_secret_sample.py
Since I was using python and, from what I read, MSAL is replacing ADAL. The sample code worked for me. But that was for the graph application. I am having issues with getting it to work with Field Service entities.
Maybe, what I put for the “scope” and “endpoint” values are incorrect?
"scope": [ "https://admin.services.crm.dynamics.com/.default" ]
"endpoint": "https://<my_org>.crm.dynamics.com/api/data/v9.0/WhoAmI
I am not getting a valid response when I do an HTTP GET with those value. Note, that I am getting a token back. But when I try to do a simple GET, I am get None as a response which leads me to believe that the token I received was invalid.
In the above response, i mentioned an URL and a sample ode is available in that URL. It's like your D365 Org.
Https://<yourcrmorg>.crm<i>.dynamics.com
Did you try that sample
Thank you. I was able to register an application, get a client id and generate a client secret.
How can I find what URL to hit to get the token? I can't seem to find it in the docs nor in the Azure AD.
You have to create an "Application User" and register an app in Azure Active Directory. Please look in to the below link for detailed information.
https://docs.microsoft.com/en-us/powerapps/developer/common-data-service/authenticate-oauth
Under review
Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.
As AI tools become more common, we’re introducing a Responsible AI Use…
We are honored to recognize Andrés Arias as our Community Spotlight honoree for…
These are the community rock stars!
Stay up to date on forum activity by subscribing.
Daniyal Khaleel 67
Tom_Gioielli 28 Super User 2025 Season 2
Gerardo Rentería Ga... 17 Most Valuable Professional