Scheduling content
A guide to scheduling content to website sections via the BaseCMS GraphQL API.
Last updated
A guide to scheduling content to website sections via the BaseCMS GraphQL API.
Last updated
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.
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.
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.
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:
The content item
The website section (and website, for multi-site instances)
The website option (Usually "Standard")
The date the content should start showing up in the website section
(Optionally) The date the content should stop showing up in the website section.
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.
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.