Hi,
For call Alfresco Webscript from Share on a controller js we used this code :
var conn = remote.connect("alfresco");
var repoResponse = conn.post("/api/sites", clientRequest, "application/json");
And this work.
So, How call Alfresco REST API on this same context?
See API information : Alfresco Content Services REST API Explorer
var conn = remote.connect("alfresco");
var repoResponse = conn.get("/sites");
Doesn't work...
thx
Solved! Go to Solution.
Hi,
This work fine (Resolve) for Alfresco V5.2 :
var conn = remote.connect("alfresco-api");
var repoResponse = conn.get("/-default-/public/alfresco/versions/1/sites");
logger.warn(repoResponse.status);
You cannot use this "remote.connect" for the new REST API, as is taking a root including an "extra s":
Probably you can add a new connector "alfresco-new" with "endpoint-url" value at "${alfresco.repo.url}/api/-default-/public/alfresco/versions/1" in "share-config-custom.xml" and then you could use remote.connect("alfresco-new"). Anyway I didn't tested this.
Hi,
This work fine (Resolve) for Alfresco V5.2 :
var conn = remote.connect("alfresco-api");
var repoResponse = conn.get("/-default-/public/alfresco/versions/1/sites");
logger.warn(repoResponse.status);
Ask for and offer help to other Alfresco Content Services Users and members of the Alfresco team.
Related links:
By using this site, you are agreeing to allow us to collect and use cookies as outlined in Alfresco’s Cookie Statement and Terms of Use (and you have a legitimate interest in Alfresco and our products, authorizing us to contact you in such methods). If you are not ok with these terms, please do not use this website.