Hi,
CRM OOB provides odata endpoint for CRM 2016. You can use below managed solution to create resturl.
github.com/.../releases
Download and Install managed solution in your crm instance. Then create request which can be used from CRM.
If you are looking for restful service which has to be available publicly on the internet then you will have you create custom Rest web service and host so that it will be avialable on the internet.
docs.microsoft.com/.../build-restful-apis-with-aspnet-web-api
Odata 2011 create Phonecall activity code
var entity = {};
entity.DirectionCode = true;
entity.Subject = "Call with Test customer";
entity.RegardingObjectId = {
Id: "00000000-0000-0000-0000-00000001",
LogicalName: "lead"
};
entity.PhoneNumber = "1234567890";
var req = new XMLHttpRequest();
req.open("POST", encodeURI(Xrm.Page.context.getClientUrl() + "/XRMServices/2011/OrganizationData.svc/PhoneCallSet"), 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 === 201) {
var result = JSON.parse(this.responseText).d;
var newEntityId = result.PhoneCallId;
} else {
Xrm.Utility.alertDialog(this.statusText);
}
}
};
req.send(JSON.stringify(entity));
If found helpful, Please mark my answer verified.