BaseCMS GraphQL API
Documentation Home
  • Getting Started
  • Connecting to the API
  • Modifying Data
    • Introduction
    • Creating a redirect
    • Creating content
    • Modifying content
    • Scheduling content
  • Querying Data
    • Introduction
    • Retrieving a Company
    • Retrieving multiple Companies
    • Retrieving published content
Powered by GitBook
On this page
  • Requirements
  • Connecting to the API
  • Overview
  • Finding website sections
  • Creating a website schedule
  1. Modifying Data

Scheduling content

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

PreviousModifying contentNextIntroduction

Last updated 3 years ago

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 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 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 segment of the 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 segment of the 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

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

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

support@parameter1.com
Connecting to the API
Connecting to the API
Connecting to the API
Creating Content
Creating a website schedule using minimal arguments to `createWebsiteSchedule`.
Creating a website schedule using maximal arguments to `createWebsiteSchedule`.
An E11000 error when attempting to insert a duplicate website schedule.
Authenticating to the API
Specifying your BASE instance
Primary Section