Memos API
  1. MemoService
Memos API
  • AuthService
    • SignIn signs in the user with the given username and password.
      POST
    • SignInWithSSO signs in the user with the given SSO code.
      POST
    • SignOut signs out the user.
      POST
    • SignUp signs up the user with the given username and password.
      POST
    • GetAuthStatus returns the current auth status of the user.
      POST
  • IdentityProviderService
    • ListIdentityProviders lists identity providers.
      GET
    • CreateIdentityProvider creates an identity provider.
      POST
    • UpdateIdentityProvider updates an identity provider.
      PATCH
    • DeleteIdentityProvider deletes an identity provider.
      DELETE
    • GetIdentityProvider gets an identity provider.
      GET
  • InboxService
    • ListInboxes lists inboxes for a user.
    • UpdateInbox updates an inbox.
    • DeleteInbox deletes an inbox.
  • MarkdownService
    • GetLinkMetadata returns metadata for a given link.
    • RestoreMarkdownNodes restores the given nodes to markdown content.
    • StringifyMarkdownNodes stringify the given nodes to plain text content.
    • ParseMarkdown parses the given markdown content and returns a list of nodes.
  • MemoService
    • ListMemos lists memos with pagination and filter.
      GET
    • CreateMemo creates a memo.
      POST
    • DeleteMemoReaction deletes a reaction for a memo.
      DELETE
    • UpdateMemo updates a memo.
      PATCH
    • GetMemo gets a memo.
      GET
    • DeleteMemo deletes a memo.
      DELETE
    • ListMemoComments lists comments for a memo.
      GET
    • CreateMemoComment creates a comment for a memo.
      POST
    • ListMemoReactions lists reactions for a memo.
      GET
    • UpsertMemoReaction upserts a reaction for a memo.
      POST
    • ListMemoRelations lists relations for a memo.
      GET
    • SetMemoRelations sets relations for a memo.
      PATCH
    • ListMemoResources lists resources for a memo.
      GET
    • SetMemoResources sets resources for a memo.
      PATCH
    • ListMemos lists memos with pagination and filter.
      GET
    • DeleteMemoTag deletes a tag for a memo.
      DELETE
    • RenameMemoTag renames a tag for a memo.
      PATCH
  • ResourceService
    • ListResources lists all resources.
    • CreateResource creates a new resource.
    • GetResource returns a resource by name.
    • DeleteResource deletes a resource by name.
    • UpdateResource updates a resource.
    • GetResourceBinary returns a resource binary by name.
  • UserService
    • ListUsers returns a list of users.
    • CreateUser creates a new user.
    • ListAllUserStats returns all user stats.
    • GetUserByUsername gets a user by username.
    • GetUser gets a user by name.
    • DeleteUser deletes a user.
    • ListUserAccessTokens returns a list of access tokens for a user.
    • CreateUserAccessToken creates a new access token for a user.
    • DeleteUserAccessToken deletes an access token for a user.
    • GetUserSetting gets the setting of a user.
    • GetUserStats returns the stats of a user.
    • ListShortcuts returns a list of shortcuts for a user.
    • CreateShortcut creates a new shortcut for a user.
    • DeleteShortcut deletes a shortcut for a user.
    • UpdateShortcut updates a shortcut for a user.
    • UpdateUserSetting updates the setting of a user.
    • UpdateUser updates a user.
    • GetUserAvatarBinary gets the avatar of a user.
  • WebhookService
    • ListWebhooks returns a list of webhooks.
    • CreateWebhook creates a new webhook.
    • GetWebhook returns a webhook by id.
    • DeleteWebhook deletes a webhook by id.
    • UpdateWebhook updates a webhook.
  • WorkspaceService
    • GetWorkspaceProfile returns the workspace profile.
  • WorkspaceSettingService
    • GetWorkspaceSetting returns the setting by name.
    • SetWorkspaceSetting updates the setting.
  • ActivityService
    • GetActivity returns the activity with the given id.
  1. MemoService

CreateMemo creates a memo.

POST
/api/v1/memos

请求参数

