Retrieve Posts

You can send a GET request as below to retieve a list of posts.

Javascript

const response =awaitfetch(
// you can change the page number for pagination
"https://write.superblog.ai/api/sites/supername/your-supername/posts?page=1&getPostContent=true",
{
headers:{
//.....
//.....
"x-superblog-access-key":"your-api-key",
},
}
);

const data =awaitresponse();

Create a post

You can send a POST request as below to create a new post.

Javascript

const response =awaitfetch(
"https://write.superblog.ai/api/sites/supername/your-supername/posts",
{
headers:{
//.....
//.....
"x-superblog-access-key":"your-api-key",
},
// Mandatory fields
body:JSON.stringify({
post:{
status:"PUBLISHED",
hideSharingIcons:false,
enableComments:false,
title:"sample post title hola",
tagIds:[],
content:"<p>hello world</p>",
},
}),
}
);

const data =awaitresponse();
Powered by Superblog