I'm evaluating Contentful.com as the Content Engine for an Angular SPA.
The issue I'm facing is with retrieving entries by content type (e.g. get all entries of type "blog"). As described in the documentation example, this is done as follows:
/spaces/spaceid/entries?access_token=token&content_type=cat
So in my case rather than "cat", content_type="blog" or content_type="news" would be how I'd expect to interact.
The reality I'm facing is that retrieving things via content_type doesn't let me use the name of my content type - it expects the ID which is an ugly GUID, so my queries look like this:
/spaces/spaceid/entries?access_token=token&content_type=2wKn6yEnZewu2SCCkus4as
The troubles with this is:
- not developer friendly
- not portable across environments (i.e. a test Space and a production space)
The only solution I can see at present is to pre-retrieve a content-type to id mapping on page load and use that - but it's not going to be so great for performance.
The documentation appears to always use friendly readable content-type ids (e.g. cat) but this isn't my experience.
So, to solve this, is there:
- a way to set content-types to have friendly ids? or
- a way to retrieve the entry by name using a different query parameter?