Posts
Retrieve Posts
You can send a GET request as below to retieve a list of posts.
Javascript
const response = await fetch(
  // 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 = await response();
Create a post
You can send a POST request as below to create a new post.
Javascript
const response = await fetch(
  "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 = await response();