Slug generation when creating an entry using Content Management APIs

Hi,

As part of data migration to contentful, we are using the APIs provided by contentful to create new entries. Our current CMS does not have a slug field. But the contentful model has a slug field that is supposedly generated automatically.

But up on creating entries, we dont see slug being created as expected. These entries do have titles. Is there something missing at our end? Or is required by design that we create a slug and set it when creating an entry using the API? I believe that defeats the purpose of saying that “slug is generated”

Please advise.

Thanks,
SG

1 Like

Hi @sgopal ,

I believe that the Automatic Slug generation works only on our Web App, since it’s provided by the builtin Slug Generator UI Extension, that you can select when configuring the field. In CMA the slug will not be automatically generated. It should be, however, quite easy to implement a transformation from your entry title to slug.

The rule is usually to transform all to lowercase letters, with no punctuation or spaces, and with any of them replaced by a dash “-” (to make the URL more readable). Hope this suggestion might help.