Skip to main content

Notifications

Announcements

No record found.

Community site session details

Community site session details

Session Id :
Microsoft Dynamics CRM (Archived)

Calling custom WEB api from JavaScript

(1) ShareShare
ReportReport
Posted on by

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
    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
    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
    55,410 Moderator 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

🌸 Community Spring Festival 2025 Challenge Winners! 🌸

Congratulations to all our community participants!

Adis Hodzic – Community Spotlight

We are honored to recognize Adis Hodzic as our May 2025 Community…

Kudos to the April Top 10 Community Stars!

Thanks for all your good work in the Community!

Leaderboard > Microsoft Dynamics CRM (Archived)

#1
Mohamed Amine Mahmoudi Profile Picture

Mohamed Amine Mahmoudi 83 Super User 2025 Season 1

#2
Community Member Profile Picture

Community Member 52

#3
dkrishna Profile Picture

dkrishna 6

Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans