Console API به شما اجازه می دهد تا وظایف مدیریتی یک وبلاگ را انجام دهید. این همان API است که ما به صورت داخلی در کنسول استفاده می کنیم. میتوانید از آن برای خودکار کردن برخی کارها یا حتی ساختن یک مینی کنسول کاملاً جدید توسط خودتان استفاده کنید.
https://blog.taptik.ir/api/console/v0/blog/{subdomain}X-API-KEY ارسال کنید.GET - برای دریافت داده ها، معمولاً مجموعه ای از منابعPOST - برای ایجاد یک منبعPATCH - به روز رسانی جزئی یا کامل یک منبعDELETE - برای حذف یک منبعConsole API نقاط پایانی زیادی دارد و بر اساس «منابعی» که میخواهید به آن دسترسی داشته باشید یا مدیریت کنید، طبقهبندی میشود. اکثر دسته ها عملیات CRUD دارند اما برخی ممکن است نقاط پایانی بیشتری برای وظایف خاص داشته باشند. این اشیا در داخل Category تعریف می شوند. همچنین توجه داشته باشید که اشیاء Console API با اشیاء Data API متفاوت هستند.
پرش به هر دسته:
نقاط پایانی:
GET /blog - داده های وبلاگ را دریافت کنیدPATCH /blog - به روز رسانی داده های وبلاگPOST /blog/variant - یک نوع وبلاگ ایجاد کنیدPATCH /blog/variant - یک نوع وبلاگ را به روز کنیداشیاء:
GET /blog
type Request = {};
type Response = Blog;PATCH /blog
type Request = Partial<Blog>; // except id and variants
type Response = Blog;POST /blog/variant
type Request = {
language_id: number;
};
type Response = BlogVariant;PATCH /blog/variant
type Request = {
language_id: number;
name?: string;
description?: string;
};
type Response = BlogVariant;نقاط پایانی:
GET /posts - دریافت پستGET /pages - دریافت صفحاتPOST /post - یک پست/صفحه ایجاد کنیدGET /post/{id} - یک پست/صفحه دریافت کنیدPATCH /post/{id} - یک پست/صفحه را به روز کنیدDELETE /post/{id} - یک پست/صفحه را حذف کنیدPOST /post/{id}/variant - یک نوع پست ایجاد کنیدPATCH /post/{id}/variant - یک نوع پست را به روز کنیدPOST /post/{id}/variant/publish - یک نوع پست را منتشر کنیدPOST /post/{id}/variant/unpublish - یک نوع پست را لغو انتشار کنیدDELETE /post/{id}/variant - یک نوع پست را حذف کنیدPATCH /post/{id}/tags - به روز رسانی برچسب های پستPATCH /post/{id}/authors - نویسندگان پست را به روز کنیداشیاء:
دریافت پست با فیلترینگ پارامترهای فیلتر مشابه پارامترهای کنسول هستند. یک PostListItem سبک وزن را در هر پست، به جای پست کامل برمیگرداند - GET /post/{id} را برای پست کامل واکشی کنید.
GET /posts
type Request = {
status?: 'featured' | 'published' | 'draft' | 'scheduled';
author_id?: number;
tag_id?: number;
start_timestamp?: number; // unix timestamp
end_timestamp?: number; // unix timestamp
search?: string;
language_id?: number; // defaults to the blog's primary language
limit?: number; // default 50, max 100
offset?: number;
};
type Response = PostListItem[];همان شکل سبک PostListItem مانند GET /posts.
GET /pages
type Request = {};
type Response = PostListItem[];یک پست پیش نویس خالی ایجاد کنید. یک نوع پست از زبان اصلی وبلاگ ایجاد خواهد شد.
POST /post
type Request = {
is_page?: boolean; // default to false
};
type Response = Post;GET /post/{id}
type Request = {};
type Response = Post;PATCH /post/{id}
type Request = {
is_featured?: boolean;
featured_image_url?: string | null;
canonical_url?: string | null;
code_head?: string | null;
code_foot?: string | null;
published_at?: number | null; // unix timestamp
};
type Response = Post;DELETE /post/{id}
type Request = {};
type Response = {};POST /post/{id}/variant
type Request = {
language_id: number;
};
type Response = PostVariant;PATCH /post/{id}/variant
type Request = {
language_id: number;
slug?: string; // max 255 chars
content?: string | null;
content_unsaved?: string | null;
title?: string | null; // max 255 chars
description?: string | null; // max 255 chars
};
type Response = PostVariant;content و content_unsaved باید در ProseMirror باشد JSON قالب ببینید ProseMirror را دریافت کنید JSON نقطه پایانی برای تبدیل HTML به ProseMirror JSON.
POST /post/{id}/variant/publish
type Request = {
language_id: number;
};
type Response = PostVariant;یک نوع پست را منتشر می کند. اگر گونهای اسلگ نداشته باشد، یکی از آنها بهطور خودکار از عنوان تولید میشود. اگر پست دارای زمان published_at نباشد، اکنون تنظیم شده است. به محدوده posts.publish.own نیاز دارد.
POST /post/{id}/variant/unpublish
type Request = {
language_id: number;
};
type Response = PostVariant;وضعیت نوع را به draft برمی گرداند. روی هر دو نوع منتشر شده و برنامه ریزی شده کار می کند. به محدوده posts.publish.own نیاز دارد.
DELETE /post/{id}/variant
type Request = {
language_id: number;
};
type Response = {};PATCH /post/{id}/tags
type Request = {
ids: number[]; // tag IDs
};
type Response = {};PATCH /post/{id}/authors
type Request = {
ids: number[]; // author (user) IDs
};
type Response = {};نقاط پایانی:
GET /tags - برچسب ها را دریافت یا جستجو کنیدPOST /tag - یک برچسب ایجاد کنیدPATCH /tag/{id} - یک برچسب را به روز کنیدDELETE /tag/{id} - یک برچسب را حذف کنیدPOST /tag/{id}/variant - یک نوع برچسب ایجاد کنیدPATCH /tag/{id}/variant - یک نوع برچسب را به روز کنیدDELETE /tag/{id}/variant - یک نوع برچسب را حذف کنیداشیاء:
برچسبها را فهرست میکند و به صورت اختیاری با نام (زبان اصلی) جستجو میکند.
GET /tags
type Request = {
limit?: number; // default 50, max 100
offset?: number;
search?: string; // filters tags by name (primary language)
};
type Response = Tag[];POST /tag
type Request = {
name: string; // name for the primary language variant
is_private: boolean; // default false
};
type Response = Tag;PATCH /tag/{id}
type Request = {
is_private?: boolean;
slug?: string;
code_head?: string | null;
code_foot?: string | null;
};
type Response = Tag;DELETE /tag/{id}
type Request = {};
type Response = {};POST /tag/{id}/variant
type Request = {
language_id: number;
};PATCH /tag/{id}/variant
type Request = {
language_id: number;
name?: string;
description?: string | null;
};DELETE /tag/{id}/variant
type Request = {
language_id: number;
};نقاط پایانی:
GET /users - کاربران را جذب کنیدGET /users/search - جستجوی کاربرانPOST /user - یک کاربر ایجاد کنیدPOST /user/guest - یک کاربر مهمان ایجاد کنیدPATCH /user/{id} - یک کاربر را به روز کنیدDELETE /user/{id} - حذف یک کاربرPOST /user/{id}/variant - یک نوع کاربری ایجاد کنیدPATCH /user/{id}/variant - یک نوع کاربری را به روز کنیدDELETE /user/{id}/variant - یک نوع کاربری را حذف کنیداشیاء:
GET /users
type Request = {
offset?: number;
};
type Response = User[];کاربران را بر اساس نام جستجو می کند.
GET /users/search
type Request = {
search: string;
};
type Response = User[];POST /user
type Request = {
username_or_email: string;
role: 'owner' | 'admin' | 'editor' | 'writer' | 'contributor';
};
type Response = User;POST /user/guest
type Request = {
name: string;
};
type Response = User;PATCH /user/{id}
type Request = {
hyvor_user_id?: number;
role?: 'owner' | 'admin' | 'editor' | 'writer' | 'contributor';
status: 'active' | 'blocked';
slug: string;
email?: string;
website_url?: string;
picture_url?: string;
social_facebook?: string;
social_twitter?: string;
social_linkedin?: string;
social_youtube?: string;
social_tiktok?: string;
social_instagram?: string;
social_github?: string;
};
type Response = User;DELETE /user/{id}
type Request = {};
type Response = {};POST /user/{id}/variant
type Request = {};
type Response = UserVariant;PATCH /user/{id}/variant
type Request = {
name?: string;
bio?: string;
location?: string;
};
type Response = UserVariant;DELETE /user/{id}/variant
type Request = {};
type Response = {};نقاط پایانی:
GET /media - دریافت رسانهPOST /media - یک رسانه ایجاد کنیدPOST /media/from-url - ایجاد یک رسانه از URLDELETE /media/{id} - یک پیمایش را حذف کنیدGET /media/unsplash/search - دریافت رسانه از unsplashPATCH /media - وصله رسانهاشیاء:
GET /media
type Request = {
limit: number;
offset: number;
search?: string;
extensions?: string[];
type?: string;
};
type Response = Media[];POST /media
type Request = {
file: File;
post_id: number;
};
type Response = Media;POST /media/from-url
type Request = {
url: string;
post_id?: number;
};
type Response = Media;DELETE /media/{id}
type Request = {};
type Response = {};PATCH /media/{id}
type Request = Partial<Media>;
type Response = Media;نقاط پایانی:
GET /navigations - ناوبری را دریافت کنیدPATCH /navigations/sort - ناوبری مرتب سازی را به روز کنیدPOST /navigation - یک ناوبری ایجاد کنیدPATCH /navigation/{id} - به روز رسانی یک ناوبریDELETE /navigation/{id} - یک پیمایش را حذف کنیدPOST /navigation/{id}/variant - یک نوع ناوبری ایجاد کنیدPATCH /navigation/{id}/variant - یک نوع ناوبری را به روز کنیدDELETE /navigation/{id}/variant - یک نوع ناوبری را حذف کنیداشیاء:
GET /navigations
type Request = {};
type Response = Navigation[];PATCH /navigations/sort
type Request = {
ids?: number[];
};
type Response = {};POST /navigation
type Request = {
url: string;
name: string;
type: 'header' | 'footer';
};
type Response = Navigation;PATCH /navigation/{id}
type Request = {
url: string;
type: 'header' | 'footer';
};
type Response = Navigation;DELETE /navigation/{id}
type Request = {};
type Response = {};POST /navigation/{id}/variant
type Request = {
language_id: number;
name?: string;
};
type Response = NavigationVariant;PATCH /navigation/{id}/variant
type Request = {
language_id: number;
name: string;
};
type Response = NavigationVariant;DELETE /navigation/{id}/variant
type Request = {
language_id: number;
};
type Response = {};نقاط پایانی:
GET /languages - دریافت زبانPOST /language - ایجاد یک زبانPATCH /language/{id} - یک زبان را به روز کنیدDELETE /language/{id} - یک زبان را حذف کنیداشیاء:
GET /languages
type Request = {};
type Response = Languages[];POST /language
type Request = {
code: string; // max 12 chars
name: string; // max 255 chars
direction: 'ltr' | 'rtl';
};
type Response = Language;PATCH /language/{id}
type Request = {
code: string; // max 12 chars
name: string; // max 255 chars
direction: 'ltr' | 'rtl';
};
type Response = Language;DELETE /language/{id}
type Request = {};
type Response = {};نقاط پایانی:
GET /redirects - تغییر مسیرها را دریافت کنیدPOST /redirect - یک تغییر مسیر ایجاد کنیدPATCH /redirect/{id} - تغییر مسیر را به روز کنیدDELETE /redirect/{id} - یک تغییر مسیر را حذف کنیداشیاء:
GET /redirects
type Request = {
search?: string;
limit?: number;
offset?: number;
};
type Response = Redirect[];POST /redirect
type Request = {
dynamic: boolean;
path: string;
to: string;
type: 'temporary' | 'permanent';
};
type Response = Redirect;PATCH /redirect/{id}
type Request = {
path?: string;
to?: string;
type?: 'temporary' | 'permanent';
};
type Response = Redirect;DELETE /redirect/{id}
type Request = {};
type Response = {};نقاط پایانی:
GET /webhooks - دریافت وب هوکPOST /webhook - ایجاد یک وب هوکPATCH /webhook/{id} - یک وب هوک را به روز کنیدDELETE /webhook/{id} - یک وب هوک را حذف کنیداشیاء:
GET /webhooks
type Request = {};
type Response = Webhook[];POST /webhook
type Request = {
url: string;
events: 'cache.single' | 'cache.templates' | 'cache.all'[];
};
type Response = Webhook;PATCH /webhook/{id}
type Request = {
url?: string;
events?: 'cache.single' | 'cache.templates' | 'cache.all'[];
};
type Response = Webhook;DELETE /webhook/{id}
type Request = {};
type Response = {};نقاط پایانی:
GET /theme/files - دریافت فایل های پوستهPOST /theme/file - یک فایل پوسته ایجاد کنیدPATCH /theme/file/{id} - یک فایل پوسته را به روز کنیدDELETE /theme/file/{id} - یک فایل پوسته را حذف کنیداشیاء:
GET /theme/files
type Request = {};
type Response = FileObject[];POST /theme/file
type Request = {
folder: 'templates' | 'assets' | 'styles' | 'lang';
name: string;
content?: string;
file: File;
};
type Response = FileObject;PATCH /theme/file/{id}
type Request = {
name?: string;
content?: string;
};
type Response = FileObject;DELETE /theme/file/{id}
type Request = {};
type Response = {};نقاط پایانی:
GET /exports - خروجی را دریافت کنیدPOST /export - یک خروجی ایجاد کنیداشیاء:
GET /exports
type Request = {};
type Response = ExportObject[];POST /export
type Request = {};
type Response = ExportObject;نقاط پایانی:
POST /link-analysis/check-urls - پیوند نوع پست را بررسی کنیدPATCH /link-analysis/ignore-link - پیوند را نادیده بگیریدGET /link-analysis/stats - آمار پیوندها را دریافت کنیدGET /link-analysis/links - پیوندها را دریافت کنیدGET /link-analysis/checks - چک دریافت کنیدPOST /link-analysis/check - یک چک ایجاد کنیداشیاء:
POST /link-analysis/check-urls
type Request = {
post_variant_id: number;
urls: string[];
force?: boolean;
};
type Response = LinkObject[];PATCH /link-analysis/ignore-link
type Request = {
post_variant_id: number;
urls: string[];
status: boolean;
};
type Response = LinkObject;GET /link-analysis/stats
type Request = {};
type Response = {
counts: number;
};GET /link-analysis/links
type Request = {
type?: 'ok' | 'broken' | 'ignored' | 'redirected';
limit?: number;
offset?: number;
};
type Response = LinkObject[];GET /link-analysis/checks
type Request = {
limit?: number;
offset?: number;
};
type Response = CheckObject[];POST /link-analysis/check
type Request = {};
type Response = CheckObject;نقاط پایانی:
GET /routes - مسیرها را دریافت کنیدPOST /route - یک مسیر ایجاد کنیدPATCH /route/{id} - یک مسیر را به روز کنیدDELETE /route/{id} - یک مسیر را حذف کنیداشیاء:
GET /routes
type Request = {};
type Response = Route[];POST /route
type Request = {
name: string;
match: string;
template: string;
post_filter?: string;
content_type?: string;
};
type Response = Route;PATCH /route/{id}
type Request = {
name: string;
match: string;
template: string;
post_filter?: string;
content_type?: string;
};
type Response = Route;DELETE /route/{id}
type Request = {};
type Response = {};نقاط پایانی:
GET /misc/themes - همه پوسته ها را دریافت کنیدGET /misc/prosemirror/json - Prosemirror json را دریافت کنیدDELETE /blog/cache - کش وبلاگ را حذف کنیدDELETE /blog - وبلاگ را حذف کنیدGET /misc/themes
type Request = {};
type Response = Theme[];GET /misc/prosemirror/json
type Request = {
html: string;
};
type Response = {
json: string;
};DELETE /blog/cache
type Request = {
type: 'all' | 'template' | 'paths';
paths?: string[];
};
type Response = {};نرم افزار وبلاگ را حذف می کند. وبلاگ و داده های آن 30 روز بعد برای همیشه حذف می شوند. به محدوده blog.delete نیاز دارد.
DELETE /blog
type Request = {};
type Response = {};interface Blog {
id: number;
created_at: number;
is_blocked: boolean;
subdomain: string;
type: 'default' | 'dev';
hosting_at: 'subdomain' | 'domain' | 'self';
hosting_domain: string | null;
hosting_url: string | null;
embeddable: boolean;
embedding_domains: string | null;
logo_url: string | null;
cover_url: string | null;
social_facebook: string | null;
social_twitter: string | null;
social_linkedin: string | null;
social_youtube: string | null;
social_tiktok: string | null;
social_instagram: string | null;
social_github: string | null;
code_head: string | null;
code_foot: string | null;
seo_indexing: boolean;
seo_robots_txt: string | null;
seo_external_links_follow: 'follow' | 'nofollow';
comments_code: string | null;
newsletter_code: string | null;
color_modes: 'light' | 'dark' | 'both';
color_mode_default: 'light' | 'dark' | 'os';
syntax_on: boolean;
syntax_line_numbers: boolean;
syntax_theme: string | null;
flashload: boolean;
variants: BlogVariant[];
}interface BlogVariant {
language_id: number;
name: string | null;
description: string | null;
}interface Post {
id: number;
preview_id: string;
created_at: number;
updated_at: number;
published_at: number | null;
is_featured: boolean;
is_page: boolean;
featured_image_url: string | null;
canonical_url: string | null;
code_head: string | null;
code_foot: string | null;
variant_statuses: {
id: number;
language_id: number;
status: 'draft' | 'published' | 'scheduled';
}[];
tags: Tag[];
authors: User[];
}variant_statuses فقط به شما می گوید که یک پست دارای کدام زبان است و وضعیت آنها. GET /post/{id}?variant_language_code=... را واکشی کنید تا شیء کامل PostVariant (محتوا، عنوان، فیلدهای SEO و غیره) را برای یک زبان دریافت کنید.
interface PostVariant {
language_id: number;
slug: string | null;
status: 'draft' | 'published' | 'scheduled';
url: string;
content: string | null;
content_unsaved: string | null;
title: string | null;
description: string | null;
}بازگشت توسط GET /posts و GET /pages. خلاصه ای سبک وزن برای هر پست: slug, url, title، و link_analysis منعکس کننده نوع زبان درخواستی (یا اصلی وبلاگ) و tags/authors فقط نام زبان اصلی آنهاست. واکشی GET /post/{id} برای کامل ارسال کنید شی، از جمله برچسب ها و نویسندگان.
interface PostListItem {
id: number;
created_at: number;
updated_at: number;
published_at: number | null;
is_featured: boolean;
is_page: boolean;
slug: string | null;
url: string | null;
title: string | null;
link_analysis: Record<string, number>;
variant_statuses: {
language_id: number;
status: 'draft' | 'published' | 'scheduled';
}[];
tags: string[]; // tag names, primary language
authors: string[]; // author names, primary language
}interface Tag {
id: number;
created_at: number;
updated_at: number;
is_private: boolean;
slug: string;
posts_count: number;
code_head: string | null;
code_foot: string | null;
variants: TagVariant[];
}interface TagVariant {
language_id: number;
url: string | null;
name: string | null;
description: string | null;
}interface User {
id: number;
created_at: number;
updated_at: number;
hyvor_user_id: number | null;
status: 'invited' | 'active' | 'blocked';
role: 'owner' | 'admin' | 'editor' | 'writer' | 'contributor';
slug: string;
posts_count: number;
email: string;
picture_url: string | null;
website_url: string | null;
social_facebook: string | null;
social_twitter: string | null;
social_linkedin: string | null;
social_youtube: string | null;
social_tiktok: string | null;
social_instagram: string | null;
social_github: string | null;
variants: UserVariant[];
}interface UserVariant {
language_id: number;
url: string;
name: string | null;
bio: string | null;
location: string | null;
}interface Media {
id: number;
uploaded_at: number;
name: string;
url: string;
original_name: string;
extension: string;
}interface Navigation {
id: number;
created_at: number;
url: string;
type: NavigationType;
sort: number;
variants: NavigationVariant[];
}interface NavigationVariant {
language_id: number;
name: string | null;
}interface Language {
id: number;
code: string;
name: string;
is_primary: boolean;
}interface Redirect {
id: number;
created_at: number;
path: string;
to: string;
type: 'temporary' | 'permanent';
}interface Webhook {
id: number;
url: string;
events: string[];
secret: string;
}interface Route {
id: number;
created_at: number;
name: string;
match: string;
template: string;
posts_filter: string | null;
content_type: string | null;
is_enabled: boolean;
}interface FileObject {
id: number;
name: string;
content: string | null;
folder: 'templates' | 'assets' | 'styles' | 'lang';
}interface Export {
id: number;
createdf_at: number;
format: 'hyvor_blogs' | 'wordpress';
status: 'pending' | 'completed' | 'failed';
url: string | null;
error?: string;
}interface Theme {
id: number;
type: 'original' | 'ported';
name: string;
}interface LinkObject {
id: number;
url: string;
full_url: string;
status_code: number;
status_type: 'ok' | 'broken' | 'redirect' | 'ignored';
ignored: boolean;
post_id: number;
post_variant_id: number;
post_variant_language_id: number;
post_variant_title: string;
}interface CheckObject {
id: number;
created_at: number;
status: 'pending' | 'completed' | 'failed';
error: string | null;
post_count: number;
post_variants_count: number;
page_count: number;
page_variants_count: number;
links_total_count: number;
links_ok_count: number;
links_broken_count: number;
links_redirect_count: number;
links_ignored_count: number;
}