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 :
Microsoft Dynamics CRM (Archived)

REST - Raw HTTP

(0) ShareShare
ReportReport
Posted on by

I'm unable to find any concrete examples of how to interact with CRM using REST where we create the raw HTTP URLs in code.

In theory I should be able to create raw HTTP requests and send them to CRM for authentication and data access.

Everything I'm finding talks about OData or SOAP, yet at the end of the day these will just all do raw HTTP so why no documentation about this?

I can do this with SalesForce and they document the low level HTTP syntax and headers etc for stuff like OAuth authentication and so on.

I'm going to use Java to do raw HTTP to CRM (off site) just as I have already with SalesForce but I'm finding it much harder with CRM because everything is buried under SOAP or OData - no insight or documentation about the eventual raw HTTP messages.

I'm using Advanced Rest Client tool in Chrome to experiment but so far just get a WSDL response to some text messages, all very bewildering.

Here's the SalesForce equivalent of what I'm trying to do.

In that article you'll see an example HTTP request:

login.salesforce.com/.../authorize;client_id=<your_client_id>&redirect_uri=<your_redirect_uri>

I'm assuming that - ultimately - we can do the same with CRM (it's all HTTP after all) but can't find any info whatsoever on this.

Thanks

*This post is locked for comments

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

    There is an example in the SDK that uses oAuth and HttpClient with HttpRequestMessage.  Just download the 2015 SDK and then search in the compiled help directory for "Windows 8 desktop modern SOAP app". 

  • Community Member Profile Picture
    on at

    Thanks Scott - I'm gonna take a look...

  • Community Member Profile Picture
    on at

    Well the sample is of some use. However it fails because the response to the initial outbound web request isn't as expected. The code expects to see an "authrization_url" present within the returned WWW-Authenticate header. But all I see for this header is ",Negotiate,NTLM".

    Does this suggest a problem with our Dynamics setup?

  • Suggested answer
    ScottDurow Profile Picture
    21 on at

    If you are using OnPrem, to use Auth 2.0 with the SOAP API you'll need have CRM configured using Claims Based auth. The new WebAPI is much easier to use if you are calling using Raw HTTP (and not using the SDK assemblies)

    If you are using CRM online and have an Azure subscription then you can use the new WebAPI (it will be out of preview in the next release). This uses OAuth 2.0 as well - see msdn.microsoft.com/.../dn531009.aspx

    Hope this helps,

    Scott

  • ScottDurow Profile Picture
    21 on at

    BTW - the new WebAPI uses OData 4.0 - www.odata.org/documentation

  • Suggested answer
    Community Member Profile Picture
    on at

    Hi,

    For SOAP endpoint you can refer below links. It explains neatly:

    blogs.msdn.com/.../integrating-microsoft-dynamics-crm-2011-online-with-java-and-other-non-net-clients.aspx

    msdn.microsoft.com/.../jj602979(v=crm.5).aspx

    I hope this helps. If my post answers your question, please mark as "Verified"

  • Suggested answer
    ScottDurow Profile Picture
    21 on at

    @yessoufy Actually - you can use the REST endpoint from an external application since CRM 2015 introduced OAuth support. The old ODATA Rest endpoint is being replaced by the new WebAPI - both use OAuth 2.0 - see msdn.microsoft.com/.../dn531009.aspx

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 > 🔒一 Microsoft Dynamics CRM (Archived)

#1
SA-08121319-0 Profile Picture

SA-08121319-0 4

#1
Calum MacFarlane Profile Picture

Calum MacFarlane 4

#3
Alex Fun Wei Jie Profile Picture

Alex Fun Wei Jie 2

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans