I am working On WebAPI for retrieving data. WebAPI endpoint is something we build like this
var orgUrl = Xrm.Page.context.getClientUrl();
var apiVersion = "/api/data/v8.2/";
var query = "?$select=ObjectTypeCode&$filter=LogicalName eq " + "'" + entityname + "'";
var queryString = orgUrl + apiVersion + "EntityDefinitions" + query;
But I have the main problem is that we have 2013,2015,2016 and also V9.0. I cannot hard code the Versions like v8.2 or v7.0 or v6.1 . If i have to hard code, i need to maintain 3 different copies just for small change in endpoint.
I can get CRM version from Soap Request and I can define the endpoint But Soap Request is deprecating. I don't want to use that.
Is there a better way to know what is the WebApi endpoint? or a better way that working in any CRM.
*This post is locked for comments
I have the same question (0)