I’m trying to create a content page with the Write API. I’ve gotten very close. The thing I cannot figure out is how to set the Page URL. I can set the title, name and description, but the Page URL is not documented anywhere. There is no example to set it.
const addLandingPageContent = async (data: LandingPageModel) => {
const baseUrl = "https://builder.io/api/v1";
const url = `${baseUrl}/write/page`;
const key = process.env.NEXT_PUBLIC_BUILDER_IO_PRIVATE_API_KEY;
const postData = {
name: data.name,
data: {
pageUrl: '/' + data.name,
title: data.title,
description: data.description,
}
};
return axiosInstance.post(url, postData, {
headers: {
Authorization: `Bearer ${key}`
}
});
};
So this code indeed creates the page with the title and description. The page URL is empty. I tried various spelling and nothing works. Where is the detailed documentation? Normally if documentation is crap you can simply look through the source code for answers but that is not possible here…I can’t find the source code. My “3 minute” integration is going on 4 weeks now and I am really tired.