J’ai vérifié => utiliser getGrant().query()
ne pose pas de pb non plus:
package com.simplicite.extobjects.Application;
import org.json.JSONArray;
import com.simplicite.util.exceptions.HTTPException;
import com.simplicite.util.tools.Parameters;
public class Test extends com.simplicite.webapp.services.RESTServiceExternalObject {
private static final long serialVersionUID = 1L;
public Object get(Parameters params) throws HTTPException {
String version = getGrant().query("select sys_value from m_system where sys_code = 'VERSION'").get(0)[0];
return new JSONArray().put("version").put(version);
}
}
$ curl -H 'Authorization: Bearer zHYaUibcEU6Z5n2WoyYmZOeFdtfK4XpD8qdwbT4GBhPuJZjLUY' https://testdaz40.demo.simplicite.io/api/ext/Test
["version","4.0"]