Skip to main content

Notifications

Announcements

No record found.

Microsoft Dynamics CRM (Archived)

Calling custom WEB api from JavaScript

Posted on by Microsoft Employee

Hi 

We have written new Web API service and it has POST methods.  We deployed it in one server.  CRM domain is enabled from this server.

We are trying to access API this API from HTML webresource in CRM using Javascript  but not able to call and getting below error

XXXXX_Jquery-3.3.1:9600
Mixed Content:
The page at 'abcd.dynamics.com/.../ABC.html' was loaded over HTTPS, but requested an insecure XMLHttpRequest endpoint 'testdomain/.../TestApi'.
This request has been blocked; the content must be served over HTTPS.

We have tried to provide the self sign certificate getting error - 

  • failed to load resource: net::err_cert_authority_invalid

Could please let me know how to resolve this ? 

Thanks

*This post is locked for comments

  • Suggested answer
    Dynamics365 Rocker Profile Picture
    Dynamics365 Rocker 7,755 on at
    RE: Calling custom WEB api from JavaScript

    Below link may help you:

    stackoverflow.com/.../mixed-content-blocked-when-running-an-http-ajax-operation-in-an-https-page

  • Community Member Profile Picture
    Community Member Microsoft Employee on at
    RE: Calling custom WEB api from JavaScript

    Hi

    I have used the self signed certificate and assigned to WEB API in web server.   But it gives error like

    "failed to load resource: net::err_cert_authority_invalid"

    The certificate is created locally and not provided by any Certificate Authority. This might be reason for above one.

    Please let me know how we can remove this error ?

    Thanks

  • Suggested answer
    RaviKashyap Profile Picture
    RaviKashyap 55,410 on at
    RE: Calling custom WEB api from JavaScript

    Hi,

    Based on the error message "This request has been blocked; the content must be served over HTTPS", it looks like you are calling the service as http whereas it is hosted as https. Did you try change it to https?

    Hope this helps

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!

Tips for Writing Effective Suggested Answers

Best practices for providing successful forum answers ✍️

Leaderboard

#1
André Arnaud de Calavon Profile Picture

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

#2
Martin Dráb Profile Picture

Martin Dráb 230,198 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans