cancel
Showing results for 
Search instead for 
Did you mean: 

Add aspect

pyt
Champ on-the-rise
Champ on-the-rise
Hey,

is it possible to add aspects to a node with RESTful API?
3 REPLIES 3

scouil
Star Contributor
Star Contributor
Hi,

Sure can, that's how Alfresco share itself does it.
If you monitor the request sent when you add an aspect, you'll see it uses this webscript:
http://localhost:8080/alfresco/s/script/org/alfresco/slingshot/documentlibrary/action/aspects.post

Another nice way to find out is to go to http://localhost:8080/alfresco/s/index/all
and then fire a search for you keyword "aspect"

pyt
Champ on-the-rise
Champ on-the-rise
What are the parameters I have to send with my POST request?
Could you give me an example json string please?

When I monitor the same webscript as Alfresco, I see that the webscript needs something like:


{"added":[],"removed":["abc:doc"]}


This is the URL where I send my request:

localhost:8080/share/proxy/alfresco/slingshot/doclib/action/aspects/node/workspace/SpacesStore/f94028fd-d693-4809-a9c6-091f92639243


Everytime I send the POST request I receive the error message: 302 Found…

pyt
Champ on-the-rise
Champ on-the-rise
I've managed to solve my problem.

The request URL has to look like this:

localhost:8080/alfresco/s/slingshot/doclib/action/aspects/node/workspace/SpacesStore/f94028fd-d693-4809-a9c6-091f92639243