Body 参数application/json
state
enum<string> 
可选
枚举值:
STATE_UNSPECIFIEDNORMALARCHIVED
默认值:
STATE_UNSPECIFIED
creator
string 
The name of the creator. Format: users/{user}
可选
createTime
string <date-time>
可选
updateTime
string <date-time>
可选
displayTime
string <date-time>
可选
content
string 
可选
visibility
enum<string> 
可选
枚举值:
VISIBILITY_UNSPECIFIEDPRIVATEPROTECTEDPUBLIC
默认值:
VISIBILITY_UNSPECIFIED
pinned
boolean 
可选
resources
array[object (v1Resource) {7}] 
可选
name
string 
可选
The name of the resource.
Format: resources/{resource}, resource is the user defined if or uuid.
filename
string 
可选
content
string <byte>
可选
externalLink
string 
可选
type
string 
可选
size
string <int64>
可选
memo
string 
可选
The related memo. Refer to Memo.name.
relations
array[object (v1MemoRelation) {3}] 
可选
memo
object (v1MemoRelationMemo) 
可选
relatedMemo
object (v1MemoRelationMemo) 
可选
type
enum<string> 
可选
枚举值:
TYPE_UNSPECIFIEDREFERENCECOMMENT
默认值:
TYPE_UNSPECIFIED
property
object (v1MemoProperty) 
可选
hasLink
boolean 
可选
hasTaskList
boolean 
可选
hasCode
boolean 
可选
hasIncompleteTasks
boolean 
可选
location
object (apiv1Location) 
可选
placeholder
string 
可选
latitude
number <double>
可选
longitude
number <double>
可选
示例
{
    "state": "STATE_UNSPECIFIED",
    "creator": "string",
    "createTime": "2019-08-24T14:15:22Z",
    "updateTime": "2019-08-24T14:15:22Z",
    "displayTime": "2019-08-24T14:15:22Z",
    "content": "string",
    "visibility": "VISIBILITY_UNSPECIFIED",
    "pinned": true,
    "resources": [
        {
            "name": "string",
            "filename": "string",
            "content": "string",
            "externalLink": "string",
            "type": "string",
            "size": "string",
            "memo": "string"
        }
    ],
    "relations": [
        {
            "memo": {
                "name": "string",
                "uid": "string"
            },
            "relatedMemo": {
                "name": "string",
                "uid": "string"
            },
            "type": "TYPE_UNSPECIFIED"
        }
    ],
    "property": {
        "hasLink": true,
        "hasTaskList": true,
        "hasCode": true,
        "hasIncompleteTasks": true
    },
    "location": {
        "placeholder": "string",
        "latitude": 0,
        "longitude": 0
    }
}

示例代码

Shell
JavaScript
Java
Swift
Go
PHP
Python
HTTP
C
C#
Objective-C
Ruby
OCaml
Dart
R
请求示例请求示例
Shell
JavaScript
Java
Swift
curl --location --request POST '/api/v1/memos' \
--header 'Content-Type: application/json' \
--data-raw '{
    "state": "STATE_UNSPECIFIED",
    "creator": "string",
    "createTime": "2019-08-24T14:15:22Z",
    "updateTime": "2019-08-24T14:15:22Z",
    "displayTime": "2019-08-24T14:15:22Z",
    "content": "string",
    "visibility": "VISIBILITY_UNSPECIFIED",
    "pinned": true,
    "resources": [
        {
            "name": "string",
            "filename": "string",
            "content": "string",
            "externalLink": "string",
            "type": "string",
            "size": "string",
            "memo": "string"
        }
    ],
    "relations": [
        {
            "memo": {
                "name": "string",
                "uid": "string"
            },
            "relatedMemo": {
                "name": "string",
                "uid": "string"
            },
            "type": "TYPE_UNSPECIFIED"
        }
    ],
    "property": {
        "hasLink": true,
        "hasTaskList": true,
        "hasCode": true,
        "hasIncompleteTasks": true
    },
    "location": {
        "placeholder": "string",
        "latitude": 0,
        "longitude": 0
    }
}'

返回响应

