Get requests for getting data

40 views
Skip to first unread message

Alex Mika

unread,
Feb 15, 2021, 8:28:24 AM2/15/21
to dotCMS User Group
I want to be able to do the following requests using curl:

1. Get all child of categories by categoryKey or Name
2. Get all entities of specific contenttype --> returns: meta data and all meta data of related relationship entity


Please help me with curl commands this will help me for my project thanks

Falzone, Chris

unread,
Feb 15, 2021, 11:48:03 AM2/15/21
to dot...@googlegroups.com
> 1. Get all child of categories by categoryKey or Name
Not sure this is possible.  I think the only Rest API method for categories only returns the top level ones and I don't see a way to do anything useful to get the children.
You can filter this but I couldn't quickly figure out how:  curl -H "Content-Type: application/json" -u ad...@dotcms.com:admin -XGET http://localhost:8080/api/v1/categories


> 2. Get all entities of specific contenttype --> returns: meta data and all meta data of related relationship entity
The Content API gets you everything you need here, might need more than 1 curl request though - https://dotcms.com/docs/latest/content-query-api
Example:  curl -H "Content-Type: application/json" -u ad...@dotcms.com:admin -XGET http://localhost:8080/api/content/query/%2BcontentType%3AProduct

Might help if you explain what you are trying to do.  Hope it helps!

--
http://dotcms.com - Open Source Java Content Management
---
You received this message because you are subscribed to the Google Groups "dotCMS User Group" group.
To unsubscribe from this group and stop receiving emails from it, send an email to dotcms+un...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/dotcms/e87cf418-3b39-4481-8d32-983f59a4316bo%40googlegroups.com.


--

Christopher Falzone / 

Web Developer

aquent.com

501 Boylston St., 3rd Floor, Boston, MA 02116


A Q U E N T  /  VITAMIN T

Alex Mika

unread,
Feb 16, 2021, 9:09:54 AM2/16/21
to dotCMS User Group
Thanks, could you please help me to how to filter it? i need all child of specifit parent of category


On Monday, 15 February 2021 17:48:03 UTC+1, Chris Falzone wrote:
> 1. Get all child of categories by categoryKey or Name
Not sure this is possible.  I think the only Rest API method for categories only returns the top level ones and I don't see a way to do anything useful to get the children.
You can filter this but I couldn't quickly figure out how:  curl -H "Content-Type: application/json" -u ad...@dotcms.com:admin -XGET http://localhost:8080/api/v1/categories

> 2. Get all entities of specific contenttype --> returns: meta data and all meta data of related relationship entity
The Content API gets you everything you need here, might need more than 1 curl request though - https://dotcms.com/docs/latest/content-query-api
Example:  curl -H "Content-Type: application/json" -u ad...@dotcms.com:admin -XGET http://localhost:8080/api/content/query/%2BcontentType%3AProduct

Might help if you explain what you are trying to do.  Hope it helps!

On Mon, Feb 15, 2021 at 8:28 AM Alex Mika <shind...@gmail.com> wrote:
I want to be able to do the following requests using curl:

1. Get all child of categories by categoryKey or Name
2. Get all entities of specific contenttype --> returns: meta data and all meta data of related relationship entity


Please help me with curl commands this will help me for my project thanks

--
http://dotcms.com - Open Source Java Content Management
---
You received this message because you are subscribed to the Google Groups "dotCMS User Group" group.
To unsubscribe from this group and stop receiving emails from it, send an email to dot...@googlegroups.com.

Falzone, Chris

unread,
Feb 16, 2021, 10:41:14 AM2/16/21
to dot...@googlegroups.com
I'd use some script language you are comfortable with, pull all of them and then filter it down in code.  There is no documentation on this endpoint at all and what that filter parameter is supposed to accept so I can't really help there. But from what I can see just hitting it locally on my machine, it does not contain the information you are looking for.  You might have to do something like make a page in dotCMS that uses velocity to pull what you want and spit out something you can call with curl and parse out easily. 

To unsubscribe from this group and stop receiving emails from it, send an email to dotcms+un...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/dotcms/eeb62f6a-dda0-4821-ad95-426fc8b7ac60o%40googlegroups.com.


--

Christopher Falzone

DevOps Engineer

Reply all
Reply to author
Forward
0 new messages