locked
I want to consume an OData endpoint of CMR Dynamics online RRS feed

  • Question

  • I want to query CRM Online through an OData endpoint using java or javascript in a module that is NOT a webresource.

    I found several movies and presentations that extract data from CRM using OData but all these assume you are authenticated and the query is executed in the same context.

    I am looking for something like OAuth, where I can register my remote application, ask for access rights (read only) and retrieve an applicationKey and Secret.

    Much like the SharePoint 2013 OAuth support.

    Is this possible ?

    Friday, April 26, 2013 12:05 PM

Answers

All replies

  • This is not possible you would need to use the SOAP endpoint outside CRM. Use the REST Endpoint for Web Resources

    Authentication is only possible within the application. 

    Use of the REST endpoint is limited to JScript libraries or Silverlight web resources.


    Jason Lattimer
    My Blog -  Follow me on Twitter -  LinkedIn

    Friday, April 26, 2013 1:20 PM
    Moderator
  • Thanks Jason,

    I have seen this statement in presentations and other material. So I know there is no official support.

    But given the fact that REST by nature is stateless, there must be a way to provide enough http header informatie, right ?

    I can request the OData URLs from a browsers once I have been authenticated...

    I'll also take a look at the SOAP endpoint

    Saturday, April 27, 2013 6:22 AM
  • Hi This is not possible with online. Use SOAP endpoint. Hope this helps. ----------------------------------------------------------------------- Minal Dahiya If this post answers your question, please click "Mark As Answer" on the post and "Vote as Helpful"
    • Proposed as answer by Minal Dahiya Saturday, April 27, 2013 10:23 AM
    Saturday, April 27, 2013 10:23 AM
  • Thanks both Jason and Minal

    I'll investigate the java sample

    CRM2011Kit/Labs/CRMOnlinefromJava/Source/end/Java2CRMOnline/

    Saturday, April 27, 2013 11:42 AM
  • Likely not supported, but theoretically possible to use http calls programmatically to 'log in' to CRM and capture the cookie(s) that get generated, then apply those cookies to your OData call. That's essentially why OData calls just work when you use an OData URL once you have logged into CRM already, the appropriate cookie information is already present. Again, this could break on any rollup, but I /suspect/ you could make it work. I've been meaning to test this theory for a while, but haven't gotten there yet.


    EDIT - REPEAT - UNSUPPORTED ALERT - this could stop working anytime MS changes how the endpoint or the auth cookies work, but I just tested an Android app that lets you 'log on' to CRM using a WebView pointed at the CRM website, then I captured the cookies from that WebView, closed the WebView, and attached those cookies to my programmatic HttpClient REST calls to OrganizationData.svc - and it worked. Do I recommend it? Not really...but...you never know.
    • Edited by Ken Heiman Tuesday, May 14, 2013 7:55 PM
    Wednesday, May 8, 2013 3:21 PM