Retrieve all aspect and type definitions from Alfresco repository via Rest API

cancel
Showing results for 
Search instead for 
Did you mean: 
OomStephan
Member II

Retrieve all aspect and type definitions from Alfresco repository via Rest API

Jump to solution

Good day

 

Is there a way to retrieve a list all the defined properties and aspects from the Alfresco repository?

 

Appreciate the help in advance.

 

Regards

 

Stephan

1 Solution

Accepted Solutions
abhinavmishra14
Advanced

Re: Retrieve all aspect and type definitions from Alfresco repository via Rest API

Jump to solution

Try this REST API if suits your requirements:

GET /alfresco/service/api/dictionary 

http://127.0.0.1:8080/alfresco/service/api/dictionary

GET /alfresco/s/api/defclasses

http://127.0.0.1:8080/alfresco/s/api/defclasses

GET /alfresco/service/api/classes/{className}

http://127.0.0.1:8080/alfresco/service/api/classes/cm_content (type)
http://127.0.0.1:8080/alfresco/service/api/classes/cm_auditable (aspect)

For a specific node:

GET /alfresco/service/api/classes/{classname}/properties?nsp={namespacePrefix?}&n={name?}
GET /alfresco/service/api/properties?nsp={namespacePrefix?}&n={name?}

 

Example:

http://127.0.0.1:8080/alfresco/service/api/properties?nodeRef=workspace://SpacesStore/1c76d9a6-8d01-...

 

 

Visit this doc for more details: https://docs.alfresco.com/5.0/references/RESTful-Dictionary.html

~Abhinav
(ACSCE, AWS SAA, Azure Admin)

View solution in original post

7 Replies
EddieMay
Alfresco Employee

Re: Retrieve all aspect and type definitions from Alfresco repository via Rest API

Jump to solution

Hi @OomStephan,

To retrieve aspects, take a look at this API documentation - although this method will depend on how old your Alfresco instance is. For Alfresco 5,2+ the API call will be something like the following:

'http://localhost:8080/alfresco/api/-default-/public/alfresco/versions/1/nodes/-root-/children?include=aspectNames&skipCount=0&maxItems=100'

For the properties, something like this:

http://localhost:8080/alfresco/api/-default-/public/alfresco/versions/1/nodes/-root-/children?include=aspectNames,properties&skipCount=0&maxItems=100' 

HTH,

Digital Community Manager, Alfresco Software.
Problem solved? Click Accept as Solution!
OomStephan
Member II

Re: Retrieve all aspect and type definitions from Alfresco repository via Rest API

Jump to solution

Hi Eddie

 

Thanks for the reply, I am aware of the documentation you linked. However, does this not retrieve the aspects/properties for the specific node?

 

My use case is that I would like to retrieve all available defined aspects/properties and display them to my user, so that the user can decide what properties he would like to add.

 

Thanks in advance.

 

Regards

 

Stephan

OomStephan
Member II

Re: Retrieve all aspect and type definitions from Alfresco repository via Rest API

Jump to solution

Just to add to the above, is there an endpoint that does not require a nodeId as parameter and instead returns all available aspects and/or properties that can be applied to a node, both system and custom aspects?

 

Stephan

EddieMay
Alfresco Employee

Re: Retrieve all aspect and type definitions from Alfresco repository via Rest API

Jump to solution

Hi @OomStephan,

I presume you've looked at NodeService? There is a discussion here about using it.

HTH,

Digital Community Manager, Alfresco Software.
Problem solved? Click Accept as Solution!
abhinavmishra14
Advanced

Re: Retrieve all aspect and type definitions from Alfresco repository via Rest API

Jump to solution

Try this REST API if suits your requirements:

GET /alfresco/service/api/dictionary 

http://127.0.0.1:8080/alfresco/service/api/dictionary

GET /alfresco/s/api/defclasses

http://127.0.0.1:8080/alfresco/s/api/defclasses

GET /alfresco/service/api/classes/{className}

http://127.0.0.1:8080/alfresco/service/api/classes/cm_content (type)
http://127.0.0.1:8080/alfresco/service/api/classes/cm_auditable (aspect)

For a specific node:

GET /alfresco/service/api/classes/{classname}/properties?nsp={namespacePrefix?}&n={name?}
GET /alfresco/service/api/properties?nsp={namespacePrefix?}&n={name?}

 

Example:

http://127.0.0.1:8080/alfresco/service/api/properties?nodeRef=workspace://SpacesStore/1c76d9a6-8d01-...

 

 

Visit this doc for more details: https://docs.alfresco.com/5.0/references/RESTful-Dictionary.html

~Abhinav
(ACSCE, AWS SAA, Azure Admin)
OomStephan
Member II

Re: Retrieve all aspect and type definitions from Alfresco repository via Rest API

Jump to solution

Exactly what I am looking for. Thank you very much!

 

Stephan

EddieMay
Alfresco Employee

Re: Retrieve all aspect and type definitions from Alfresco repository via Rest API

Jump to solution

Hi @OomStephan,

Glad that @abhinavmishra14 was able to help you out & thanks for accepting his solution - really helpful to other users too.

Best wishes, 

Digital Community Manager, Alfresco Software.
Problem solved? Click Accept as Solution!