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

Announcements

No record found.

News and Announcements icon
Community site session details

Community site session details

Session Id :
Microsoft Dynamics CRM (Archived)

Web API Helper Code

(0) ShareShare
ReportReport
Posted on by 2,512

Hi, I am trying to connect dynamics 365 on premise with the official helper code in asp.net web api project. however, it stopped in the authentication part without error message, I tried the same code in console program project, and it worked fine. did I miss some configurations? I attached the code snippet where it stops in the authentication.cs. Please advise

  AuthenticationParameters ap = AuthenticationParameters.CreateFromResourceUrlAsync(
                    new Uri(serviceUrl + "api/data/")).Result;

                return ap.Authority;


*This post is locked for comments

I have the same question (0)
  • Suggested answer
    gdas Profile Picture
    50,091 Moderator on at

    Hi ,

    Which version of Dynamics CRM you are using , go to settings --> Customization --> Developer Resource -> Check the API URL.

    Might be you are not providing correct URL. Check here for more information -

    https://community.dynamics.com/crm/b/develop1/archive/2017/12/21/oauth-server-to-server-application-user-authentication

    Try to write like below -

      AuthenticationParameters ap = AuthenticationParameters.CreateFromResourceUrlAsync(
                        new Uri(serviceUrl + "/api/data/v8.2/")).Result;
    
                    return ap.Authority;


  • sdnd2000 Profile Picture
    2,512 on at

    I am using dynamics 365 v8.2, I tried append"/v8.2/"  to the end, but still can not go through.

  • Suggested answer
    gdas Profile Picture
    50,091 Moderator on at

    Hi ,

    Did you added another "/" at the beginning ?

  • sdnd2000 Profile Picture
    2,512 on at

    that is the same code in the console program, but it works in console program

  • Verified answer
    Arun Vinoth Profile Picture
    11,615 Moderator on at

    This blog post may be helpful to configure & solve such issues.

    www.inogic.com/.../programming-using-webapi-through-c-in-dynamics-crm-2016

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

Introducing the 2026 Season 1 community Super Users

Congratulations to our 2026 Super Stars!

Congratulations to our 2025 Community Spotlights

Thanks to all of our 2025 Community Spotlight stars!

Leaderboard > 🔒一 Microsoft Dynamics CRM (Archived)

#1
JS-09031509-0 Profile Picture

JS-09031509-0 3

#2
AS-17030037-0 Profile Picture

AS-17030037-0 2

#2
Mark Eckert Profile Picture

Mark Eckert 2

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans