11-23-2017 06:02 AM
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
11-24-2017 11:12 AM
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);
11-23-2017 09:52 AM
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.
11-24-2017 11:12 AM
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);
12-15-2023 10:42 AM
Explore our Alfresco products with the links below. Use labels to filter content by product module.