Content Javascript API - search for bullet record

I see how to request a record by id.

Is there any way to search on slug? This is what I really want to do.

Thanks!

+5
source share
2 answers

Why can't you just do a standard query against CDA?

/spaces/[space_id]/entries?fields.slug=[my_slug] 
+4
source

If you use the SDK , you can also do

 this.contentfulClient.getEntries({ content_type: 'YOUR_CONTENT_KEY', 'fields.slug[in]': 'THE_SLUG_YOU_ARE_LOOKING_FOR', }) 
0
source

Source: https://habr.com/ru/post/1258780/


All Articles