Retrieve Supported Languages in dotCms Site

12 views
Skip to first unread message

Zeyad Abdelwahab

unread,
Mar 31, 2021, 7:16:16 AM3/31/21
to dotCMS User Group
Hello All,

Is there a way to fetch all the supported languages in a site ?

I tried to look into the dotCms for a query to fetch the languages in the same case it fetches the content type but I could not find any.

I am trying to fetch all the supported languages by an api call in an external system.

Thanks

Will Ezell

unread,
Mar 31, 2021, 9:06:33 AM3/31/21
to dot...@googlegroups.com
Are you looking for all languages for a specific piece of content?  Or just all languages?  To pull languages in the system, use /api/v2/languages

https://demo.dotcms.com/api/v2/languages



If you want to get the languages available for a piece of content, you could use an aggregation query, something like: 
{
  "query": {
  "query_string": {
     "query": "+path:\\/destinations\\/costa-rica"
   }
},
"aggs": {
   "lang": {
      "terms": {
        "field": "languageid",
        "size": 100
      }
   }
},
"size": 0
}


--
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/33dcbef1-bc5b-4627-8aa9-c711a927ea4en%40googlegroups.com.


--



382 NE 191st St #92150
Miami, Florida 33179-3899
Main: 
305-900-2001 | Direct: 978.294.9429

   
Reply all
Reply to author
Forward
0 new messages