Code

The ClearBlade Java API allows executing a Code Service on the platform from your Java application.

Please make sure that you have initialized and authenticated with the ClearBlade platform prior to using the Code API.

You will need to clone the following C# repository for using the Code API:
https://github.com/ClearBlade/CSharp-SDK/

Code Service Without Parameters

A code service which does not take any parameters can be executed as follows:

string serviceName = "yourServiceName";
ClearBladeCodeService codeService = new ClearBladeCodeService(serviceName);
codeService.executeWithoutParams(serviceName);

Code Service With Parameters

A string object of parameters needs to be passed to the ClearBladeCodeService class constructor along with the service name:

string serviceName = "yourServiceName";
string parameters = "{\"param1\":\"value1\"}";
ClearBladeCodeService codeService = new ClearBladeCodeService(serviceName, parameters);
codeService.executeWithParams(serviceName, parameters);