locked
CRM REST Api RRS feed

  • Question

  • We have one E Commerce web site in which we have to show the products from CRM.

    We are using the CRM REST api to access the products from CRM. But it prompting the UserName and PassWord.

    How can we send the UserName and PassWord to CRM in javascript while calling CRM REST service.

    Wednesday, June 26, 2013 11:55 AM

Answers

  • You can't - the REST endpoint is only available if you are already authenticated - meaning you are using from a web resource inside CRM.

    The REST endpoint for web resources provides an alternative interface to work with Microsoft Dynamics CRM 2011 and Microsoft Dynamics CRM Online data. You can use the REST endpoint to execute HTTP requests by using a service that is based on a Uniform Resource Identifier (URI). The REST endpoint is only available for use by JScript and Silverlight web resources.

    Use the REST Endpoint for Web Resources

    You should look at using the SOAP endpoint

    Unlike the REST endpoint for web resources, the SOAP endpoint uses the Organization service. This is the same service used when writing applications that exist outside of the Microsoft Dynamics CRM 2011 and Microsoft Dynamics CRM Online application.

    Use the SOAP Endpoint for Web Resources


    Jason Lattimer
    My Blog -  Follow me on Twitter -  LinkedIn

    Wednesday, June 26, 2013 12:05 PM
    Moderator

All replies

  • The CRM REST API is not supported outside of the CRM context/domain.  If you would still like to use the REST API to access data in CRM from an external domain you could possibly use an IFRAME to a web resource in CRM that acts as a proxy to the CRM REST service and use window.postMessage to communicate with the IFRAME across domains.  Of course, you would still need to incorporate a method to allow the user to log in to CRM if they are not already authenticated since you may not have access to the web resource if the current user is not logged into CRM already.

    Nick

    Wednesday, June 26, 2013 12:03 PM
  • You can't - the REST endpoint is only available if you are already authenticated - meaning you are using from a web resource inside CRM.

    The REST endpoint for web resources provides an alternative interface to work with Microsoft Dynamics CRM 2011 and Microsoft Dynamics CRM Online data. You can use the REST endpoint to execute HTTP requests by using a service that is based on a Uniform Resource Identifier (URI). The REST endpoint is only available for use by JScript and Silverlight web resources.

    Use the REST Endpoint for Web Resources

    You should look at using the SOAP endpoint

    Unlike the REST endpoint for web resources, the SOAP endpoint uses the Organization service. This is the same service used when writing applications that exist outside of the Microsoft Dynamics CRM 2011 and Microsoft Dynamics CRM Online application.

    Use the SOAP Endpoint for Web Resources


    Jason Lattimer
    My Blog -  Follow me on Twitter -  LinkedIn

    Wednesday, June 26, 2013 12:05 PM
    Moderator
  • Thanks
    Wednesday, June 26, 2013 12:06 PM