RE: MS CRM 2015 web API to get GUID using telepone1
This would be the Url that you would be using:
crmurl/.../ContactSet$select=ContactId&$filter=Telephone1 eq '(800)%20555-1212'
You can query it in JavaScript as below:
var req = new XMLHttpRequest();
req.open("GET", Xrm.Page.context.getClientUrl() + "/XRMServices/2011/OrganizationData.svc/ContactSet?$select=ContactId&$filter=Telephone1 eq '(800)%20555-1212'", true);
req.setRequestHeader("Accept", "application/json");
req.setRequestHeader("Content-Type", "application/json; charset=utf-8");
req.onreadystatechange = function() {
if (this.readyState === 4) {
this.onreadystatechange = null;
if (this.status === 200) {
var returned = JSON.parse(this.responseText).d;
var results = returned.results;
for (var i = 0; i < results.length; i++) {
var contactId = results[i].ContactId;
}
} else {
Xrm.Utility.alertDialog(this.statusText);
}
}
};
req.send();
You will need to make sure that you add the SDK.REST.js web resource to the form where you want to call this from. Hope this helps.