curl --request POST \
--url 'https://api.docswrite.com/api/export?token=' \
--header 'Content-Type: application/json' \
--data '
{
"google_docs_url": "https://docs.google.com/document/d/1aBcDeFg/edit",
"title": "My Blog Post",
"slug": "my-blog-post",
"tags": "technology, wordpress, automation",
"categories": "Technology, Tutorials",
"state": "draft",
"author": "John Doe",
"date": "2024-04-01 09:00:00",
"excerpt": "This is a brief description of the post content.",
"post_type": "post",
"featured_image_url": "https://example.com/image.jpg",
"featured_image_alt_text": "Description of the featured image",
"featured_image_caption": "Image caption text",
"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,
"wp_content_editor": "classic"
},
"yoast_settings": {
"yoast_focuskw": "wordpress automation",
"yoast_metadesc": "Learn how to automate WordPress publishing with Docswrite",
"yoast_title": "WordPress Automation Guide | My Site",
"yoast_canonical": "https://example.com/wordpress-automation"
},
"rankmath_settings": {
"rank_math_focus_keyword": "wordpress automation"
},
"newspack_settings": {
"newspack_article_summary": "This article covers WordPress automation techniques",
"newspack_article_summary_title": "WordPress Automation Summary",
"newspack_post_subtitle": "A comprehensive guide to automation"
}
}
'import requests
url = "https://api.docswrite.com/api/export?token="
payload = {
"google_docs_url": "https://docs.google.com/document/d/1aBcDeFg/edit",
"title": "My Blog Post",
"slug": "my-blog-post",
"tags": "technology, wordpress, automation",
"categories": "Technology, Tutorials",
"state": "draft",
"author": "John Doe",
"date": "2024-04-01 09:00:00",
"excerpt": "This is a brief description of the post content.",
"post_type": "post",
"featured_image_url": "https://example.com/image.jpg",
"featured_image_alt_text": "Description of the featured image",
"featured_image_caption": "Image caption text",
"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,
"wp_content_editor": "classic"
},
"yoast_settings": {
"yoast_focuskw": "wordpress automation",
"yoast_metadesc": "Learn how to automate WordPress publishing with Docswrite",
"yoast_title": "WordPress Automation Guide | My Site",
"yoast_canonical": "https://example.com/wordpress-automation"
},
"rankmath_settings": { "rank_math_focus_keyword": "wordpress automation" },
"newspack_settings": {
"newspack_article_summary": "This article covers WordPress automation techniques",
"newspack_article_summary_title": "WordPress Automation Summary",
"newspack_post_subtitle": "A comprehensive guide to automation"
}
}
headers = {"Content-Type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'Content-Type': 'application/json'},
body: JSON.stringify({
google_docs_url: 'https://docs.google.com/document/d/1aBcDeFg/edit',
title: 'My Blog Post',
slug: 'my-blog-post',
tags: 'technology, wordpress, automation',
categories: 'Technology, Tutorials',
state: 'draft',
author: 'John Doe',
date: '2024-04-01 09:00:00',
excerpt: 'This is a brief description of the post content.',
post_type: 'post',
featured_image_url: 'https://example.com/image.jpg',
featured_image_alt_text: 'Description of the featured image',
featured_image_caption: 'Image caption text',
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,
wp_content_editor: 'classic'
},
yoast_settings: {
yoast_focuskw: 'wordpress automation',
yoast_metadesc: 'Learn how to automate WordPress publishing with Docswrite',
yoast_title: 'WordPress Automation Guide | My Site',
yoast_canonical: 'https://example.com/wordpress-automation'
},
rankmath_settings: {rank_math_focus_keyword: 'wordpress automation'},
newspack_settings: {
newspack_article_summary: 'This article covers WordPress automation techniques',
newspack_article_summary_title: 'WordPress Automation Summary',
newspack_post_subtitle: 'A comprehensive guide to automation'
}
})
};
fetch('https://api.docswrite.com/api/export?token=', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.docswrite.com/api/export?token=",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'google_docs_url' => 'https://docs.google.com/document/d/1aBcDeFg/edit',
'title' => 'My Blog Post',
'slug' => 'my-blog-post',
'tags' => 'technology, wordpress, automation',
'categories' => 'Technology, Tutorials',
'state' => 'draft',
'author' => 'John Doe',
'date' => '2024-04-01 09:00:00',
'excerpt' => 'This is a brief description of the post content.',
'post_type' => 'post',
'featured_image_url' => 'https://example.com/image.jpg',
'featured_image_alt_text' => 'Description of the featured image',
'featured_image_caption' => 'Image caption text',
'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,
'wp_content_editor' => 'classic'
],
'yoast_settings' => [
'yoast_focuskw' => 'wordpress automation',
'yoast_metadesc' => 'Learn how to automate WordPress publishing with Docswrite',
'yoast_title' => 'WordPress Automation Guide | My Site',
'yoast_canonical' => 'https://example.com/wordpress-automation'
],
'rankmath_settings' => [
'rank_math_focus_keyword' => 'wordpress automation'
],
'newspack_settings' => [
'newspack_article_summary' => 'This article covers WordPress automation techniques',
'newspack_article_summary_title' => 'WordPress Automation Summary',
'newspack_post_subtitle' => 'A comprehensive guide to automation'
]
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.docswrite.com/api/export?token="
payload := strings.NewReader("{\n \"google_docs_url\": \"https://docs.google.com/document/d/1aBcDeFg/edit\",\n \"title\": \"My Blog Post\",\n \"slug\": \"my-blog-post\",\n \"tags\": \"technology, wordpress, automation\",\n \"categories\": \"Technology, Tutorials\",\n \"state\": \"draft\",\n \"author\": \"John Doe\",\n \"date\": \"2024-04-01 09:00:00\",\n \"excerpt\": \"This is a brief description of the post content.\",\n \"post_type\": \"post\",\n \"featured_image_url\": \"https://example.com/image.jpg\",\n \"featured_image_alt_text\": \"Description of the featured image\",\n \"featured_image_caption\": \"Image caption text\",\n \"export_settings\": {\n \"compress_images\": true,\n \"demote_headings\": false,\n \"convert_to_webp\": true,\n \"first_image_as_featured_image\": true,\n \"add_no_follow_to_external_links\": true,\n \"bold_as_strong\": false,\n \"wp_content_editor\": \"classic\"\n },\n \"yoast_settings\": {\n \"yoast_focuskw\": \"wordpress automation\",\n \"yoast_metadesc\": \"Learn how to automate WordPress publishing with Docswrite\",\n \"yoast_title\": \"WordPress Automation Guide | My Site\",\n \"yoast_canonical\": \"https://example.com/wordpress-automation\"\n },\n \"rankmath_settings\": {\n \"rank_math_focus_keyword\": \"wordpress automation\"\n },\n \"newspack_settings\": {\n \"newspack_article_summary\": \"This article covers WordPress automation techniques\",\n \"newspack_article_summary_title\": \"WordPress Automation Summary\",\n \"newspack_post_subtitle\": \"A comprehensive guide to automation\"\n }\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.docswrite.com/api/export?token=")
.header("Content-Type", "application/json")
.body("{\n \"google_docs_url\": \"https://docs.google.com/document/d/1aBcDeFg/edit\",\n \"title\": \"My Blog Post\",\n \"slug\": \"my-blog-post\",\n \"tags\": \"technology, wordpress, automation\",\n \"categories\": \"Technology, Tutorials\",\n \"state\": \"draft\",\n \"author\": \"John Doe\",\n \"date\": \"2024-04-01 09:00:00\",\n \"excerpt\": \"This is a brief description of the post content.\",\n \"post_type\": \"post\",\n \"featured_image_url\": \"https://example.com/image.jpg\",\n \"featured_image_alt_text\": \"Description of the featured image\",\n \"featured_image_caption\": \"Image caption text\",\n \"export_settings\": {\n \"compress_images\": true,\n \"demote_headings\": false,\n \"convert_to_webp\": true,\n \"first_image_as_featured_image\": true,\n \"add_no_follow_to_external_links\": true,\n \"bold_as_strong\": false,\n \"wp_content_editor\": \"classic\"\n },\n \"yoast_settings\": {\n \"yoast_focuskw\": \"wordpress automation\",\n \"yoast_metadesc\": \"Learn how to automate WordPress publishing with Docswrite\",\n \"yoast_title\": \"WordPress Automation Guide | My Site\",\n \"yoast_canonical\": \"https://example.com/wordpress-automation\"\n },\n \"rankmath_settings\": {\n \"rank_math_focus_keyword\": \"wordpress automation\"\n },\n \"newspack_settings\": {\n \"newspack_article_summary\": \"This article covers WordPress automation techniques\",\n \"newspack_article_summary_title\": \"WordPress Automation Summary\",\n \"newspack_post_subtitle\": \"A comprehensive guide to automation\"\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.docswrite.com/api/export?token=")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Content-Type"] = 'application/json'
request.body = "{\n \"google_docs_url\": \"https://docs.google.com/document/d/1aBcDeFg/edit\",\n \"title\": \"My Blog Post\",\n \"slug\": \"my-blog-post\",\n \"tags\": \"technology, wordpress, automation\",\n \"categories\": \"Technology, Tutorials\",\n \"state\": \"draft\",\n \"author\": \"John Doe\",\n \"date\": \"2024-04-01 09:00:00\",\n \"excerpt\": \"This is a brief description of the post content.\",\n \"post_type\": \"post\",\n \"featured_image_url\": \"https://example.com/image.jpg\",\n \"featured_image_alt_text\": \"Description of the featured image\",\n \"featured_image_caption\": \"Image caption text\",\n \"export_settings\": {\n \"compress_images\": true,\n \"demote_headings\": false,\n \"convert_to_webp\": true,\n \"first_image_as_featured_image\": true,\n \"add_no_follow_to_external_links\": true,\n \"bold_as_strong\": false,\n \"wp_content_editor\": \"classic\"\n },\n \"yoast_settings\": {\n \"yoast_focuskw\": \"wordpress automation\",\n \"yoast_metadesc\": \"Learn how to automate WordPress publishing with Docswrite\",\n \"yoast_title\": \"WordPress Automation Guide | My Site\",\n \"yoast_canonical\": \"https://example.com/wordpress-automation\"\n },\n \"rankmath_settings\": {\n \"rank_math_focus_keyword\": \"wordpress automation\"\n },\n \"newspack_settings\": {\n \"newspack_article_summary\": \"This article covers WordPress automation techniques\",\n \"newspack_article_summary_title\": \"WordPress Automation Summary\",\n \"newspack_post_subtitle\": \"A comprehensive guide to automation\"\n }\n}"
response = http.request(request)
puts response.read_body{
"error": false,
"message": "Post added to queue",
"data": {
"google_docs_url": "https://docs.google.com/document/d/1aBcDeFg/edit",
"title": "My Blog Post",
"jobId": "job-abc123"
}
}{
"error": true,
"message": "Invalid Google Docs URL",
"details": "The provided URL is not accessible or not shared properly"
}{
"error": true,
"message": "Invalid Google Docs URL",
"details": "The provided URL is not accessible or not shared properly"
}{
"error": true,
"message": "Invalid Google Docs URL",
"details": "The provided URL is not accessible or not shared properly"
}Create WordPress Post
Create or update WordPress posts and pages from Google Docs
curl --request POST \
--url 'https://api.docswrite.com/api/export?token=' \
--header 'Content-Type: application/json' \
--data '
{
"google_docs_url": "https://docs.google.com/document/d/1aBcDeFg/edit",
"title": "My Blog Post",
"slug": "my-blog-post",
"tags": "technology, wordpress, automation",
"categories": "Technology, Tutorials",
"state": "draft",
"author": "John Doe",
"date": "2024-04-01 09:00:00",
"excerpt": "This is a brief description of the post content.",
"post_type": "post",
"featured_image_url": "https://example.com/image.jpg",
"featured_image_alt_text": "Description of the featured image",
"featured_image_caption": "Image caption text",
"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,
"wp_content_editor": "classic"
},
"yoast_settings": {
"yoast_focuskw": "wordpress automation",
"yoast_metadesc": "Learn how to automate WordPress publishing with Docswrite",
"yoast_title": "WordPress Automation Guide | My Site",
"yoast_canonical": "https://example.com/wordpress-automation"
},
"rankmath_settings": {
"rank_math_focus_keyword": "wordpress automation"
},
"newspack_settings": {
"newspack_article_summary": "This article covers WordPress automation techniques",
"newspack_article_summary_title": "WordPress Automation Summary",
"newspack_post_subtitle": "A comprehensive guide to automation"
}
}
'import requests
url = "https://api.docswrite.com/api/export?token="
payload = {
"google_docs_url": "https://docs.google.com/document/d/1aBcDeFg/edit",
"title": "My Blog Post",
"slug": "my-blog-post",
"tags": "technology, wordpress, automation",
"categories": "Technology, Tutorials",
"state": "draft",
"author": "John Doe",
"date": "2024-04-01 09:00:00",
"excerpt": "This is a brief description of the post content.",
"post_type": "post",
"featured_image_url": "https://example.com/image.jpg",
"featured_image_alt_text": "Description of the featured image",
"featured_image_caption": "Image caption text",
"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,
"wp_content_editor": "classic"
},
"yoast_settings": {
"yoast_focuskw": "wordpress automation",
"yoast_metadesc": "Learn how to automate WordPress publishing with Docswrite",
"yoast_title": "WordPress Automation Guide | My Site",
"yoast_canonical": "https://example.com/wordpress-automation"
},
"rankmath_settings": { "rank_math_focus_keyword": "wordpress automation" },
"newspack_settings": {
"newspack_article_summary": "This article covers WordPress automation techniques",
"newspack_article_summary_title": "WordPress Automation Summary",
"newspack_post_subtitle": "A comprehensive guide to automation"
}
}
headers = {"Content-Type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'Content-Type': 'application/json'},
body: JSON.stringify({
google_docs_url: 'https://docs.google.com/document/d/1aBcDeFg/edit',
title: 'My Blog Post',
slug: 'my-blog-post',
tags: 'technology, wordpress, automation',
categories: 'Technology, Tutorials',
state: 'draft',
author: 'John Doe',
date: '2024-04-01 09:00:00',
excerpt: 'This is a brief description of the post content.',
post_type: 'post',
featured_image_url: 'https://example.com/image.jpg',
featured_image_alt_text: 'Description of the featured image',
featured_image_caption: 'Image caption text',
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,
wp_content_editor: 'classic'
},
yoast_settings: {
yoast_focuskw: 'wordpress automation',
yoast_metadesc: 'Learn how to automate WordPress publishing with Docswrite',
yoast_title: 'WordPress Automation Guide | My Site',
yoast_canonical: 'https://example.com/wordpress-automation'
},
rankmath_settings: {rank_math_focus_keyword: 'wordpress automation'},
newspack_settings: {
newspack_article_summary: 'This article covers WordPress automation techniques',
newspack_article_summary_title: 'WordPress Automation Summary',
newspack_post_subtitle: 'A comprehensive guide to automation'
}
})
};
fetch('https://api.docswrite.com/api/export?token=', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.docswrite.com/api/export?token=",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'google_docs_url' => 'https://docs.google.com/document/d/1aBcDeFg/edit',
'title' => 'My Blog Post',
'slug' => 'my-blog-post',
'tags' => 'technology, wordpress, automation',
'categories' => 'Technology, Tutorials',
'state' => 'draft',
'author' => 'John Doe',
'date' => '2024-04-01 09:00:00',
'excerpt' => 'This is a brief description of the post content.',
'post_type' => 'post',
'featured_image_url' => 'https://example.com/image.jpg',
'featured_image_alt_text' => 'Description of the featured image',
'featured_image_caption' => 'Image caption text',
'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,
'wp_content_editor' => 'classic'
],
'yoast_settings' => [
'yoast_focuskw' => 'wordpress automation',
'yoast_metadesc' => 'Learn how to automate WordPress publishing with Docswrite',
'yoast_title' => 'WordPress Automation Guide | My Site',
'yoast_canonical' => 'https://example.com/wordpress-automation'
],
'rankmath_settings' => [
'rank_math_focus_keyword' => 'wordpress automation'
],
'newspack_settings' => [
'newspack_article_summary' => 'This article covers WordPress automation techniques',
'newspack_article_summary_title' => 'WordPress Automation Summary',
'newspack_post_subtitle' => 'A comprehensive guide to automation'
]
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.docswrite.com/api/export?token="
payload := strings.NewReader("{\n \"google_docs_url\": \"https://docs.google.com/document/d/1aBcDeFg/edit\",\n \"title\": \"My Blog Post\",\n \"slug\": \"my-blog-post\",\n \"tags\": \"technology, wordpress, automation\",\n \"categories\": \"Technology, Tutorials\",\n \"state\": \"draft\",\n \"author\": \"John Doe\",\n \"date\": \"2024-04-01 09:00:00\",\n \"excerpt\": \"This is a brief description of the post content.\",\n \"post_type\": \"post\",\n \"featured_image_url\": \"https://example.com/image.jpg\",\n \"featured_image_alt_text\": \"Description of the featured image\",\n \"featured_image_caption\": \"Image caption text\",\n \"export_settings\": {\n \"compress_images\": true,\n \"demote_headings\": false,\n \"convert_to_webp\": true,\n \"first_image_as_featured_image\": true,\n \"add_no_follow_to_external_links\": true,\n \"bold_as_strong\": false,\n \"wp_content_editor\": \"classic\"\n },\n \"yoast_settings\": {\n \"yoast_focuskw\": \"wordpress automation\",\n \"yoast_metadesc\": \"Learn how to automate WordPress publishing with Docswrite\",\n \"yoast_title\": \"WordPress Automation Guide | My Site\",\n \"yoast_canonical\": \"https://example.com/wordpress-automation\"\n },\n \"rankmath_settings\": {\n \"rank_math_focus_keyword\": \"wordpress automation\"\n },\n \"newspack_settings\": {\n \"newspack_article_summary\": \"This article covers WordPress automation techniques\",\n \"newspack_article_summary_title\": \"WordPress Automation Summary\",\n \"newspack_post_subtitle\": \"A comprehensive guide to automation\"\n }\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.docswrite.com/api/export?token=")
.header("Content-Type", "application/json")
.body("{\n \"google_docs_url\": \"https://docs.google.com/document/d/1aBcDeFg/edit\",\n \"title\": \"My Blog Post\",\n \"slug\": \"my-blog-post\",\n \"tags\": \"technology, wordpress, automation\",\n \"categories\": \"Technology, Tutorials\",\n \"state\": \"draft\",\n \"author\": \"John Doe\",\n \"date\": \"2024-04-01 09:00:00\",\n \"excerpt\": \"This is a brief description of the post content.\",\n \"post_type\": \"post\",\n \"featured_image_url\": \"https://example.com/image.jpg\",\n \"featured_image_alt_text\": \"Description of the featured image\",\n \"featured_image_caption\": \"Image caption text\",\n \"export_settings\": {\n \"compress_images\": true,\n \"demote_headings\": false,\n \"convert_to_webp\": true,\n \"first_image_as_featured_image\": true,\n \"add_no_follow_to_external_links\": true,\n \"bold_as_strong\": false,\n \"wp_content_editor\": \"classic\"\n },\n \"yoast_settings\": {\n \"yoast_focuskw\": \"wordpress automation\",\n \"yoast_metadesc\": \"Learn how to automate WordPress publishing with Docswrite\",\n \"yoast_title\": \"WordPress Automation Guide | My Site\",\n \"yoast_canonical\": \"https://example.com/wordpress-automation\"\n },\n \"rankmath_settings\": {\n \"rank_math_focus_keyword\": \"wordpress automation\"\n },\n \"newspack_settings\": {\n \"newspack_article_summary\": \"This article covers WordPress automation techniques\",\n \"newspack_article_summary_title\": \"WordPress Automation Summary\",\n \"newspack_post_subtitle\": \"A comprehensive guide to automation\"\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.docswrite.com/api/export?token=")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Content-Type"] = 'application/json'
request.body = "{\n \"google_docs_url\": \"https://docs.google.com/document/d/1aBcDeFg/edit\",\n \"title\": \"My Blog Post\",\n \"slug\": \"my-blog-post\",\n \"tags\": \"technology, wordpress, automation\",\n \"categories\": \"Technology, Tutorials\",\n \"state\": \"draft\",\n \"author\": \"John Doe\",\n \"date\": \"2024-04-01 09:00:00\",\n \"excerpt\": \"This is a brief description of the post content.\",\n \"post_type\": \"post\",\n \"featured_image_url\": \"https://example.com/image.jpg\",\n \"featured_image_alt_text\": \"Description of the featured image\",\n \"featured_image_caption\": \"Image caption text\",\n \"export_settings\": {\n \"compress_images\": true,\n \"demote_headings\": false,\n \"convert_to_webp\": true,\n \"first_image_as_featured_image\": true,\n \"add_no_follow_to_external_links\": true,\n \"bold_as_strong\": false,\n \"wp_content_editor\": \"classic\"\n },\n \"yoast_settings\": {\n \"yoast_focuskw\": \"wordpress automation\",\n \"yoast_metadesc\": \"Learn how to automate WordPress publishing with Docswrite\",\n \"yoast_title\": \"WordPress Automation Guide | My Site\",\n \"yoast_canonical\": \"https://example.com/wordpress-automation\"\n },\n \"rankmath_settings\": {\n \"rank_math_focus_keyword\": \"wordpress automation\"\n },\n \"newspack_settings\": {\n \"newspack_article_summary\": \"This article covers WordPress automation techniques\",\n \"newspack_article_summary_title\": \"WordPress Automation Summary\",\n \"newspack_post_subtitle\": \"A comprehensive guide to automation\"\n }\n}"
response = http.request(request)
puts response.read_body{
"error": false,
"message": "Post added to queue",
"data": {
"google_docs_url": "https://docs.google.com/document/d/1aBcDeFg/edit",
"title": "My Blog Post",
"jobId": "job-abc123"
}
}{
"error": true,
"message": "Invalid Google Docs URL",
"details": "The provided URL is not accessible or not shared properly"
}{
"error": true,
"message": "Invalid Google Docs URL",
"details": "The provided URL is not accessible or not shared properly"
}{
"error": true,
"message": "Invalid Google Docs URL",
"details": "The provided URL is not accessible or not shared properly"
}Additional Information
Best Practices
- Always share Google Docs with “Anyone with the link”
- Test with drafts first before publishing live content
- Use descriptive titles and slugs for better SEO
- Include alt text for images for accessibility
- Set appropriate categories and tags to organize content
Create WordPress Post
Create or update a blog post or page on your WordPress site from a Google Docs document.POST https://api.docswrite.com/api/export?token=YOUR_TOKEN
Headers
| Header | Value |
|---|---|
| Content-Type | application/json |
Request Body
The request body should contain the Google Docs URL and any additional parameters to customize the post.Required Parameters
| Parameter | Type | Description |
|---|---|---|
google_docs_url | string | URL of the Google Doc. Must be shared with “anyone with link” |
Optional Parameters
| Parameter | Type | Default | Description |
|---|---|---|---|
title | string | Google Docs title | Post title |
slug | string | Auto-generated | Custom URL slug |
tags | string | - | Comma-separated list of tags |
categories | string | - | Comma-separated list of categories |
state | string | draft | Post status: publish or draft |
author | string | API token creator | Author username or full name |
date | string | Current time | Publish date in YYYY-MM-DD HH:MM:SS format |
excerpt | string | - | Post excerpt for SEO |
post_type | string | post | Type: post or page |
featured_image_url | string | - | URL of featured image |
featured_image_alt_text | string | - | Alt text for featured image |
featured_image_caption | string | - | Caption for featured image |
Export Settings
Control how your content is processed:| Parameter | Type | Default | Description |
|---|---|---|---|
export_settings.compress_images | boolean | true | Compress images before upload |
export_settings.demote_headings | boolean | false | Demote headings by one level |
export_settings.convert_to_webp | boolean | true | Convert images to WebP format |
export_settings.first_image_as_featured_image | boolean | true | Set first image as featured image |
export_settings.add_no_follow_to_external_links | boolean | true | Add nofollow to external links |
export_settings.bold_as_strong | boolean | false | Convert bold text to strong tag |
export_settings.wp_content_editor | string | classic | Content editor: classic or gutenberg_editor |
SEO Plugin Settings
Yoast SEO Settings
| Parameter | Type | Description |
|---|---|---|
yoast_settings.yoast_focuskw | string | Focus keyword |
yoast_settings.yoast_metadesc | string | Meta description |
yoast_settings.yoast_title | string | SEO title |
yoast_settings.yoast_canonical | string | Canonical URL |
RankMath Settings
| Parameter | Type | Description |
|---|---|---|
rankmath_settings.rank_math_focus_keyword | string | Focus keyword |
Newspack Settings
| Parameter | Type | Description |
|---|---|---|
newspack_settings.newspack_article_summary | string | Article summary |
newspack_settings.newspack_article_summary_title | string | Summary title |
newspack_settings.newspack_post_subtitle | string | Post subtitle |
Advanced Custom Fields (ACF)
| Parameter | Type | Description |
|---|---|---|
acf_field_name | string | Custom field value (supports URLs for images) |
Example Requests
Basic Request
{
"google_docs_url": "https://docs.google.com/document/d/1aBcDeFg/edit?usp=sharing",
"title": "My Blog Post",
"state": "publish",
"categories": "Technology, WordPress",
"tags": "automation, publishing"
}
Complete Request with All Options
{
"google_docs_url": "https://docs.google.com/document/d/1aBcDeFgHiJkLmNopQrStUvWxYz/edit?usp=sharing",
"title": "Complete Example Blog Post",
"slug": "complete-example-blog-post",
"tags": "example, blog post, complete",
"categories": "Technology, Tutorials",
"state": "draft",
"author": "Jane Doe",
"date": "2024-04-01 09:00:00",
"excerpt": "This is a comprehensive example of all available parameters.",
"post_type": "post",
"featured_image_url": "https://images.unsplash.com/photo-1662572091420-95992f339784",
"featured_image_alt_text": "Complete Example Featured Image",
"featured_image_caption": "Example caption for the featured image",
"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,
"wp_content_editor": "classic"
},
"newspack_settings": {
"newspack_article_summary": "This is an example article summary for Newspack themes.",
"newspack_article_summary_title": "Example Summary Title",
"newspack_post_subtitle": "Example Post Subtitle"
},
"yoast_settings": {
"yoast_focuskw": "example blog post",
"yoast_metadesc": "This is a comprehensive example meta description for SEO.",
"yoast_title": "Complete Example Blog Post | My Site"
},
"rankmath_settings": {
"rank_math_focus_keyword": "example blog post"
}
}
Scheduled Post Request
{
"google_docs_url": "https://docs.google.com/document/d/1aBcDeFg/edit",
"title": "Scheduled Blog Post",
"state": "publish",
"date": "2024-12-25 10:00:00",
"categories": "Holiday, Special"
}
Response Examples
Success Response (200 OK)
{
"error": false,
"message": "Post added to queue",
"data": {
"google_docs_url": "https://docs.google.com/document/d/1aBcDeFg/edit",
"title": "My Blog Post",
"jobId": "job-abc123"
}
}
Error Responses
Bad Request (400){
"error": true,
"message": "Invalid Google Docs URL",
"details": "The provided URL is not accessible or not shared properly"
}
{
"error": true,
"message": "Invalid API token",
"details": "Please check your API token and try again"
}
{
"error": true,
"message": "Rate limit exceeded",
"details": "You've exceeded the rate limit. Please wait before making more requests."
}
cURL Examples
Basic cURL Request
curl -X POST 'https://api.docswrite.com/api/export?token=YOUR_TOKEN' \
-H 'Content-Type: application/json' \
-d '{
"google_docs_url": "https://docs.google.com/document/d/1aBcDeFg/edit",
"title": "My Blog Post",
"state": "publish",
"categories": "Technology, WordPress",
"tags": "automation, publishing"
}'
Advanced cURL Request with SEO
curl -X POST 'https://api.docswrite.com/api/export?token=YOUR_TOKEN' \
-H 'Content-Type: application/json' \
-d '{
"google_docs_url": "https://docs.google.com/document/d/1aBcDeFg/edit",
"title": "SEO Optimized Post",
"state": "publish",
"yoast_settings": {
"yoast_focuskw": "SEO optimization",
"yoast_metadesc": "Learn how to optimize your content for search engines"
},
"export_settings": {
"compress_images": true,
"convert_to_webp": true
}
}'
Authorizations
API token obtained from Docswrite dashboard
Query Parameters
Your personal API token
Body
Post creation parameters
URL of the Google Doc (must be shared with 'anyone with link')
"https://docs.google.com/document/d/1aBcDeFg/edit"
Post title (defaults to Google Docs title)
"My Blog Post"
Custom URL slug (auto-generated if not provided)
"my-blog-post"
Comma-separated list of tags
"technology, wordpress, automation"
Comma-separated list of categories
"Technology, Tutorials"
Post publication status
draft, publish Author username or full name
"John Doe"
Publication date in YYYY-MM-DD HH:MM:SS format
"2024-04-01 09:00:00"
Post excerpt for SEO
"This is a brief description of the post content."
Type of content to create
post, page URL of the featured image
"https://example.com/image.jpg"
Alt text for the featured image
"Description of the featured image"
Caption for the featured image
"Image caption text"
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Was this page helpful?
