Skip to main content

Notifications

Microsoft Dynamics CRM (Archived)

how to use CRM 2016 new web API in Console Application

Posted on by Microsoft Employee

I would like to remove use of CRM 2011 service endpoints and instead of that i want to use CRM 2016 new web api end points for my console application to connects to CRM 2016 online/IFD/AD.

we want that if user pass new web api url for connection string, we will retrieve discovery/Iorganization service from that and pass to app.config for connection and use that to request CRM operations.

could it be possible to find/retrieve Iorganization service(SOAP) of an CRM organization from web API service(REST).

*This post is locked for comments

  • Suggested answer
    ansrikanth Profile Picture
    ansrikanth 3,115 on at
    RE: how to use CRM 2016 new web API in Console Application

    Hi

    I know its very old post, but for the sake of other interested people out there - here is a blog post with detailed steps on how to connect to Dynamics 365 web api in a console application (c#) .. ansrikanth.com/.../connect-to-dynamics-crm-365-webapi-from-console-application

  • Community Member Profile Picture
    Community Member Microsoft Employee on at
    RE: how to use CRM 2016 new web API in Console Application

    I tried your suggestion.

    we can download complete solution from here

    code.msdn.microsoft.com/CRM-Web-API-Basic-27fcbf2e

    though I am getting REST response as unauthorized each time.

    here's the code

    HttpResponseMessage createResponse1 =

                   await httpClient.SendAsync(createRequest1);

    beside from this my connection string is

     <add name="default"   connectionString="Url=https://<MyIFDCRMURL>/; Username=username; Password=password; Domain=domain;" />

    could it be possible if you can give a try and suggest any mistake we are making.

  • Suggested answer
    Community Member Profile Picture
    Community Member Microsoft Employee on at
    RE: how to use CRM 2016 new web API in Console Application

    Follow below link

    msdn.microsoft.com/.../mt770386.aspx

  • Suggested answer
    Joe Gill Profile Picture
    Joe Gill on at
    RE: how to use CRM 2016 new web API in Console Application

    Hi,

    You can carry on using the organizationservice without worrying about the new web api endpoint. The SDK will be changed in the future to call the new web api rather than doing Soap calls

    hth

    Joe

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

December Spotlight Star - Muhammad Affan

Congratulations to a top community star!

Top 10 leaders for November!

Congratulations to our November super stars!

Community AMA December 12th

Join us as we continue to demystify the Dynamics 365 Contact Center

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 291,253 Super User 2024 Season 2

#2
Martin Dráb Profile Picture

Martin Dráb 230,188 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans