cancel
Showing results for 
Search instead for 
Did you mean: 

The parameters when using web script

kevingo
Champ in-the-making
Champ in-the-making
Hello, I am using Alfresco Web Script to do some manipulate on Alfresco. Currently, it's ok to add person or create a new site by web script.

However, the question is : How can I know the parameters I have to POST to alfresco ?

For example, if I want to create a new site, I have to POST a JSON data

{
"title" : "testSite",
"sitePreset" : "test",
"shortName" : "test",
"description" : "This is my test site",
"isPublic" : false
}

Where I can find these parameters when using web script ?

Thanks !
5 REPLIES 5

romschn
Star Collaborator
Star Collaborator
Check the description xml for the webscript.

You could find the desc.xml for create site at following location : \alfresco\WEB-INF\classes\alfresco\templates\webscripts\org\alfresco\repository\site\sites.post.desc.xml

Hope this helps.

Thanks,

mrogers
Star Contributor
Star Contributor
The web script documentation is online.   e.g.  http://www.alfresco.com/help/34/community/api   However create web site that's not part of the public API which may be why that particular script is not documented.

And also if you have admin authority you can see the online webscript index http://localhost:8080/alfresco/service/index

kevingo
Champ in-the-making
Champ in-the-making
Thanks for your reply  Smiley Very Happy

acarpine
Champ in-the-making
Champ in-the-making
Hi kevingo,
have you find how to specify these parameters in a post request to create a site?

I was trying to invoke a specific request using a Firefox add-on called Poster and I'm able to invoke GET/POST webscripts but I don't know how to send json DATA.

Any idea?

thanks,
Andrea

acarpine
Champ in-the-making
Champ in-the-making
I get it. You can use Poster, curl or any other tools to send tha data that you prefer.
With Poster you can put data as JSON directly in the request content. For example I created a site using:
URL: http://localhost:8080/share/service/modules/create-site
User Auth: admin/admin
Content Type: application/json

and adding the data:
{
     "visibility" : "PUBLIC",
     "title" : "My Poster Site",
     "shortName" : "my Poster Site",
     "description" : "My Test Site created with Poster",
     "sitePreset" : "site-dashboard"
}


It's possible do the same with curl.
A great article written by Martin Bergljung is available at at http://ecmstuff.blogspot.it/2012/03/creating-alfresco-share-sites-with.html

Thanks Martin 🙂