Skip to content
All docs

Drupal setup

Credential: JSON:API + Basic Auth

The Drupal connector writes each article as a node of one content type through Drupal core JSON:API. Drupal 9, 10, 11 and Drupal CMS work. You need no contributed module. Nodes are unpublished drafts by default.

Your site must be on the internet over https. BirchSeek does not connect to private addresses.

Step 1 - turn on the modules

  1. Go to Extend (/admin/modules).
  2. Turn on JSON:API and HTTP Basic Authentication. Click Install.

Step 2 - allow JSON:API writes

JSON:API is read-only by default.

  1. Go to Configuration → Web services → JSON:API (/admin/config/services/jsonapi).
  2. Select Accept all JSON:API create, read, update, and delete operations.
  3. Click Save configuration.

Step 3 - make a user for BirchSeek

  1. Go to People → Roles and add a role, for example BirchSeek.

  2. Go to People → Permissions and give the role these permissions:

    Permission Why
    Article: Create new content Create nodes of your content type
    Article: Edit any content (or Edit own content) Update the node on a republish
    View own unpublished content Find its own draft again
    Administer content, or Administer node published status Set the node status
    Create and edit URL aliases Set the URL alias
    Tags: Create terms Add tags that do not exist yet
    Use the Full HTML text format Tables, images and JSON-LD in the body

    Set the author (an author UUID) also needs Administer content. With Content Moderation, give the role the workflow transitions to Draft and Published instead of the status permission.

  3. Go to People → Add user. Make the user, give it the role, and set a strong password.

Five wrong passwords lock the user for six hours. Copy the password with care.

Step 4 - connect in BirchSeek

Setting Meaning
Site URL The root of your site, for example https://example.com. Not /jsonapi
Username The user from step 3
Password Its password
Content type The machine name from Structure → Content types, article by default
Text format full_html (default) keeps tables and images. basic_html removes some
Body field body by default
Node status Unpublished (default) or Published. Applies when BirchSeek makes the node

The optional settings:

Setting Value
Image field An image field, field_image on Article. Gets the featured image
Tags field A reference to taxonomy terms, field_tags on Article
Tags vocabulary The vocabulary machine name, tags by default
URL alias For example /blog/{slug}. Empty keeps /node/ID or your Pathauto pattern
Metatag field The Metatag module’s field, for example field_meta_tags
Author UUID A user’s UUID. Empty makes the BirchSeek user the author
Write the summary Yes puts the meta description in the body summary. No for a body with no summary
JSON-LD in the body Yes adds the article’s JSON-LD at the end of the body. Needs Full HTML
Content Moderation Yes when the content type is in a workflow

Step 5 - send a test

Send a test signs in, finds your content type in JSON:API, and reads one node to check the field names. It also sends a create that Drupal must refuse, to see if JSON:API accepts writes. The test makes no node.

When Pathauto is on, the test finds it. BirchSeek then sends pathauto: 0 with the alias, so Pathauto keeps your alias.

What BirchSeek writes

  • The body without the title heading. Drupal shows the node title as the heading. The body is HTML in your text format.
  • Images on your site. With an image field, BirchSeek uploads each image through that field and finds it by name on the next publish. In-article images point at the uploaded file and are tracked as used, so Drupal keeps them. Without an image field, images stay on BirchSeek.
  • Tags as terms. BirchSeek finds each tag by name in the vocabulary, or makes it.
  • One node per article. BirchSeek gives each article one node UUID. A retry or a refresh updates that node, and a node that you wrote is never changed.
  • No status change on update. An update does not change the status, the URL alias or the author.

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

Drupal core has no scheduling. BirchSeek’s calendar times each write.

Troubleshooting

  • “answered as for an anonymous visitor”: the username or password is wrong, or HTTP Basic Authentication is off.
  • 405 / “read-only mode”: do step 2.
  • 403 “not allowed to POST the selected field (status)”: give the role Administer content or Administer node published status. The field name tells you the permission.
  • 422 “The alias … is already in use”: another page has this URL. Change the article slug.
  • 404: check the site URL and the content type machine name.