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

Notifications

Announcements

No record found.

Community site session details

Community site session details

Session Id :
Customer experience | Sales, Customer Insights,...
Unanswered

Dynamics 365 CRM Android Java-Kotlin Integration

(0) ShareShare
ReportReport
Posted on by

To call a dynamimcs CRM web API on a android device programmatically
Steps to reproduce:

1. https://github.com/Azure-Samples/ms-identity-android-java

OR 

1. https://github.com/Azure-Samples/ms-identity-android-kotlin

2. Replace the MS Graph API to Dynamics CRM web API

Sample D365 CRM web API : https://organization.crm5.dynamics.com/api/data/v9.1/WhoAmI

Current Scenario/Issue/Result : 401 Unathorized

Reference to Microsoft Docs: 1. https://docs.microsoft.com/en-us/azure/active-directory/develop/quickstart-v2-android

I have the same question (0)
  • kojisaiki Profile Picture
    on at
  • Community Member Profile Picture
    on at

    Thanks for the input.

    All versions are ADAL are deprecated, and MSAL is now in use.

    No versions of MSAL have access to call any API other than Microsoft Graph API.

    I want to integrate other Microsoft Web APIs using the access token of MSAL and integrate a Android mobile app (not a Web app)

    Could try some integrating the above mentioned links.

  • kojisaiki Profile Picture
    on at

    I have tried to request via Postman. Posted http headers on the request below.

    Can you try plane http request on java (like HttpUrlConnection) with below headers ?  I suppose to Authorization header is the point.

    pastedimage1587518717649v2.png

    # you can try postman with this docs: https://docs.microsoft.com/en-us/dynamics365/customerengagement/on-premises/developer/webapi/use-postman-web-api

  • Community Member Profile Picture
    on at

    I have also followed the Postman way and it works for desktop client.

    The headers are those as mentioned in the docs.

    But the API does not work on a mobile client.

  • kojisaiki Profile Picture
    on at

    If the actual http request from Android app and the request from Postman are completely same, both requests should be succeeded.

    1) Is any request to other service web api or internet access from the Android app succeeded?

    2) If you use a token string that same with Postman request in "Authorization" header, is it succeeded? (use literal string instead of programmatically authorization)

    3) Try to capture actual http request from Android app and compare with postman request. I suppose to you can capture with Fiddler https://www.telerik.com/blogs/how-to-capture-android-traffic-with-fiddler

  • Community Member Profile Picture
    on at

    Both the requests are not completely same but are similar

    Ans 1. Yes, The API integration of MS Graph API is successful

    Ans 2. Yes, The access token token generated from AuthenticationResult is added to API using Volley.

    Ok, I will try to capture fiddler traces and compare.

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

Responsible AI policies

As AI tools become more common, we’re introducing a Responsible AI Use…

Neeraj Kumar – Community Spotlight

We are honored to recognize Neeraj Kumar as our Community Spotlight honoree for…

Leaderboard > Customer experience | Sales, Customer Insights, CRM

#1
Tom_Gioielli Profile Picture

Tom_Gioielli 83 Super User 2025 Season 2

#2
Gerardo Rentería García Profile Picture

Gerardo Rentería Ga... 49 Most Valuable Professional

#3
#ManoVerse Profile Picture

#ManoVerse 40

Last 30 days Overall leaderboard

Product updates

Dynamics 365 release plans