Scheduling content

A guide to scheduling content to website sections via the BaseCMS GraphQL API.

Requirements

You'll need the following information to schedule content via the API:

  • An API URL

  • A BASE instance URL

  • A Tenant Key

  • An active BASE user with permission to read and write data

  • A content ID

If you're missing any of this information, please reach out to support@parameter1.com and we'd be happy to provide it!

Connecting to the API

Connect to the API using a the GraphQL client, programming library, or request utility of your choice. Make sure to send your tenant key along with your request in the x-tenant-key HTTP header. For a detailed example, review the Connecting to the API guide.

Authentication

To modify content, you must first authenticate to the BaseCMS GraphQL API using valid user credentials with access to read and write data. Once complete, send your authentication token along with your request in the authorization header (using the Bearer prefix). For a detailed example, review the Authenticating to the API segment of the Connecting to the API guide.

BASE instance access

In order to route to the correct environment, make sure you send your BASE instance URL along with your request in the x-base4-api-uri HTTP header. For a detailed example, review the Specifying your BASE instance segment of the Connecting to the API guide.

Overview

In BASE terminology, scheduling is the process of hierarchically placing content within a specific organizational structure for the expected viewing medium. BASE currently supports three distinct mediums (referred to as "mutations" or "revisions"): Website, Email, and Magazine. We'll focus on Website-specific scheduling for the purposes of this guide.

A website schedule consists of five pieces of information:

  1. The content item

  2. The website section (and website, for multi-site instances)

  3. The website option (Usually "Standard")

  4. The date the content should start showing up in the website section

  5. (Optionally) The date the content should stop showing up in the website section.

Finding website sections

To find a website section, use the websiteSections query. For an example, review the Primary Section segment of the Creating Content guide.

Creating a website schedule

To create a new website schedule, use the createWebsiteSchedule mutation. This mutation requires (at minimum) the contentId and sectionId.

The mutation can also support a custom startDate, endDate, and optionId. Both startDate and endDate must be specified as a Unix timestamp with millisecond precision. In the example below, the content is now scheduled to the Home section from July 29th 2021 to August 30th 2021.

Uniqueness (E11000 errors)

In BASE, you cannot schedule the same content item to the same section and option (with the same start/end dates) more than once. If you attempt to do so, you'll encounter a duplicate key error. To avoid this error, ensure that the schedule you are creating does .not already exist, or select a different date/time

Last updated