Skip to content

/api/notification

pushErrMsg

  • 🔥 推送错误消息
  • /api/notification/pushErrMsg

请求

ts
/**
 * push error information
 */
export interface IPayload {
    /**
     * message content
     */
    readonly msg: string;
    /**
     * message timeout (ms)
     */
    readonly timeout?: number;
}
json5
/**
 * schemas/kernel/api/notification/pushErrMsg/payload.schema.json5
 * 推送提示信息
 * REF: https://github.com/siyuan-note/siyuan/blob/master/API.md#push-error-message
 * REF: https://github.com/siyuan-note/siyuan/blob/v2.9.2/kernel/api/notification.go#L48-L67
 * @pathname: /api/notification/pushErrMsg
 * @version: 2.9.2
 */
{
    $schema: 'https://json-schema.org/draft/2020-12/schema',
    $id: 'https://github.com/siyuan-community/siyuan-sdk/raw/main/schemas/kernel/api/notification/pushErrMsg/payload.schema.json5',
    $comment: 'v2.9.2',
    $ref: '#/$defs/root',
    $defs: {
        root: {
            title: 'payload body',
            description: 'push error information',

            type: 'object',
            additionalProperties: false,
            required: [
                'msg',
            ],
            properties: {
                msg: {
                    type: 'string',
                    description: 'message content',
                },
                timeout: {
                    /**
                     * 消息显示时间
                     * 单位: 毫秒
                     */
                    type: 'integer',
                    description: 'message timeout (ms)',
                    default: 7000,
                },
            },
        },
    },
}
json
{
    "$schema": "https://json-schema.org/draft/2020-12/schema",
    "$id": "https://github.com/siyuan-community/siyuan-sdk/raw/main/schemas/kernel/api/notification/pushErrMsg/payload.schema.json",
    "$comment": "v2.9.2",
    "$ref": "#/$defs/root",
    "$defs": {
        "root": {
            "title": "payload body",
            "description": "push error information",
            "type": "object",
            "additionalProperties": false,
            "required": [
                "msg"
            ],
            "properties": {
                "msg": {
                    "type": "string",
                    "description": "message content"
                },
                "timeout": {
                    "type": "integer",
                    "description": "message timeout (ms)",
                    "default": 7000
                }
            }
        }
    }
}

响应

ts
/**
 * push error information
 */
export interface IResponse {
    /**
     * status code
     */
    readonly code: number;
    readonly data: IData;
    /**
     * status message
     */
    readonly msg: string;
}

/**
 * the related info of the notification
 */
export interface IData {
    /**
     * message ID
     */
    readonly id: string;
}
json5
/**
 * schemas/kernel/api/notification/pushErrMsg/payload.schema.json5
 * 推送提示信息
 * REF: https://github.com/siyuan-note/siyuan/blob/master/API.md#push-error-message
 * REF: https://github.com/siyuan-note/siyuan/blob/v2.9.2/kernel/api/notification.go#L48-L67
 * @pathname: /api/notification/pushErrMsg
 * @version: 2.9.2
 */
{
    $schema: 'https://json-schema.org/draft/2020-12/schema',
    $id: 'https://github.com/siyuan-community/siyuan-sdk/raw/main/schemas/kernel/api/notification/pushErrMsg/response.schema.json5',
    $comment: 'v2.9.2',
    $ref: '#/$defs/root',
    $defs: {
        root: {
            title: 'response body',
            description: 'push error information',

            type: 'object',
            additionalProperties: false,
            required: [
                'code',
                'msg',
                'data',
            ],
            properties: {
                code: {
                    type: 'integer',
                    description: 'status code',
                },
                msg: {
                    type: 'string',
                    description: 'status message',
                },
                data: {
                    $ref: '#/$defs/data',
                },
            },
        },
        data: {
            title: 'IData',
            description: 'the related info of the notification',

            type: 'object',
            additionalProperties: false,
            required: [
                'id',
            ],
            properties: {
                id: {
                    type: 'string',
                    description: 'message ID',
                    pattern: '^[0-9a-z]{7}$',
                },
            },
        },
    },
}
json
{
    "$schema": "https://json-schema.org/draft/2020-12/schema",
    "$id": "https://github.com/siyuan-community/siyuan-sdk/raw/main/schemas/kernel/api/notification/pushErrMsg/response.schema.json",
    "$comment": "v2.9.2",
    "$ref": "#/$defs/root",
    "$defs": {
        "root": {
            "title": "response body",
            "description": "push error information",
            "type": "object",
            "additionalProperties": false,
            "required": [
                "code",
                "msg",
                "data"
            ],
            "properties": {
                "code": {
                    "type": "integer",
                    "description": "status code"
                },
                "msg": {
                    "type": "string",
                    "description": "status message"
                },
                "data": {
                    "$ref": "#/$defs/data"
                }
            }
        },
        "data": {
            "title": "IData",
            "description": "the related info of the notification",
            "type": "object",
            "additionalProperties": false,
            "required": [
                "id"
            ],
            "properties": {
                "id": {
                    "type": "string",
                    "description": "message ID",
                    "pattern": "^[0-9a-z]{7}$"
                }
            }
        }
    }
}

