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

Community site session details

Session Id :
Microsoft Dynamics CRM (Archived)

Accessing Data From Different CRM organization in one of the organization using WebApi

(0) ShareShare
ReportReport
Posted on by 356

Hi ,

I have scenario where I have CRM Organization A , which has HTML webresource which is fetching account data using WebApi

What I would like to do is , I want my HTML web resource in Organization A to fetch account data from Organization B using WebApi.

Have anybody tried this ?

When I try to do this using WebApi it give me Access error to another CRM Org from one Org.

Please note that Credentials between both Organizations are same.

/Vilas

*This post is locked for comments

I have the same question (0)
  • mvilas02 Profile Picture
    356 on at
    RE: Accessing Data From Different CRM organization in one of the organization using WebApi

    Hi ,

    Thanks for your reply.

    But I have IFD CRM configured and my Active Directory is not on Azure.

    how can I get the information for following parameters. ?

    var organizationURI = "https:// [organization name].crm.dynamics.com"; //The URL to connect to CRM Online

     var tenant = "[xxx.onmicrosoft.com]"; //The name of the Azure AD organization you use

     var clientId = "[client id]"; //The ClientId you got when you registered the application

     var pageUrl = "http://localhost: [PORT #]/SimpleSPA.html"; //The URL of this page in your development environment when debugging.

    I am trying to access Another CRM Organization data from one CRM instance from HTML web resource using Web Api.

    Regards,

    Vilas

  • Inogic Profile Picture
    639 on at
    RE: Accessing Data From Different CRM organization in one of the organization using WebApi

    Hi Vilas M,

    You cannot access Web Api from one Org to another directly. In order to authenticate you will need an Authentication method.

    You may refer the below link for more details on Authenticating WebAPI:

    http://www.inogic.com/blog/2016/03/programming-using-webapi-through-c-in-dynamics-crm-2016/ 

    The code is using C# you may refer it for understanding Authentication.

    For javascript you may refer this link: https://msdn.microsoft.com/en-us/library/mt595797.aspx 

    Hope this helps!

    Thanks!
    Sam

  • Suggested answer
    Goutham A Profile Picture
    2 on at
    RE: Accessing Data From Different CRM organization in one of the organization using WebApi

    Web Api is organization specific.Think you need to authenticate via oAuth(even if same credentials) or any other authentication mechanisms if you want data from another organization/another CRM URI . please refer links below which will help you.

    msdn.microsoft.com/.../dn531009.aspx

    debajmecrm.com/.../knowhow-how-to-execute-web-api-calls-to-microsoft-dynamics-crm-from-an-external-asp-net-web-application

    For Web Api Intro : msdn.microsoft.com/.../gg334279.aspx

    Quick Code :

    private static void Helper()

    {

    // Obtain an authentication token to access the web service.

    AuthenticationContext authenticationContext = new AuthenticationContext(_oauthUrl, false);

    AuthenticationResult result = authenticationContext.AcquireToken(_authorizationCode, _clientID, _redirectUrl);

    _crmOauthToken = result.AccessToken;

    }

    Thanks.

  • mvilas02 Profile Picture
    356 on at
    RE: Accessing Data From Different CRM organization in one of the organization using WebApi

    Hi Goutham ,

    1. Well I am not using any authentication yet , do I need to use oauth ? do u have any example of it ?

    the credentials for using both the instance are same.

    2. Yes I am trying to access this from HTML web resource which is inside account entity in one Organization.

    3. The error is says "Access to restricted URI denied".

    \Vilas

  • Suggested answer
    Goutham A Profile Picture
    2 on at
    RE: Accessing Data From Different CRM organization in one of the organization using WebApi

    Hi Vilas,

    Can you give more information regarding the process followed like

    1.What is the authentication method you were using(like oauth etc)

    2.Is web resource intergrated wit CRM or external app?

    3. What is the error you were thrown and is there any error code?

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…

Mansi Soni – Community Spotlight

We are honored to recognize Mansi Soni as our August 2025 Community…

Congratulations to the July Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > 🔒一 Microsoft Dynamics CRM (Archived)

#1
Community Member Profile Picture

Community Member 2

#2
Christoph Pock Profile Picture

Christoph Pock 1

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans