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)

Accessing webapi through javascript from external website

(0) ShareShare
ReportReport
Posted on by 195

Hi,

    I have a website from which i want to access the crm through webapi using JavaScript. How to Achieve this?

Thanks & Regards,

Aldous Huxley V

*This post is locked for comments

I have the same question (0)
  • Suggested answer
    jestuder Profile Picture
    158 on at

    Here is a link that might help you.  Also are you trying to write data to CRM or read from CRM?

    msdn.microsoft.com/.../gg334279.aspx

  • Suggested answer
    Aric Levin - MVP Profile Picture
    30,190 Moderator on at

    You can try using the WebApi library by David Yack. It's a lightweight library with different methods of authentication:

    github.com/.../Xrm.Tools.CRMWebAPI

    Hope this helps.

  • ah1994 Profile Picture
    195 on at

    Hi Aric, Can u give me some sample or example?

  • Suggested answer
    JohnAnonymous Profile Picture
    5,241 on at

    Hi,

    If you are trying to access CRM data through Javascript from an external website, please know that this is not possible. The CRM api needs authentication and a user context and doesn't allow anonymous access. And passing credentials in Javascript is not secure.

    If you need to show data on you website, you need a server api between your website and CRM that handles your authentication.

    The links above are for using javascript within CRM.

  • Suggested answer
    jestuder Profile Picture
    158 on at

    I agree with you that JavaScript is not secure since it runs in the DOM and the better approach is to connect through the back end.  But, if you are using an application like node.js it allows JavaScript to run on a server just like we are use to with C#.  Here is another article I found where a user gives an example of using JavaScript in a web portal with a link to github.

    community.dynamics.com/.../web-api-authentication-from-javascript

  • JohnAnonymous Profile Picture
    5,241 on at

    Hi James,

    I wasn't considering NodeJS as an option. I agree, if it's node JS you can securely call the api's.

  • Suggested answer
    Santosh bhagat Profile Picture
    464 on at

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