pushMsg

  • 🔥 推送消息
  • /api/notification/pushMsg

请求

ts
/**
 * push alert information
 */
export interface IPayload {
    /**
     * message content
     */
    readonly msg: string;
    /**
     * message timeout (ms)
     */
    readonly timeout?: number;
}
json5
/**
 * schemas/kernel/api/notification/pushMsg/payload.schema.json5
 * 推送提示信息
 * REF: https://github.com/siyuan-note/siyuan/blob/master/API.md#push-message
 * REF: https://github.com/siyuan-note/siyuan/blob/v2.9.2/kernel/api/notification.go#L27-L46
 * @pathname: /api/notification/pushMsg
 * @version: 2.9.2
 */
{
    $schema: 'https://json-schema.org/draft/2020-12/schema',
    $id: 'https://github.com/siyuan-community/siyuan-sdk/raw/main/schemas/kernel/api/notification/pushMsg/payload.schema.json5',
    $comment: 'v2.9.2',
    $ref: '#/$defs/root',
    $defs: {
        root: {
            title: 'payload body',
            description: 'push alert information',

            type: 'object',
            additionalProperties: false,
            required: [
                'msg',
            ],
            properties: {
                msg: {
                    type: 'string',
                    description: 'message content',
                },
                timeout: {
                    /**
                     * 消息显示时间
                     * 单位: 毫秒
                     */
                    type: 'integer',
                    description: 'message timeout (ms)',
                    default: 7000,
                },
            },
        },
    },
}
json
{
    "$schema": "https://json-schema.org/draft/2020-12/schema",
    "$id": "https://github.com/siyuan-community/siyuan-sdk/raw/main/schemas/kernel/api/notification/pushMsg/payload.schema.json",
    "$comment": "v2.9.2",
    "$ref": "#/$defs/root",
    "$defs": {
        "root": {
            "title": "payload body",
            "description": "push alert information",
            "type": "object",
            "additionalProperties": false,
            "required": [
                "msg"
            ],
            "properties": {
                "msg": {
                    "type": "string",
                    "description": "message content"
                },
                "timeout": {
                    "type": "integer",
                    "description": "message timeout (ms)",
                    "default": 7000
                }
            }
        }
    }
}

响应

ts
/**
 * push alert information
 */
export interface IResponse {
    /**
     * status code
     */
    readonly code: number;
    readonly data: IData;
    /**
     * status message
     */
    readonly msg: string;
}

/**
 * the related info of the notification
 */
export interface IData {
    /**
     * message ID
     */
    readonly id: string;
}
json5
/**
 * schemas/kernel/api/notification/pushMsg/payload.schema.json5
 * 推送提示信息
 * REF: https://github.com/siyuan-note/siyuan/blob/master/API.md#push-message
 * REF: https://github.com/siyuan-note/siyuan/blob/v2.9.2/kernel/api/notification.go#L27-L46
 * @pathname: /api/notification/pushMsg
 * @version: 2.9.2
 */
{
    $schema: 'https://json-schema.org/draft/2020-12/schema',
    $id: 'https://github.com/siyuan-community/siyuan-sdk/raw/main/schemas/kernel/api/notification/pushMsg/response.schema.json5',
    $comment: 'v2.9.2',
    $ref: '#/$defs/root',
    $defs: {
        root: {
            title: 'response body',
            description: 'push alert information',

            type: 'object',
            additionalProperties: false,
            required: [
                'code',
                'msg',
                'data',
            ],
            properties: {
                code: {
                    type: 'integer',
                    description: 'status code',
                },
                msg: {
                    type: 'string',
                    description: 'status message',
                },
                data: {
                    $ref: '#/$defs/data',
                },
            },
        },
        data: {
            title: 'IData',
            description: 'the related info of the notification',

            type: 'object',
            additionalProperties: false,
            required: [
                'id',
            ],
            properties: {
                id: {
                    type: 'string',
                    description: 'message ID',
                    pattern: '^[0-9a-z]{7}$',
                },
            },
        },
    },
}
json
{
    "$schema": "https://json-schema.org/draft/2020-12/schema",
    "$id": "https://github.com/siyuan-community/siyuan-sdk/raw/main/schemas/kernel/api/notification/pushMsg/response.schema.json",
    "$comment": "v2.9.2",
    "$ref": "#/$defs/root",
    "$defs": {
        "root": {
            "title": "response body",
            "description": "push alert information",
            "type": "object",
            "additionalProperties": false,
            "required": [
                "code",
                "msg",
                "data"
            ],
            "properties": {
                "code": {
                    "type": "integer",
                    "description": "status code"
                },
                "msg": {
                    "type": "string",
                    "description": "status message"
                },
                "data": {
                    "$ref": "#/$defs/data"
                }
            }
        },
        "data": {
            "title": "IData",
            "description": "the related info of the notification",
            "type": "object",
            "additionalProperties": false,
            "required": [
                "id"
            ],
            "properties": {
                "id": {
                    "type": "string",
                    "description": "message ID",
                    "pattern": "^[0-9a-z]{7}$"
                }
            }
        }
    }
}