🟢200成功
application/json
A successful response.
Body
name
string 
只读可选
The name of the memo.
Format: memos/{memo}, memo is the user defined id or uuid.
state
enum<string> 
可选
枚举值:
STATE_UNSPECIFIEDNORMALARCHIVED
默认值:
STATE_UNSPECIFIED
creator
string 
The name of the creator. Format: users/{user}
可选
createTime
string <date-time>
可选
updateTime
string <date-time>
可选
displayTime
string <date-time>
可选
content
string 
可选
nodes
array[object (v1Node) {32}] 
只读可选
type
enum<string> 
可选
LINE_BREAK: Block nodes.
TEXT: Inline nodes.
枚举值:
NODE_UNSPECIFIEDLINE_BREAKPARAGRAPHCODE_BLOCKHEADINGHORIZONTAL_RULEBLOCKQUOTELISTORDERED_LIST_ITEMUNORDERED_LIST_ITEMTASK_LIST_ITEMMATH_BLOCKTABLEEMBEDDED_CONTENTTEXTBOLDITALICBOLD_ITALICCODEIMAGELINKAUTO_LINKTAGSTRIKETHROUGHESCAPING_CHARACTERMATHHIGHLIGHTSUBSCRIPTSUPERSCRIPTREFERENCED_CONTENTSPOILERHTML_ELEMENT
默认值:
NODE_UNSPECIFIED
lineBreakNode
object (v1LineBreakNode) 
可选
paragraphNode
object (v1ParagraphNode) 
可选
codeBlockNode
object (v1CodeBlockNode) 
可选
headingNode
object (v1HeadingNode) 
可选
horizontalRuleNode
object (v1HorizontalRuleNode) 
可选
blockquoteNode
object (v1BlockquoteNode) 
可选
listNode
object (v1ListNode) 
可选
orderedListItemNode
object (v1OrderedListItemNode) 
可选
unorderedListItemNode
object (v1UnorderedListItemNode) 
可选
taskListItemNode
object (v1TaskListItemNode) 
可选
mathBlockNode
object (v1MathBlockNode) 
可选
tableNode
object (v1TableNode) 
可选
embeddedContentNode
object (v1EmbeddedContentNode) 
可选
textNode
object (v1TextNode) 
可选
boldNode
object (v1BoldNode) 
可选
italicNode
object (v1ItalicNode) 
可选
boldItalicNode
object (v1BoldItalicNode) 
可选
codeNode
object (v1CodeNode) 
可选
imageNode
object (v1ImageNode) 
可选
linkNode
object (v1LinkNode) 
可选
autoLinkNode
object (v1AutoLinkNode) 
可选
tagNode
object (v1TagNode) 
可选
strikethroughNode
object (v1StrikethroughNode) 
可选
escapingCharacterNode
object (v1EscapingCharacterNode) 
可选
mathNode
object (v1MathNode) 
可选
highlightNode
object (v1HighlightNode) 
可选
subscriptNode
object (v1SubscriptNode) 
可选
superscriptNode
object (v1SuperscriptNode) 
可选
referencedContentNode
object (v1ReferencedContentNode) 
可选
spoilerNode
object (v1SpoilerNode) 
可选
htmlElementNode
object (v1HTMLElementNode) 
可选
visibility
enum<string> 
可选
枚举值:
VISIBILITY_UNSPECIFIEDPRIVATEPROTECTEDPUBLIC
默认值:
VISIBILITY_UNSPECIFIED
tags
array[string]
只读可选
pinned
boolean 
可选
resources
array[object (v1Resource) {8}] 
可选
name
string 
可选
The name of the resource.
Format: resources/{resource}, resource is the user defined if or uuid.
createTime
string <date-time>
只读可选
filename
string 
可选
content
string <byte>
可选
externalLink
string 
可选
type
string 
可选
size
string <int64>
可选
memo
string 
可选
The related memo. Refer to Memo.name.
relations
array[object (v1MemoRelation) {3}] 
可选
memo
object (v1MemoRelationMemo) 
可选
relatedMemo
object (v1MemoRelationMemo) 
可选
type
enum<string> 
可选
枚举值:
TYPE_UNSPECIFIEDREFERENCECOMMENT
默认值:
TYPE_UNSPECIFIED
reactions
array[object (v1Reaction) {4}] 
只读可选
id
integer <int32>
可选
creator
string 
The name of the creator. Format: users/{user}
可选
contentId
string 
可选
The content identifier.
For memo, it should be the Memo.name.
reactionType
string 
可选
property
object (v1MemoProperty) 
可选
hasLink
boolean 
可选
hasTaskList
boolean 
可选
hasCode
boolean 
可选
hasIncompleteTasks
boolean 
可选
parent
string 
The name of the parent memo. Format: memos/{id}
只读可选
snippet
string 
只读可选
The snippet of the memo content. Plain text only.
location
object (apiv1Location) 
可选
placeholder
string 
可选
latitude
number <double>
可选
longitude
number <double>
可选
示例
{
    "name": "string",
    "state": "STATE_UNSPECIFIED",
    "creator": "string",
    "createTime": "2019-08-24T14:15:22Z",
    "updateTime": "2019-08-24T14:15:22Z",
    "displayTime": "2019-08-24T14:15:22Z",
    "content": "string",
    "nodes": [
        {
            "type": "NODE_UNSPECIFIED",
            "lineBreakNode": {},
            "paragraphNode": {
                "children": [
                    {}
                ]
            },
            "codeBlockNode": {
                "language": "string",
                "content": "string"
            },
            "headingNode": {
                "level": 0,
                "children": [
                    {}
                ]
            },
            "horizontalRuleNode": {
                "symbol": "string"
            },
            "blockquoteNode": {
                "children": [
                    {}
                ]
            },
            "listNode": {
                "kind": "KIND_UNSPECIFIED",
                "indent": 0,
                "children": [
                    {}
                ]
            },
            "orderedListItemNode": {
                "number": "string",
                "indent": 0,
                "children": [
                    {}
                ]
            },
            "unorderedListItemNode": {
                "symbol": "string",
                "indent": 0,
                "children": [
                    {}
                ]
            },
            "taskListItemNode": {
                "symbol": "string",
                "indent": 0,
                "complete": true,
                "children": [
                    {}
                ]
            },
            "mathBlockNode": {
                "content": "string"
            },
            "tableNode": {
                "header": [
                    {}
                ],
                "delimiter": [
                    "string"
                ],
                "rows": [
                    {
                        "cells": [
                            {}
                        ]
                    }
                ]
            },
            "embeddedContentNode": {
                "resourceName": "string",
                "params": "string"
            },
            "textNode": {
                "content": "string"
            },
            "boldNode": {
                "symbol": "string",
                "children": [
                    {}
                ]
            },
            "italicNode": {
                "symbol": "string",
                "content": "string"
            },
            "boldItalicNode": {
                "symbol": "string",
                "content": "string"
            },
            "codeNode": {
                "content": "string"
            },
            "imageNode": {
                "altText": "string",
                "url": "string"
            },
            "linkNode": {
                "text": "string",
                "url": "string"
            },
            "autoLinkNode": {
                "url": "string",
                "isRawText": true
            },
            "tagNode": {
                "content": "string"
            },
            "strikethroughNode": {
                "content": "string"
            },
            "escapingCharacterNode": {
                "symbol": "string"
            },
            "mathNode": {
                "content": "string"
            },
            "highlightNode": {
                "content": "string"
            },
            "subscriptNode": {
                "content": "string"
            },
            "superscriptNode": {
                "content": "string"
            },
            "referencedContentNode": {
                "resourceName": "string",
                "params": "string"
            },
            "spoilerNode": {
                "content": "string"
            },
            "htmlElementNode": {
                "tagName": "string",
                "attributes": {
                    "property1": "string",
                    "property2": "string"
                }
            }
        }
    ],
    "visibility": "VISIBILITY_UNSPECIFIED",
    "tags": [
        "string"
    ],
    "pinned": true,
    "resources": [
        {
            "name": "string",
            "createTime": "2019-08-24T14:15:22Z",
            "filename": "string",
            "content": "string",
            "externalLink": "string",
            "type": "string",
            "size": "string",
            "memo": "string"
        }
    ],
    "relations": [
        {
            "memo": {
                "name": "string",
                "uid": "string",
                "snippet": "string"
            },
            "relatedMemo": {
                "name": "string",
                "uid": "string",
                "snippet": "string"
            },
            "type": "TYPE_UNSPECIFIED"
        }
    ],
    "reactions": [
        {
            "id": 0,
            "creator": "string",
            "contentId": "string",
            "reactionType": "string"
        }
    ],
    "property": {
        "hasLink": true,
        "hasTaskList": true,
        "hasCode": true,
        "hasIncompleteTasks": true
    },
    "parent": "string",
    "snippet": "string",
    "location": {
        "placeholder": "string",
        "latitude": 0,
        "longitude": 0
    }
}
🔴500服务器错误
修改于 2025-03-15 17:43:05
上一页
ListMemos lists memos with pagination and filter.
下一页
DeleteMemoReaction deletes a reaction for a memo.
Built with