Skip to content
All docs

Contentful setup

Credential: Personal access token

The Contentful connector writes each article as an entry of a content type that you choose. You map the article’s values to the fields of that type. Entries are drafts by default.

Step 1 - create a personal access token

  1. In Contentful, open Settings → CMA tokens.
  2. Click Create personal access token, name it BirchSeek, set an expiry date, and click Generate.
  3. Copy the token. It is shown once.

The token has the rights of your user. Your user must be able to create and edit entries and assets in the space, and to publish them if you set the entry status to Published.

Step 2 - find the ids

Setting Where to find it
Space id Settings → General settings
Environment id master, unless you use another environment
Content type id Content model → your blog type → Content type ID
Data region EU data residency if your space is on app.eu.contentful.com
Locale Optional. Empty uses the space’s default locale

Step 3 - map the fields

Enter field ids, not field names. The title and body fields are required.

Role Field types Value
Title Short text The article title
Body Rich Text, or Long text The article (Rich Text or markdown)
Slug Short text The article slug
Excerpt Short or long text The meta description
Cover image Media, one file The featured image
Tags Short text list, or text The tags
Author Text, or a reference The byline, or the author entry id
Meta title Short or long text The meta title
Meta description Short or long text The meta description
Publish date Date and time The publish date
Schema JSON object, or long text The article’s JSON-LD

For a reference author field, enter the id of the author entry in Author entry id. BirchSeek links every article to that entry.

Step 4 - send a test

Send a test reads your content type and checks that each mapped field exists and has a type from the table. It stores the default locale when you did not set one. When the entry status is Published, the test also fails if a required field has no mapping, because Contentful does not publish an entry with an empty required field. The test writes nothing.

What BirchSeek writes

  • One entry per article, with the id birchseek-{article id}. A retry and a refresh update the same entry. BirchSeek never writes to an entry with another id.
  • The body without the title heading. A Rich Text body has headings, lists, quotes, tables, links and images. Rich Text has no code block, so code is written as a paragraph in the code format. A Long text body gets markdown.
  • Images as assets. Contentful downloads each image from BirchSeek, processes it and publishes it. In a Rich Text body, images are embedded assets. An image that fails is a link to BirchSeek’s copy.
  • Only the mapped fields, in one locale. On an update, BirchSeek keeps the values of fields it does not map and of other locales.

The body ends with the ## Sources block. See Sources and citations.

A video is written as a link, because Rich Text holds no embeds of other sites.

Your frontend

Render the embedded-asset-block nodes of the Rich Text field, and request the entry with include set to 1 or more so the assets come with it. Asset URLs start with //images.ctfassets.net; add https:.

Set Public URL template to the address your site gives an entry, for example https://example.com/blog/{slug}. BirchSeek uses it to check that the page is live and to request indexing.

Troubleshooting

  • 401 AccessTokenInvalid: the token is wrong or expired. Create a new one.
  • 404: check the space id, the environment id and the content type id.
  • 422 ValidationFailed on publish: a required field is empty or a field validation fails. The error names the field.
  • Field type error in the test: map that role to a field of a type from the table in step 3.