web
You’re offline. This is a read only version of the page.
close
Skip to main content

Announcements

News and Announcements icon
Community site session details

Community site session details

Session Id :
Customer experience | Sales, Customer Insights,...
Suggested Answer

How to integrate crm data to the external html web page.

(0) ShareShare
ReportReport
Posted on by 233

Hello,

Can anybody help me to integrate the crm data to the external html page,i tried to integrate the crm data by using web api but not able to retrieve the data , below is my code please anybody suggest me to complete it.

<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta http-equiv="X-UA-Compatible" content="ie=edge">
<title>Login Form</title>
</head>
<body>
<table>
<tr>
<td>
<label style="margin-left: 33px;">URL :</label>
<input type="url" name="URL" placeholder="Enter your URL" id="URL" required>
</td>
</tr>
<tr>
<td>
<label>Username :</label>
<input type="text" name="username" placeholder="Enter your user name" id="username" required>
</td>
</tr>
<tr>
<td>
<label>Password :</label>
<input type="password" name="username" placeholder="Enter your Password" id="password" style="margin-left: 3px;" required>
</td>
</tr>
<tr>
<td>
<label style="font-size: 12px;">Account:</label>
<input name="accountfield" placeholder="Enter your Account field" id="accountfield" style="margin-left: 1px;" required>
</td>
</tr>
<tr>
<td>
<button style="margin-left: 93px;margin-top: 2px;" id="btn">Submit</button>
<button>Cancel</button>
</td>
</tr>
</table>
</body>
<script>
var btn= document.getElementById("btn");

btn.addEventListener('click',function(){
var accountfield= document.getElementById("accountfield").value;
var password= document.getElementById("password").value;
var username = document.getElementById("username").value;
var URL = document.getElementById("URL").value;

var req = new XMLHttpRequest();
req.open("GET", "URL" + "/api/data/v9.1/accounts?$select=name", false);
req.setRequestHeader("OData-MaxVersion", "4.0");
req.setRequestHeader("OData-Version", "4.0");
req.setRequestHeader("Accept", "application/json");
req.setRequestHeader("Content-Type", "application/json; charset=utf-8");
req.onreadystatechange = function() {
debugger;
if (this.readyState == 4) {
req.onreadystatechange = null;
if (this.status == 200) {
var result = JSON.parse(this.responseText);
var results = result.value;
if(results.length >= 1)
{


}
}

}

};

req.send();
})


</script>
</html>

I have the same question (0)
  • Suggested answer
    ajyendra Profile Picture
    1,738 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

Season of Sharing Community Challenge Launch!

Jump in, show your community spirit, and win prizes!

Women in Power Builds Momentum

Expanding mentorship, skilling, and AI innovation

Congratulations to the May Top 10 Community Leaders

These are the community rock stars!

Leaderboard > Customer experience | Sales, Customer Insights, CRM

#1
Hamza H Profile Picture

Hamza H 140 Super User 2026 Season 1

#2
Nagaraju_Matta Profile Picture

Nagaraju_Matta 128

#3
Abhilash Warrier Profile Picture

Abhilash Warrier 70 Super User 2026 Season 1

Last 30 days Overall leaderboard

Product updates

Dynamics 365 release plans