๋งํฌ๋ค์ด๊ณผ ๋ก์ปฌ ์ด๋ฏธ์ง๊ฐ ํฌํจ๋ ZIP ์์นด์ด๋ธ๋ฅผ ์ ๋ก๋ํ์ธ์. ์์คํ ์ด ์์ ์ ์ฒ๋ฆฌํ๊ณ ์ฐธ์กฐ๋ฅผ ์์ ํ์ฌ ๋ฏธ๋ฆฌ๋ณด๊ธฐ, ๋ฐฐํฌ ๋ฐ ํ์ ์ํฌํ๋ก์ฐ์ ๋ฐ๋ก ์ฌ์ฉํ ์ ์๋ HTML์ ์์ฑํฉ๋๋ค.
์ผ๋ฐ์ ์ธ API ๋ฌธ์๊ฐ ์๋๋ผ markdown2html ์ํฌํ๋ก์ฐ์ ๋ง์ถฐ ์ค๊ณ๋์์ต๋๋ค
์๋ ๊ฒฝ๋ก ์ด๋ฏธ์ง ์ฐธ์กฐ๊ฐ ํฌํจ๋ Obsidian ๋ฐ ๋งํฌ๋ค์ด ํจํค์ง ๋ด๋ณด๋ด๊ธฐ์ ์ต์ ํ๋์ด ์์ต๋๋ค.
์ถ๊ฐ์ ์ธ ์๋ ์ ๋ฆฌ ์์ ์์ด ๋ฐ๋ก ๋ฏธ๋ฆฌ๋ณด๊ธฐ, ๊ฒ์ ๋๋ ํ์ ์์ ์ ํ์ฉํ ์ ์๋ HTML์ ์ ๊ณตํฉ๋๋ค.
๋ธ๋๋ ์ฝํ ์ธ , ์ง์ ๋ฒ ์ด์ค ๊ฒ์ ๋ฐ ๋ฐฐ์น ์ํฌํ๋ก์ฐ ์ ๋ฐ์์ ์ผ๊ด๋ ์ถ๋ ฅ ์คํ์ผ์ ์ ์งํฉ๋๋ค.
์ํฐํด๊ณผ ์์ ์ด ๊น๋ํ๊ฒ ์ ๋ฆฌ๋์ด ๊ฒ์, ์ฌ์ฌ์ฉ ๋ฐ ํ ํ์ ์ด ์ฉ์ดํฉ๋๋ค.
Obsidian, ์ง์ ๋ฒ ์ด์ค ๋๋ ๋ก์ปฌ ํธ์ง ํ์ผ์ ๋งํฌ๋ค์ด ์ํฐํด์ ZIP ์์นด์ด๋ธ๋ก ํจํค์งํฉ๋๋ค.
์์คํ ์ด ์ด๋ฏธ์ง ์ ๋ก๋, ์ฐธ์กฐ ๊ต์ฒด ๋ฐ ๋ ์ด์์ ๋ณํ์ ์๋์ผ๋ก ์ฒ๋ฆฌํ๋๋ก ํฉ๋๋ค.
์์ฑ๋ ๊ฒฐ๊ณผ๋ฅผ ๊ฒ์, ๋ฐฐํฌ, AI ๊ฐํ ๋๋ ๋ด๋ถ ํธ์ง ํ์ดํ๋ผ์ธ์ ํ์ฉํฉ๋๋ค.
์๋ ์น์ ์ ๊ฐ๋ฐ์ ์ฝ์์ด์ AI ํตํฉ์ ์ํ ๋ณต์ฌ ๊ฐ๋ฅํ ํธ๋์คํ ๋ฌธ์๋ก ์๋ํฉ๋๋ค.
ํด๋ฆญ ํ ๋ฒ์ผ๋ก API ํค๋ฅผ ์์ฑํ๊ณ , ์๋ ๋งํฌ๋ค์ด ๊ฐ์ด๋๋ฅผ ๋ณต์ฌํด AI ์์ด์ ํธ๋ ๊ฐ๋ฐํ์ ๋ฐ๋ก ์ ๋ฌํ์ธ์.
๊ฐ์ ธ์ค๊ธฐ API ํค ์์ฑ
ํ ํฐ์ ์์ฑ ํ ํ ๋ฒ๋ง ํ์๋ฉ๋๋ค. ๋ถ์ค ์ ํ๊ธฐ ํ ๋ค์ ์์ฑํ์ธ์.
๊ธฐ์กด ํค
์์ฑ๋ API ํค๊ฐ ์์ต๋๋ค
ํ ๋ง API ์๋ณ์
๊ฐ themeId๋ ์๋ํฐ์ ํ์๋ ํ ๋ง ์ด๋ฆ๊ณผ ์ผ์นํฉ๋๋ค. ์ฌ๋์ด ์ฝ์ ์ ์๋ ์ด๋ฆ๊ณผ ์ฐธ์กฐ ์์์ด ์๋์ ๋์ด๋์ด ์์ต๋๋ค.
AI ํธํ API ํตํฉ ๊ฐ์ด๋
ๅ
ฌไผๅทhttps://api.imgto.link
POST https://api.imgto.link/uploads/md-importPOST https://api.imgto.link/api/v1/md/importGET https://api.imgto.link/api/v1/md/import/jobs/{jobId}https://api.imgto.link host, so clients only need one public base URL.Use an API key in the Authorization header:
Authorization: Bearer YOUR_API_KEY
uploadRelativePathPOST https://api.imgto.link/api/v1/md/importGET https://api.imgto.link/api/v1/md/import/jobs/{jobId} until the job reaches a terminal statusPOST https://api.imgto.link/uploads/md-import
multipart/form-data
archive (required): ZIP file containing one Markdown file and its local image files{
"code": 200,
"data": {
"relativePath": "inbox/2026/03/12/uuid-article-package.zip",
"originalFilename": "article-package.zip",
"size": 345678,
"uploadedAt": "2026-03-12T08:00:00.000Z"
}
}
POST https://api.imgto.link/api/v1/md/import
application/json
{
"uploadRelativePath": "inbox/2026/03/12/uuid-article-package.zip",
"archiveFilename": "article-package.zip",
"archiveSize": 345678,
"themeId": "classic",
"directoryPath": "public/articles/demo",
"entryMarkdown": "docs/index.md",
"saveFolderId": 12,
"mdfileId": 123
}
uploadRelativePath (required): value returned from step 1archiveFilename (required): original zip filenamearchiveSize (optional): archive size in bytesthemeId (optional): theme API name, default is classicdirectoryPath (optional): base upload directory path like public/articles/launch-2026entryMarkdown (optional): specific markdown file path inside the ZIP when there are multiple markdown filessaveFolderId (optional): target markdown folder ID in the editormdfileId (optional): existing markdown article ID. When provided, the import is treated as a replace/update. The old article and its imported images are deleted before the new content is saved{
"code": 202,
"message": "Accepted",
"data": {
"jobId": "mdi_1234567890abcdef",
"status": "QUEUED",
"progress": 0,
"pollUrl": "/api/v1/md/import/jobs/mdi_1234567890abcdef"
}
}
GET https://api.imgto.link/api/v1/md/import/jobs/{jobId}
{
"code": 200,
"message": "Ok",
"data": {
"jobId": "mdi_1234567890abcdef",
"status": "PROCESSING",
"progress": 65,
"currentStage": "processing_images",
"message": "ๆญฃๅจๅค็ๅพ็ 2/4",
"compensationStatus": "NOT_REQUIRED",
"updatedAt": "2026-03-12T08:01:15.000Z"
}
}
{
"code": 200,
"message": "Ok",
"data": {
"jobId": "mdi_1234567890abcdef",
"status": "SUCCEEDED",
"progress": 100,
"currentStage": "completed",
"message": "ๅฏผๅ
ฅๅฎๆ",
"compensationStatus": "NOT_REQUIRED",
"updatedAt": "2026-03-12T08:01:30.000Z",
"result": {
"mdfileId": 123,
"resolvedMarkdown": "# Title\n\n",
"html": "<section>...</section>",
"wechatApiHtml": "<section>...</section>",
"imageDirectoryPath": "public/ๅ
ฌไผๅท/my-article",
"savedArticle": {
"id": 123,
"mdfileId": 123,
"title": "My Article",
"folder": {
"id": 9,
"name": "ๅ
ฌไผๅท",
"fullPath": "ๅ
ฌไผๅท"
}
}
}
}
}
{
"code": 200,
"message": "Ok",
"data": {
"jobId": "mdi_1234567890abcdef",
"status": "FAILED_COMPENSATED",
"progress": 100,
"currentStage": "failed",
"message": "ๅฏผๅ
ฅๅคฑ่ดฅ๏ผๅทฒๅๆปไธไผ ๅพ็ไธ็จๆท้ขๅบฆ",
"compensationStatus": "COMPLETED",
"updatedAt": "2026-03-12T08:02:00.000Z",
"error": {
"message": "Referenced image not found: ./images/cover.png"
}
}
}
SUCCEEDEDFAILED_COMPENSATEDFAILED_PENDING_COMPENSATION and FAILED_COMPENSATION_ERRORresult is returned only when the job succeedserror is returned when the job failsresult.resolvedMarkdown: Markdown after local image paths are replaced with Imgto.link URLsresult.html: Base rendered HTML for preview or debuggingresult.wechatApiHtml: Recommended HTML for submitting to the WeChat Official Account API content fieldresult.mdfileId: The saved Markdown article ID, returned for convenient reuse in the next replace import requestresult.savedArticle: Saved Markdown article record in the editorresult.savedArticle.mdfileId: Stable article identifier to pass back on the next import if you want to replace this article instead of creating a new oneresult.imageDirectoryPath: Final image upload directory pathcurl -X POST "https://api.imgto.link/uploads/md-import" \
-F "archive=@article-package.zip" \
curl -X POST "https://api.imgto.link/api/v1/md/import" \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"uploadRelativePath": "inbox/2026/03/12/uuid-article-package.zip",
"archiveFilename": "article-package.zip",
"archiveSize": 345678,
"themeId": "classic",
"directoryPath": "public/articles/demo"
}'
curl -X GET "https://api.imgto.link/api/v1/md/import/jobs/mdi_1234567890abcdef" \
-H "Authorization: Bearer YOUR_API_KEY"
const uploadFormData = new FormData();
uploadFormData.append("archive", zipFile);
const uploadResponse = await fetch("https://api.imgto.link/uploads/md-import", {
method: "POST",
body: uploadFormData
});
const uploadResult = await uploadResponse.json();
const relativePath = uploadResult.data.relativePath;
const createResponse = await fetch("https://api.imgto.link/api/v1/md/import", {
method: "POST",
headers: {
Authorization: "Bearer YOUR_API_KEY",
"Content-Type": "application/json"
},
body: JSON.stringify({
uploadRelativePath: relativePath,
archiveFilename: uploadResult.data.originalFilename,
archiveSize: uploadResult.data.size,
themeId: "classic",
directoryPath: "public/articles/demo"
})
});
const createResult = await createResponse.json();
const jobId = createResult.data.jobId;
let finalResult = null;
for (;;) {
const pollResponse = await fetch("https://api.imgto.link/api/v1/md/import/jobs/" + jobId, {
method: "GET",
headers: {
Authorization: "Bearer YOUR_API_KEY"
}
});
const pollResult = await pollResponse.json();
const job = pollResult.data;
if (job.status === "SUCCEEDED") {
finalResult = job.result;
break;
}
if (job.status === "FAILED_COMPENSATED") {
throw new Error(job.error?.message || "Import failed");
}
await new Promise((resolve) => setTimeout(resolve, 1800));
}
console.log(finalResult.mdfileId);
console.log(finalResult.resolvedMarkdown);
console.log(finalResult.wechatApiHtml);
console.log(finalResult.savedArticle);
Use the result.savedArticle.mdfileId returned by the previous successful import job.
const replaceResponse = await fetch("https://api.imgto.link/api/v1/md/import", {
method: "POST",
headers: {
Authorization: "Bearer YOUR_API_KEY",
"Content-Type": "application/json"
},
body: JSON.stringify({
uploadRelativePath: uploadedZip.data.relativePath,
archiveFilename: uploadedZip.data.originalFilename,
archiveSize: uploadedZip.data.size,
themeId: "classic",
mdfileId: previousResult.savedArticle.mdfileId
})
});
const replaceResult = await replaceResponse.json();
console.log(replaceResult.data.jobId);
mdfileId omitted: create a new import job using the uploaded ZIPmdfileId provided: force this import to replace that exact articlemdfileId from the final successful poll result and keep using it for future updatesUse result.wechatApiHtml from the completed import job for the content field instead of result.html.
const completedImport = await waitForImportJob(jobId);
const wechatApiHtml = completedImport.result.wechatApiHtml;
const draftPayload = {
articles: [
{
title: completedImport.result.savedArticle?.title || "Imported article",
author: "Your Team",
digest: "",
content: wechatApiHtml,
content_source_url: "",
thumb_media_id: "YOUR_WECHAT_THUMB_MEDIA_ID",
need_open_comment: 0,
only_fans_can_comment: 0
}
]
};
const wechatResponse = await fetch(
"https://api.weixin.qq.com/cgi-bin/draft/add?access_token=YOUR_WECHAT_ACCESS_TOKEN",
{
method: "POST",
headers: {
"Content-Type": "application/json"
},
body: JSON.stringify(draftPayload)
}
);
const wechatResult = await wechatResponse.json();
console.log(wechatResult);
result.wechatApiHtml for WeChat Official Account API publishingresult.html as the content field if you need output aligned with the website's copy/export flowresult.wechatApiHtml should already point to uploaded Imgto.link assetsaccess_token and thumb_media_idwarm): #ea580c, #333china): #7f1d1d, #292524, #f5f5f4cyber): #ec4899, #a855f7, #3b82f6classic): #07c160, #333ink): #3f3f46, #78716ceditorial): #1f2937, #ef4444wenkai): #57534e, #78716cbusiness): #1e3a8a, #1e40afforest): #059669, #ecfdf5azure): #0ea5e9, #e0f2fecoffee): #78350f, #fffbebneon): #d946ef, #06b6d4red): #be123c, #fff1f2silver): #475569, #e2e8f0minimal): #000, #999morandi): #be185d, #fbcfe8sunny): #f97316, #fbbf24mint): #10b981, #d1fae5autumn): #d97706, #fef3c7lavender): #8b5cf6, #ede9fevintage): #7f1d1d, #fecacanotes): #facc15, #fef08agrey): #374151, #f3f4f6entryMarkdown./images/a.pngๅ
ฌไผๅท{directoryPath}/{article-slug}If you give this API to an AI coding assistant, tell it:
"Use the async workflow. First upload the ZIP to https://api.imgto.link/uploads/md-import with multipart/form-data and read data.relativePath, data.originalFilename, and data.size. Then call POST https://api.imgto.link/api/v1/md/import with JSON using uploadRelativePath, archiveFilename, and optional themeId, directoryPath, entryMarkdown, saveFolderId, and mdfileId. Authenticate the control-plane API with Authorization: Bearer YOUR_API_KEY. Then poll GET https://api.imgto.link/api/v1/md/import/jobs/{jobId} until status becomes SUCCEEDED or FAILED_COMPENSATED. On success, read result.resolvedMarkdown, result.wechatApiHtml, result.savedArticle, result.mdfileId, and result.imageDirectoryPath. Prefer result.wechatApiHtml when publishing to the WeChat Official Account API content field."