curl --request POST \
--url https://api.aisa.one/apis/v1/social/accounts/{accountId}/blogs/{blogId}/articles \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"title": "example"
}
'import requests
url = "https://api.aisa.one/apis/v1/social/accounts/{accountId}/blogs/{blogId}/articles"
payload = { "title": "example" }
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({title: 'example'})
};
fetch('https://api.aisa.one/apis/v1/social/accounts/{accountId}/blogs/{blogId}/articles', 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.aisa.one/apis/v1/social/accounts/{accountId}/blogs/{blogId}/articles",
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([
'title' => 'example'
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"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.aisa.one/apis/v1/social/accounts/{accountId}/blogs/{blogId}/articles"
payload := strings.NewReader("{\n \"title\": \"example\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
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.aisa.one/apis/v1/social/accounts/{accountId}/blogs/{blogId}/articles")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"title\": \"example\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.aisa.one/apis/v1/social/accounts/{accountId}/blogs/{blogId}/articles")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"title\": \"example\"\n}"
response = http.request(request)
puts response.read_body{
"article": {
"author": "<string>",
"blogId": "<string>",
"bodyHtml": "<string>",
"createdAt": "2023-11-07T05:31:56Z",
"excerpt": "<string>",
"handle": "<string>",
"id": "<string>",
"image": {
"altText": "<string>",
"url": "<string>"
},
"isPublished": true,
"platform": "shopify",
"publishDate": "2023-11-07T05:31:56Z",
"publishedAt": "2023-11-07T05:31:56Z",
"status": "publish",
"tags": [
"<string>"
],
"title": "<string>",
"updatedAt": "2023-11-07T05:31:56Z",
"url": "<string>"
},
"platform": "shopify"
}{
"error": {
"code": "<string>",
"details": {},
"message": "<string>",
"param": "<string>",
"retryHint": "never",
"retryable": true,
"type": "<string>"
}
}Create a blog article
Blogs. Acts in public on your connected account; needs social:publish. Audited. Ids are yours: accounts acc_…, profiles prf_…, posts pst_…; every other object id is checked against your accounts before the call.
Creates an article on the blog. Supported on Shopify (shopify), WordPress (wordpress), Wix (wix) and Webflow (webflow).
Publishing behavior
- WordPress, Wix and Webflow default to a draft when both publishing fields are omitted.
isPublished: falsekeeps the article as a draft and takes priority over a futurepublishDate.- A future
publishDateschedules publication natively on the platform. The platform publishes it at that time with no AIsa queue involved. isPublished: truepublishes immediately when there is no futurepublishDate.- WordPress native scheduling depends on the site’s scheduler/WP-Cron.
SEO
seo.title / seo.description map to:
- Shopify: the global
title_taganddescription_tagmetafields (the fields Shopify themes read for the page title and meta description). - Wix: the post’s SEO title and meta description.
WordPress and Webflow reject seo; SEO plugin and custom-field writes are not supported.
Webflow
Webflow has no scheduling API: a future publishDate returns 400 unless isPublished: false keeps a draft.
Fields map to the collection’s own fields by type and slug:
- The body goes to its rich text field.
excerptgoes to a summary field.imagegoes to an image field.tagsandauthorgo to tag and author reference fields.
Sending a field the collection does not have returns 400, as does a collection that requires a field the Blogs API cannot fill.
Wix
Wix stores rich content. bodyHtml is converted on write (each top-level HTML element must fit 30,000 characters), and images in the body are imported into the site’s Media Manager.
Idempotency
Send an Idempotency-Key header to make retries safe. A retry with the same key and body replays the original 201 instead of creating a second article. A retry while the first request is still running returns 409; retry after a short backoff.
curl --request POST \
--url https://api.aisa.one/apis/v1/social/accounts/{accountId}/blogs/{blogId}/articles \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"title": "example"
}
'import requests
url = "https://api.aisa.one/apis/v1/social/accounts/{accountId}/blogs/{blogId}/articles"
payload = { "title": "example" }
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({title: 'example'})
};
fetch('https://api.aisa.one/apis/v1/social/accounts/{accountId}/blogs/{blogId}/articles', 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.aisa.one/apis/v1/social/accounts/{accountId}/blogs/{blogId}/articles",
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([
'title' => 'example'
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"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.aisa.one/apis/v1/social/accounts/{accountId}/blogs/{blogId}/articles"
payload := strings.NewReader("{\n \"title\": \"example\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
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.aisa.one/apis/v1/social/accounts/{accountId}/blogs/{blogId}/articles")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"title\": \"example\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.aisa.one/apis/v1/social/accounts/{accountId}/blogs/{blogId}/articles")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"title\": \"example\"\n}"
response = http.request(request)
puts response.read_body{
"article": {
"author": "<string>",
"blogId": "<string>",
"bodyHtml": "<string>",
"createdAt": "2023-11-07T05:31:56Z",
"excerpt": "<string>",
"handle": "<string>",
"id": "<string>",
"image": {
"altText": "<string>",
"url": "<string>"
},
"isPublished": true,
"platform": "shopify",
"publishDate": "2023-11-07T05:31:56Z",
"publishedAt": "2023-11-07T05:31:56Z",
"status": "publish",
"tags": [
"<string>"
],
"title": "<string>",
"updatedAt": "2023-11-07T05:31:56Z",
"url": "<string>"
},
"platform": "shopify"
}{
"error": {
"code": "<string>",
"details": {},
"message": "<string>",
"param": "<string>",
"retryHint": "never",
"retryable": true,
"type": "<string>"
}
}请求规范
- 方法与路径: POST /apis/v1/social/accounts/{accountId}/blogs/{blogId}/articles
- 可用状态: enabled
- 请求 URL 模板:
https://api.aisa.one/apis/v1/social/accounts/{accountId}/blogs/{blogId}/articles - accountId: path; 必填
- blogId: path; 必填
- Idempotency-Key: header; 可选
{
"operationId": "post_aisa_social_apis_v1_social_accounts_accounti_9e8439",
"method": "POST",
"path": "/apis/v1/social/accounts/{accountId}/blogs/{blogId}/articles",
"servers": [
{
"url": "https://api.aisa.one"
}
],
"parameters": [
{
"description": "One of your social accounts (acc_...).",
"in": "path",
"name": "accountId",
"required": true,
"schema": {
"pattern": "^acc_[0-9A-Za-z]{22}$",
"type": "string"
}
},
{
"description": "Platform-native blog/site id returned by the list operation.",
"in": "path",
"name": "blogId",
"required": true,
"schema": {
"pattern": "^[A-Za-z0-9_-]{1,64}$",
"type": "string"
}
},
{
"description": "Passed to the channel: a retry with the same key within 24 hours returns the first result instead of acting twice. AIsa never retries a write for you.",
"in": "header",
"name": "Idempotency-Key",
"required": false,
"schema": {
"maxLength": 191,
"minLength": 1,
"type": "string"
}
}
],
"security": [
{
"bearerAuth": []
}
],
"requestBody": {
"content": {
"application/json": {
"example": {
"title": "example"
},
"schema": {
"properties": {
"author": {
"description": "Shopify author display name, numeric WordPress user id serialized as a string, or Wix site member id. Assigning another WordPress user may require elevated capability. Wix posts without one go to the site's default author.",
"type": "string"
},
"bodyHtml": {
"description": "Article body as HTML.",
"type": "string"
},
"excerpt": {
"description": "Short summary shown in blog listings.",
"type": "string"
},
"fieldData": {
"additionalProperties": true,
"description": "Webflow only (other platforms answer 400). The collection's own fields that the Blogs API does not map, keyed by field slug, in Webflow's value format (a Reference is an item id, an Image is { url, alt }).\n\nRequired by collections with required fields of their own: a create that leaves one empty answers 400 listing them. A slug the API already fills (name, slug, body, summary, image, tags, author, date) or one the collection lacks answers 400.",
"type": "object"
},
"handle": {
"description": "URL slug. Generated from the title when omitted.",
"type": "string"
},
"image": {
"description": "Featured image from a public URL. WordPress downloads it into the media library and Wix imports it into the Media Manager; JPEG, PNG, GIF and WebP are accepted up to 10 MB.",
"properties": {
"altText": {
"type": "string"
},
"url": {
"format": "uri",
"type": "string"
}
},
"required": [
"url"
],
"type": "object"
},
"isPublished": {
"description": "Set false for a draft or true to publish. On WordPress and Wix false takes priority over a future publishDate; omission with no date defaults to draft.",
"type": "boolean"
},
"publishDate": {
"description": "ISO 8601 datetime with offset (or Z). A future date schedules publication natively on the platform.",
"format": "date-time",
"type": "string"
},
"seo": {
"description": "Shopify and Wix. Search-engine overrides: Shopify global title_tag and description_tag metafields, Wix post SEO title and meta description. WordPress rejects this field.",
"properties": {
"description": {
"type": "string"
},
"title": {
"type": "string"
}
},
"type": "object"
},
"tags": {
"description": "Tag names. WordPress and Wix resolve existing names case-insensitively and create missing tags (Wix allows up to 30).",
"items": {
"minLength": 1,
"type": "string"
},
"maxItems": 100,
"type": "array"
},
"title": {
"minLength": 1,
"type": "string"
}
},
"required": [
"title"
],
"type": "object"
}
}
},
"required": true
},
"x-aisa-status": "enabled",
"components": {
"securitySchemes": {
"bearerAuth": {
"scheme": "bearer",
"type": "http"
}
}
}
}
费用与请求规则
此操作不另收费。授权
请求头
路径参数
请求体
Webflow only (other platforms answer 400). The collection's own fields that the Blogs API does not map, keyed by field slug, in Webflow's value format (a Reference is an item id, an Image is { url, alt }).
Required by collections with required fields of their own: a create that leaves one empty answers 400 listing them. A slug the API already fills (name, slug, body, summary, image, tags, author, date) or one the collection lacks answers 400.