AnsweredAssumed Answered

Hit External API

Question asked by drozes on Mar 13, 2012
Latest reply on Mar 21, 2012 by drozes
Hello All;
New to Alfresco and appreciate any help available.

Trying to make a simple server side request to a URL (ie. http://mycompany.com/apiservice?method=getDocuments)

I'll create the webscript's xml file and am able to hit the URL successfully:
<webscript>
  <shortname>Tests</shortname>
  <description>Sample Tests</description>
  <url>/sample/tests</url>
  <authentication>user</authentication>
</webscript>


I now need the controller method to execute on server side and pass the data in to my ftl.

Once again, this needs to be server side to avoid cross domain issues.

Thanks for any help.


*Addition:

currently my server side javascript is doing:

// change the name of this document
document.properties.name = "User_File-" +document.properties.name;
//Add property
document.properties["cm:status"] = "Not Started";
// save the property modifications
document.save();

//Need to hit External API - Indiciating new document.
response = hiturl(" http://mycompany.com/apiservice?method=addNewDoc")

Outcomes