web
You’re offline. This is a read only version of the page.
close
Skip to main content

Announcements

News and Announcements icon
Community site session details

Community site session details

Session Id :
Service | Customer Service, Contact Center, Fie...
Suggested Answer

Getting a 403 when trying to access a Field Service resource

(0) ShareShare
ReportReport
Posted on by 10

I am getting a 403 when I try to manage entities in the Field Service app via API.

I am getting a token like so:

authority_url = "">login.microsoftonline.com/<my_tenant>"
client_id = '<client_id>'
client_secret = '<client_secret>'
resource = 'https://<my_org>.crm.dynamics.com'

context = AuthenticationContext(authority_url, validate_authority=None, cache=None, api_version=None, timeout=None, enable_pii=False)

token = context.acquire_token_with_client_credentials(resource, client_id, client_secret)

return token['accessToken']


I am trying to hit the “WhoAmI” endpoint indicated here: docs.microsoft.com/.../gg334767(v=crm.8)

url = 'https://<my_org>.crm.dynamics.com/api/data/v9.0/WhoAmI'
headers = {'Content-Type': 'application/json', 'Authorization': 'Bearer {0}'.format(token)} # token from the previous call above.
r = requests.get(url, headers=headers)

At this point I get an HTTP response of 403.

It looks like I get authenticated correctly, but I am not getting authorized. How would I go about fixing this? Does my code look correct?

I gave my registered app permission to "Dynamics CRM". But that didn't work.

Any advice?

I have the same question (0)
  • Suggested answer
    Gilmeyer Profile Picture
    Microsoft Employee on at

    Hi ,

    Have you created the application users on the Dynamics side?

    Please refer to community.dynamics.com/.../dynamics-365-online-authenticate-with-client-credentials.

    Thanks

  • rposadas Profile Picture
    10 on at

    Thanks for the reply.

    I registered an app on the dynamics side. I did that by going to the Azure Portal (https://portal.azure.com) and then the "App Registation" page. Is that the same as creating an application user?

    Also, that link is broken for me.

  • Gilmeyer Profile Picture
    Microsoft Employee on at
  • rposadas Profile Picture
    10 on at

    Thanks for the link.

    I'm curious, the docs walks me through creating a user.   I already have a user that has admin rights. Would I need to create another one?

    I registered the app, gave it permissions and currently have a user in the user list with admin rights. Wouldn't that be enough?

    Would there be another reason why I'm getting a 403 besides the lack of a registered app which I have?

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.

Helpful resources

Quick Links

Season of Sharing Community Challenge Winners!

Congratulations to our community stars!

Women in Power Builds Momentum

Expanding mentorship, skilling, and AI innovation

Congratulations to the June Top 10 Community Leaders

These are the community rock stars!

Leaderboard > Service | Customer Service, Contact Center, Field Service, Guides

#1
KristineRisberg Profile Picture

KristineRisberg 37

#2
11manish Profile Picture

11manish 35

#3
Manoj - ManoVerse Profile Picture

Manoj - ManoVerse 21 Super User 2026 Season 1

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans