# Create WordPress Post Source: https://docs.docswrite.com/api-reference/endpoint/create POST /api/export Create or update WordPress posts and pages from Google Docs ## Additional Information ### Best Practices 1. **Always share Google Docs** with "Anyone with the link" 2. **Test with drafts first** before publishing live content 3. **Use descriptive titles and slugs** for better SEO 4. **Include alt text for images** for accessibility 5. **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. ```bash theme={null} 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 ```json theme={null} { "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 ```json theme={null} { "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 ```json theme={null} { "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) ```json theme={null} { "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)** ```json theme={null} { "error": true, "message": "Invalid Google Docs URL", "details": "The provided URL is not accessible or not shared properly" } ``` **Unauthorized (401)** ```json theme={null} { "error": true, "message": "Invalid API token", "details": "Please check your API token and try again" } ``` **Rate Limited (429)** ```json theme={null} { "error": true, "message": "Rate limit exceeded", "details": "You've exceeded the rate limit. Please wait before making more requests." } ``` ## cURL Examples ### Basic cURL Request ```bash theme={null} 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 ```bash theme={null} 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 } }' ``` # Job Status Source: https://docs.docswrite.com/api-reference/endpoint/get POST /api/job/status Track the status of your Docswrite publishing jobs ## Additional Information ### Usage Examples #### Polling for Completion ```javascript theme={null} async function waitForJobCompletion(jobId, token) { while (true) { const response = await fetch("https://api.docswrite.com/api/job/status", { method: "POST", headers: { "Content-Type": "application/json", "x-access-token": token, }, body: JSON.stringify({ jobId: jobId, queueType: "post", }), }); const data = await response.json(); if (data.success && data.data.state === "completed") { console.log("Job completed successfully!"); break; } else if (data.success && data.data.state === "failed") { console.error("Job failed:", data.data.failedReason); break; } // Wait 5 seconds before checking again await new Promise((resolve) => setTimeout(resolve, 5000)); } } ``` #### Progress Tracking ```javascript theme={null} function trackProgress(jobId, token) { const interval = setInterval(async () => { const response = await fetch("https://api.docswrite.com/api/job/status", { method: "POST", headers: { "Content-Type": "application/json", "x-access-token": token, }, body: JSON.stringify({ jobId, queueType: "post" }), }); const data = await response.json(); if (data.success) { console.log(`Progress: ${data.data.progress}%`); if (data.data.state === "completed" || data.data.state === "failed") { clearInterval(interval); } } }, 2000); } ``` You can only check the status of jobs that you created. The API will return a 403 error if you try to check someone else's job. ## Get Job Status Check the status of a publishing job using the job ID returned when creating a post. ```bash theme={null} POST https://api.docswrite.com/api/job/status ``` ### Headers | Header | Value | | -------------- | ------------------ | | Content-Type | `application/json` | | x-access-token | `YOUR_JWT_TOKEN` | ### Request Body ```json theme={null} { "jobId": "job-123", "queueType": "post" } ``` ### Parameters | Parameter | Type | Required | Description | | ----------- | ------ | -------- | ---------------------------------------- | | `jobId` | string | Yes | The job ID returned when creating a post | | `queueType` | string | No | Queue type, defaults to "post" | ### Response **Success Response (200 OK)** ```json theme={null} { "success": true, "data": { "id": "job-123", "state": "completed", "progress": 100, "returnValue": {}, "failedReason": null, "timestamp": 1234567890, "processedOn": 1234567890, "finishedOn": 1234567890 } } ``` ### Job States | State | Description | | ----------- | ------------------------------------------- | | `waiting` | Job is in the queue waiting to be processed | | `active` | Job is currently being processed | | `completed` | Job finished successfully | | `failed` | Job failed with an error | | `delayed` | Job is scheduled to run later | ### Response Fields | Field | Type | Description | | -------------- | ------ | --------------------------- | | `id` | string | The job ID | | `state` | string | Current state of the job | | `progress` | number | Progress percentage (0-100) | | `returnValue` | object | Result data when completed | | `failedReason` | string | Error message if job failed | | `timestamp` | number | Job creation timestamp | | `processedOn` | number | When job processing started | | `finishedOn` | number | When job finished | ### cURL Example ```bash theme={null} curl -X POST 'https://api.docswrite.com/api/job/status' \ -H 'Content-Type: application/json' \ -H 'x-access-token: YOUR_JWT_TOKEN' \ -d '{ "jobId": "job-123", "queueType": "post" }' ``` ### Error Responses **Unauthorized (401)** ```json theme={null} { "error": true, "message": "Unauthorized", "details": "Invalid or missing access token" } ``` **Forbidden (403)** ```json theme={null} { "error": true, "message": "Access denied", "details": "You can only check the status of jobs that you created" } ``` **Not Found (404)** ```json theme={null} { "error": true, "message": "Job not found", "details": "No job found with the provided ID" } ``` # API Introduction Source: https://docs.docswrite.com/api-reference/introduction Use the Docswrite REST API to programmatically create and update WordPress posts from Google Docs ## Introduction You can make a `POST` request to the Docswrite API endpoint to create or update blog posts and pages on your WordPress site directly from Google Docs. You can configure most parameters either in the API request body or directly in the Google Docs document itself. ## How It Works 1. **Create a settings table** in your Google Docs document (optional but recommended) 2. **Share your Google Doc** with "Anyone with the link" 3. **Make a POST request** to your personal Docswrite endpoint 4. **Track the job status** using the returned job ID First, you need to connect your WordPress site to Docswrite. Once connected, you'll get a personal API endpoint for making requests. ## Setting Up Parameters in Google Docs You can include publishing parameters directly in your Google Docs: * 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](https://docs.google.com/document/d/1xoQOTl945fGRm_5YrRalZUEa_9U5q8y3r0pploi_360/edit?usp=sharing) ## Getting Your API Endpoint 1. Login to your [Docswrite account](https://docswrite.com/accounts/signin) and go to the settings page. Grab endpoint url 2. Grab the endpoint URL from the Docswrite settings page. It will look something like this: ``` https://api.docswrite.com/api/export?token=xxx ``` ## Authentication Authentication is handled through your personal API token included in the endpoint URL. No additional headers are required for basic API calls. For job status tracking, you'll need to include your JWT token in the request headers: ``` x-access-token: YOUR_JWT_TOKEN ``` ## Rate Limits The Docswrite API implements reasonable rate limits to ensure service quality: * **100 requests per minute** for content creation * **500 requests per minute** for status checking * **Burst allowance** of up to 200 requests If you exceed these limits, you'll receive a `429 Too Many Requests` response. ## Error Handling The API returns standard HTTP status codes: * `200 OK` - Request successful * `400 Bad Request` - Invalid parameters or missing required fields * `401 Unauthorized` - Invalid or missing authentication * `403 Forbidden` - Access denied to resource * `404 Not Found` - Resource not found * `429 Too Many Requests` - Rate limit exceeded * `500 Internal Server Error` - Server error ## Job Status Tracking When you create a post using the API, you'll receive a `jobId` in the response that you can use to track the publishing progress. ### Example Response with Job ID ```json theme={null} { "error": false, "message": "Post added to queue", "data": { "google_docs_url": "https://docs.google.com/document/d/1aBcDeFg/edit", "title": "Example Blog Post Title", "jobId": "job-123" } } ``` ### Job States | State | Description | | ----------- | ------------------------------------------- | | `waiting` | Job is in the queue waiting to be processed | | `active` | Job is currently being processed | | `completed` | Job finished successfully | | `failed` | Job failed with an error | | `delayed` | Job is scheduled to run later | ## Complete API Example Here's a complete example of creating a post and tracking its status: ```bash theme={null} # 1. Create a post 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" }' # Response: # { # "error": false, # "message": "Post added to queue", # "data": { # "jobId": "job-123" # } # } # 2. Check job status curl -X POST 'https://api.docswrite.com/api/job/status' \ -H 'Content-Type: application/json' \ -H 'x-access-token: YOUR_JWT_TOKEN' \ -d '{ "jobId": "job-123", "queueType": "post" }' ``` ## Next Steps Learn how to create new WordPress posts Track the status of your publishing jobs Complete list of supported parameters Coming soon: Official SDKs for popular languages # Workspace & Account Management Source: https://docs.docswrite.com/essentials/account-management Manage your Docswrite workspace, add teammates, set roles, and update organization details. AI Writing ## Add Teammates Invite your team members to collaborate on your Docswrite workspace. Once you add a teammate, they will be able to access the sites in this organization. Ask them to log in with their email address. You will need to add your teammate's email address, the role (admin or collaborator) *** ## Organization Details You can update your organization details at any time. **Organization Name** *This is the name that will be displayed on your invoices. You can change it as needed.* **Billing Address** *This is the address we will use for billing. You may update it if your billing information changes.* # Security & Privacy Source: https://docs.docswrite.com/essentials/security Learn about Docswrite's comprehensive security measures, data protection, and privacy safeguards ## Our Commitment to Security At Docswrite, security and privacy are fundamental to everything we do. We understand that your content, authentication credentials, and publishing workflows contain sensitive information that requires the highest level of protection. Our comprehensive security framework ensures your data remains safe, private, and under your control. ## Authentication & Access Control ### Multi-Layered Authentication Docswrite implements robust authentication mechanisms to protect your accounts and data: * **OAuth 2.0 Integration**: Secure integration through Docswrite using industry-standard OAuth 2.0 protocols * **JWT Token Security**: JSON Web Tokens with secure signing algorithms * **Application Passwords**: WordPress Application Passwords (WordPress 5.6+) for secure, plugin-independent access ### Access Control & Permissions We follow the principle of least privilege across all our integrations: **WordPress Connections** * **Minimal Permissions**: Only requests permissions necessary for publishing (posts, media, categories/tags) * **Revocable Access**: You can revoke Docswrite's access anytime from your WordPress admin panel **Google Drive Integration** * **Document-Specific Access**: Only accesses Google Docs you explicitly share or authorize * **Read-Only Operations**: Cannot modify your current original Google Docs but only create new Google Docs or create Google Drive files * **Selective Permissions**: No access to private documents or other Google services beyond what's needed **Contentful Integration** * **API Key Security**: Uses secure Contentful Management API tokens with restricted permissions * **Space-Specific Access**: Limited to only the Contentful spaces you authorize * **Content Type Restrictions**: Only operates on content types you specify ## Data Protection & Privacy ### Data Handling Principles **Data Minimization** * We only collect and process data necessary for publishing your content * No unnecessary tracking or data harvesting **Data Encryption** * **In Transit**: All data transfers use TLS 1.3 encryption * **API Communications**: End-to-end encrypted API calls ### Privacy Safeguards **Google Docs Privacy** * **Shared Link Requirement**: Only processes documents with "Anyone with the link" sharing enabled **WordPress Site Security** * **Secure Connections**: All WordPress communications over HTTPS * **User Permission Validation**: Verifies your WordPress user permissions before any operations * **Media Security**: Images and files uploaded securely through WordPress REST API ## 🏗️ Infrastructure Security ### Cloud Security **Hosting & Infrastructure** * **Enterprise-Grade Cloud**: Hosted on SOC 2 Type II compliant infrastructure within Digital Ocean * **Global CDN**: Content delivered through secure, global content delivery networks using Cloudflare * **DDoS Protection**: Advanced distributed denial-of-service attack protection using Cloudflare Security is an ongoing process. We continuously update our security measures and will keep this documentation current. For the latest security information or to report security concerns, contact us at [security@docswrite.com](mailto:security@docswrite.com). ## Need Help? Report security vulnerabilities or concerns to our security team Read our complete privacy policy and data handling practices Get help with security questions or account issues # About Source: https://docs.docswrite.com/index Export your Google Docs to your Content Management System such as WordPress and Contentful, etc. in a single click Docswrite Dashboard Image ## What is Docswrite? Docswrite is a publishing automation tool that helps content teams seamlessly export content from Google Docs directly into their Content Management System (CMS) like WordPress, Contentful, and others. Instead of wasting time copying, pasting, and reformatting blog posts or pages, Docswrite ensures your content is published exactly as written, with proper formatting, images, metadata, and SEO tags intact. With Docswrite, you can: * Export Google Docs to WordPress (including bulk export) – publish your content instantly, without copy-paste or formatting issues. Fully support ACF, Newspack, RankMath and YoastSEO * Export Google Docs to Contentful (including bulk export) - publish your content instantly, without copy-paste or formatting issues * Use Docswrite through your content workflow - use Trello, ClickUp and more using our Zapier integration * Programmatic SEO (PSEO) – generate thousands of SEO-optimized pages in one click * Export WordPress to Google Docs (including bulk export) – easily sync and collaborate on existing posts with your team ## Quick Start Connect your WordPress site directly using the WordPress API for secure, plugin-free publishing. Use the Docswrite WordPress plugin to connect your site and enable advanced publishing features. } href="/connect/contentful" > Connect your Contenful site directly plugin-free publishing. } href="/guides/zapier-flow" > Automate your publishing workflow by connecting Docswrite to Trello, ClickUp, and more using Zapier. # API Source: https://docs.docswrite.com/integrations/contentful/api/index How to connect and publish to Contentful # Contentful API Integration Docswrite allows you to publish Google Docs directly to your Contentful space using Contentful's APIs. This guide explains how to connect your Contentful account and use the API for seamless publishing. ## What Credentials Do You Need? To connect Docswrite to your Contentful space, you'll need the following credentials: * **Space ID:**\ This identifies your Contentful space. You can find it in Contentful under *Settings → General Settings*. * **Content Delivery API Access Token:**\ This token allows Docswrite to read published content from your space. Generate it in *Settings → API keys* in Contentful. * **Content Management API (CMA) Token:**\ This token allows Docswrite to create and update content in your space. Generate it in *Settings → CMA Tokens* in Contentful. > 📝 *Docswrite provides tooltips and help links for each field if you’re unsure where to find them.* *** ## How to Connect Contentful to Docswrite Connect Contentful to Docswrite 1. **Go to the [Docswrite Dashboard](https://docswrite.com/dashboard).**\ (Note: To connect multiple sites, you’ll need to be on the Business plan.) 2. **Add a new site and choose Contentful** as the platform. 3. **Enter the required Contentful credentials:** * **Space ID:**\ Find this in Contentful under *Settings → General Settings*. Copy and paste it into Docswrite. * **Content Delivery API Access Token:**\ Go to *Settings → API keys* in Contentful, generate a new API key, and copy the Content Delivery API token. API Key * **Content Management API (CMA) Token:**\ In Contentful, go to *Settings → CMA Tokens*, then create a new Management Token (CMA token) and copy it. CMA 4. **Connect!**\ Once you’ve entered all the info, click to connect. If everything is correct, your Contentful site will be linked to Docswrite. # Advanced Custom Fields (ACF) Support Source: https://docs.docswrite.com/integrations/wordpress/acf How to export and map Google Docs content to WordPress Advanced Custom Fields (ACF) using Docswrite.