Learn how to import content from external sources to Pages in your Staffbase platform.
Pages are perfect for static content that has lasting relevance or needs only occasional updates.
In this article, you will learn how to create a new page with content from an external source using the Pages API.
This is particularly useful in the following scenarios:
Migration
If you’re transitioning to the Staffbase platform, the Pages API streamlines the process of migrating your content. Migration may be driven by various factors, such as:
Staffbase offers a reliable solution, enabling you to swiftly and efficiently migrate your existing content, minimize disruptions, and maintain business continuity. Learn more about other benefits.
Content Creation Across Multiple Sources
In many organizations, critical information is scattered across multiple systems. The Pages API makes it easy to centralize this content in one place. For example, absence guidelines may be maintained within your HR system but must also be accessible on your intranet to keep employees well-informed. With Staffbase, you can effortlessly import content from various sources to create a cohesive, up-to-date information hub for your team.
spaceId
If you do not want to create the page in the All Employees space, you need to get the spaceId
of the space in which you want to create the page.
GET
request to the endpoint /space
to list all spaces.You have the spaceId
of the space to which you want to import the content.
Before creating a page, you need to upload all the media files from the page using the Media API.
POST
request to the endpoint /media
to upload the file. Learn more.You can repeat the step until all the files on a page are uploaded to the platform server.
POST
request to the endpoint /pages
.Parameter | Required | Description |
---|---|---|
spaceId | No | The unique identifier of the space in which you want to create the page. If no value is provided, by default the page is created in the All employees space. |
published | No | The status of the page. If it is set to true the page is published and if set to false the page remains in draft state. |
externalId | No | The unique external identifier for the space. This is helpful if you want to keep the external id for log purposes during the migration. |
contents | Yes | The object that contains the title and body of the page and specifies the language or regional format to ensure appropriate localization. For example, en_US . |
readers | No | An array of IDs that can view the page. You can add the following IDs:
You can also provide both userID and groupID together. If you do not provide any IDs, the page is not visible to any users. |
adminIds | No | An array of IDs that can manage the page. |
The page is created and it is added as the last item in the menu. Learn how to arrange the order in the main menu.
To bulk trigger creation and import of content to new pages, add a function to loop through multiple POST
requests to perform your request.