REST API

Docswrite API

Introduction

You can make a POST request to the endpoint URL to create/update a blog post/page on your WordPress site. You can even mention most of the parameters in the Google Docs document itself.

  • Create a table in the Google Docs document. It should be the first table in the document.
  • The table should have two columns. The first column should contain the parameter name and the second column should contain the parameter value.
  • The column name should be docswrite_settings. Otherwise, we won't be able to read the table.

For example, you can add a title parameter in the Google Docs document itself and it will be used as the title of the blog post.

Demo Google Docs with table Link to the Google Docs (opens in a new tab)

ℹ️

First, you need to connect your WordPress site to Docswrite. Once you have connected your WordPress site, you will be able to make API requests to create & update posts and pages on your WordPress site.

Endpoint URL to create/update a blog post/page on WordPress

  1. Login to your Docswrite account (opens in a new tab) and go to the settings page.

Grab endpoint url

  1. Grab the endpoint URL from the Docswrite settings page. It will look something like this:
https://api.docswrite.com/api/export?token=xxx
 

Supported parameters

Click here to see the list of supported parameters

Example Request body

{
  "google_docs_url": "https://docs.google.com/document/d/1aBcDeFgHiJkLmNopQrStUvWxYz/edit?usp=sharing",
  "title": "Example Blog Post Title",
  "slug": "example-blog-post-title",
  "tags": "example, blog post",
  "categories": "uncategorized",
  "state": "draft",
  "author": "Jane Doe",
  "date": "2023-04-01 09:00:00",
  "excerpt": "This is an example excerpt for the blog post.",
  "post_type": "post",
  "featured_image_url": "https://images.unsplash.com/photo-1662572091420-95992f339784?ixlib=rb-4.0.3&ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&auto=format&fit=crop&w=2340&q=80",
  "featured_image_alt_text": "Example Featured Image Alt Text",
  "featured_image_caption": "Example Featured Image Caption",
  "export_settings": {
    "compress_images": true,
    "demote_headings": false,
    "convert_to_webp": true,
    "first_image_as_featured_image": true,
    "add_no_follow_to_external_links": true,
    "bold_as_strong": false
  },
  "newspack_settings": {
    "newspack_article_summary": "This is an example article summary for the blog post.",
    "newspack_article_summary_title": "Example Article Summary Title",
    "newspack_post_subtitle": "Example Post Subtitle"
  },
  "yoast_settings": {
    "yoast_focuskw": "example",
    "yoast_metadesc": "This is an example meta description for the blog post.",
    "yoast_title": "Example Blog Post Title"
  },
  "rankmath_settings": {
    "rank_math_focus_keyword": "example"
  }
}