Is it possible to check the version of Connect via JavaScript?

We have a set of servers that are on Connect version 1.8 and servers that are on Connect version 2018.1.3.

We’re currently maintaining two separate versions of the same Connect Designer templates as we are unable to open a 2018.1.13 template in 1.8 and we are finding some JavaScript code works in one version, but not the other.

Is it possible to check the version of Connect that is running on a server via JavaScript?

If so, then we can then maintain a single 1.8 template as a base template (as it could also be opened in 2018.1.3) and conditional logic could run snippets of code based on the version installed.

I’ll have to run through some tests, but, it looks like the following may work:

var connectVersion = merge.template.properties.application;

Only partially works, does not show the version of Connect that is running on the server, rather, it shows the version of Connect that was used to save that template.

So when I open a 1.8 Connect Designer file on a 2018.1.3 server, it will show 1.8 until I click save and close. When I re-open the file, it will then show 2018.1.3.

You can use JavaScript to perform http request to Connect’s REST API as per http://help.objectiflune.com/en/planetpress-connect-rest-api-cookbook/2018.1/#Cookbook/REST_API_Reference/Authentication_Service/Service_Version.htm

for example:

http://connectserver.local:9340/rest/serverengine/authentication/version

I can get it to work in Workflow using the ‘HTTP Client Input’ plugin, but, having issues implementing in the Designer Control script.

The working examples I found are for creating a webpage outside of Designer:

http://help.objectiflune.com/en/planetpress-connect-rest-api-cookbook/2018.1/#Cookbook/Working_Examples/Server_Security_&_Authentication.htm

Do you have an example of how to connect to the REST API within the Designer Control Script?

I was able to get the version in the DataMapper using the following:

var request = createHTTPRequest();

var url = ‘http://localhost:9340/rest/serverengine/authentication/version’;

request.open(“GET”,url,“ol-admin”,“password”);

request.send();

request.response;