Microsoft Graph 中的 OneNote API 错误代码Error codes for OneNote APIs in Microsoft Graph

本文介绍当通过 API 发送的请求失败时,Microsoft Graph 中的 OneNote API 返回的错误代码。This article describes error codes that are returned by the OneNote APIs in Microsoft Graph whenever a request sent through the API fails.

错误响应示例Error response example

请求生成错误时,OneNote API 将停止执行此请求并将错误响应作为 JSON 对象返回。When your request generates an error, the OneNote API stops performing the request and returns an error response as a JSON object. 错误响应将包含相关的错误代码、消息和本文相应部分的链接。An error response contains the associated error code, a message, and a link to the appropriate section of this article. 以下示例演示了错误响应的外观。The following example shows how an error response looks.

{
   "error":{
      "code":"10002",
      "message":"The service is currently unavailable. Please try again later.",
      "innerError": {
        "requestId": "request-id",
        "date": "date-time"
      }
   }
}

有关 Microsoft Graph 错误的详细信息,请参阅 Microsoft Graph 错误响应和资源类型For more information about Microsoft Graph errors, see Microsoft Graph error responses and resource types.

从 10001 到 19999 的代码Codes from 10001 to 19999

服务遇到问题,或向应用程序发送信息。The service is having problems or is sending information to the application.

1000110001

出现意外错误,请求失败。An unexpected error occurred and the request failed.

1000210002

服务当前不可用。The service is not currently available.

1000310003

当前用户的帐户已超过最大活动请求数。The current user's account has exceeded the maximum number of active requests. 你的应用将不得不重复请求。Your app will have to repeat the request.

1000410004

服务无法在请求的部分创建页面,因为该部分受密码保护。The service can't create a page in the requested section because that section is protected by a password.

1000510005

请求包含超过最大数量的图像标记,其中 data-render-src 属性包含 PDF。The request contains more than the maximum number of image tags in which the data-render-src attribute contains a PDF. 请参阅添加图像和文件See Add images and files.

1000610006

OneNote API 程序无法在指定部分创建页面,因为该部分已损坏。The OneNote API was unable to create a page in the specified section because that section is corrupt.

1000710007

服务器太忙,目前无法处理传入的请求。请稍后重试。The server is too busy to handle the incoming request at this moment. Please try again later.

1000810008

用户或组的 OneDrive 上的一个或多个文档库包含的 OneNote 项目数(笔记本、分区、分区组)超过 5000 个,无法使用 API 查询。One or more of the document libraries on the user or group's OneDrive contains more than 5000 OneNote items (notebooks, sections, section groups), and cannot be queried using the API. 请确保用户或组的文档库包含的 OneNote 项目数均未超过 5000 个。Please make sure that none of the user or group's document libraries contains more than 5000 OneNote items. 请参阅 OneNote 开发博客获取缓解步骤。See the OneNote Dev blog for mitigation steps.

1001210012

无法创建或更新实体,因为包含笔记本的库要求先将项目签出然后才能编辑这些项。Unable to create or update the entity because the library that contains the notebook requires items to be checked out before they can be edited. 有关详细信息,请参阅设置库以请求签出文件For more information, see Set up a library to require check-out of files.

可从库中删除签出要求,也可以移动笔记本。Either remove the check-out requirement from the library, or move the notebook.

1001310013

用户或组 OneDrive 上的一个或多个文档库包含 20,000 多个项目,无法使用 API 通过索引进行查询。请确保没有任何一个用户或组的文档库包含超过 20,000 个项目。有关缓解步骤,请参阅 OneNote 开发人员博客One or more of the document libraries on the user or group's OneDrive contains more than 20,000 items and cannot be indexed for querying using the API. Please make sure that none of the user or group's document libraries contains more than 20,000 items. See the OneNote Dev blog for mitigation steps.

1001410014

Azure Key Vault 太忙,目前无法处理传入的请求。Azure Key Vault is too busy to handle the incoming request at this moment. 请稍后重试。Please try again later.

1001510015

SharePoint 当前不可用。SharePoint is currently unavailable. 请稍后重试。Please try again later.

1001610016

用户或组的 OneDrive 上的文档库超出了唯一的安全作用域阈值限制。Document library on the user or group’s OneDrive exceeded unique security scopes threshold limit. 为库设置的唯一安全作用域的最大数量不能超过 50,000 个。The maximum number of unique security scopes set for a library cannot exceed 50,000.

1001710017

错误的请求。Bad Request.

1999919999

请求失败,因为发生无法确定的错误。The request failed because an undetermined error occurred.

从 20001 到 29999 的代码Codes from 20001 to 29999

应用程序代码已经出现问题。The application code has done something wrong.

2000120001

请求缺少必需的“演示”部分。The request is missing the required "Presentation" part. 只需要一个。Exactly one is required.

2000220002

请求包含两个或更多个“演示”部分。The request contains two or more "Presentation" parts. 只需要一个。Exactly one is required.

2000320003

“演示”部分的内容类型只能是文本/HTML 或应用程序/XHTML+XML。The content type of the "Presentation" part can be only text/HTML or application/XHTML+XML.

2000420004

“演示”部分 HTML 包含一个图像标记,其中包含 srcdata-render-src 属性集。API 将忽略 src 属性并使用 data-render-src 属性。The "Presentation" part HTML contains an image tag with both the src and the data-render-src properties set. The API will ignore the src property and use the data-render-src property.

2000520005

请求 URI 太长。The request URI is too long. URI 的最大大小(包括所有参数和数据)为 16 KB 或 16,384 个字符。The maximum size of the URI (including all parameters and data) is 16 KB or 16,384 characters.

2000620006

“演示”部分 HTML 包含未设置 src 和 data-render-src 属性的图像标记。The "Presentation" part HTML contains an image tag with neither the src nor the data-render-src properties set. API 将忽略该图像标记。The API will ignore the image tag.

2000720007

“演示文稿”部分 HTML 包含与任何允许的格式均不匹配的创建日期/时间字符串。The "Presentation" part HTML contains a created date/time string that does not match any of the allowed formats.

2000820008

请求大小太大。The size of the request is too large.

2000920009

请求包含使用重复名称的部分。The request contains parts with duplicate names. 部分名称必须是唯一的。Part names must be unique.

2001020010

未提供指定内容类型的内容处置标头。The Content-Disposition header was not supplied for the specified content type.

2001120011

请求包含格式错误的多部分有效负载。The request contains a malformed multipart payload. 问题可能包括缺少空行、缺少末行、部分分隔符格式不正确等。Problems could include missing blank lines, a missing last line, incorrectly formatted part separators, and so on. 如果正在手动生成多部分消息,请仔细检查逻辑,或者考虑使用第三方库。If you're building the multipart message by hand, carefully check the logic, or consider using a third-party library.

2001220012

请求未提供指定部分的内容类型。The request doesn't supply a content type for the specified part.

2001320013

请求未提供指定部分的内容类型和内容处置标头。The request doesn't supply Content-Type and Content-Disposition headers for the specified part.

2001420014

多部分消息中的某个部分的长度超过最大大小 25 MB。The length of a part in the multipart message exceeds the maximum size of 25 MB.

2001520015

多部分消息中的部分计数超过 500 个的限制。The count of parts in the multipart message exceeds the limit of 500.

2001620016

多部分消息的长度超过 75 MB 的限制。The length of the multipart message exceeds the limit of 75 MB.

2001720017

电子邮件 MIME 格式不正确。The email MIME was malformed.

2001820018

会议 MIME 或 ICal 格式不正确。The meeting MIME or ICal was malformed.

2001920019

找不到 ICal。No ICal was found.

2002020020

在请求正文中遇到格式不正确的 Json。Encountered malformed Json in request body.

2010020100

请求的语法有问题。Something is wrong with the syntax of your request.

2010120101

所请求的属性不存在。The property that you requested doesn't exist.

2010220102

所请求的资源不存在。You requested a resource that doesn't exist.

2010320103

此请求不支持 expand 查询。The expand query is not supported for this request. 请参阅受支持的 OData 查询字符串选项See Supported OData query string options.

2010420104

仅当查询某个部分中的网页集或查询特定页时,才支持 pagelevel 查询选项。例如:The pagelevel query option is supported only when querying for the pages collection in a section or for a specific page. For example:

GET ../sections/{id}/pages?pagelevel=true
GET ../pages/{id}?pagelevel=true

2010620106

你的请求包含不受支持的查询运算符。Your request contains a query operator that is not supported.

2010820108

您的请求包含不受支持的 OData 查询参数。Your request contains unsupported OData query parameters.

2010920109

PATCH 请求中的有效负载构建不正确。The payload in the PATCH request is not constructed correctly.

2011020110

包含数据部分的页面创建请求要求内容为多部分,并包含“演示”部分。Page create requests with data parts require the content to be multipart, with a "Presentation" part.

2011120111

你的请求使用不受支持的 OData 功能。Your request uses an OData feature that isn't supported.

2011220112

您的请求包含无效的目标笔记本、节组、节或页面实体 ID。Your request contains an invalid ID for the target notebook, section group, section, or page entity.

2011320113

请求中指定的资源已被删除。The resource specified in the request has been deleted.

2011520115

名称包含无效字符。The name contains invalid characters. 笔记本名称中不能包含下列任意字符:? * \ / : < > | ' "A notebook name cannot contain any of the following characters: ? * \ / : < > | ' "

2011720117

在您指定的位置中已存在指定名称的项。An item with the name you specified already exists in the location that you specified.

2011920119

“演示”部分的 HTML 包含一个 data-attachment 属性,该属性不为有效格式,或者包含一个或多个对文件名无效的字符:\ / : * ? < > | "The HTML in the "Presentation" part contains a data-attachment attribute that either doesn't have a valid format or includes one or more of these invalid characters for a file name: \ / : * ? < > | ". 请求替代了错误消息中指示的值。The request substituted the value indicated in the error message.

2012020120

找不到你的请求指定的 PATCH 目标。Your request specifies a PATCH target that can't be located.

2012120121

请求包含无效的 PATCH 参数。请参阅更新页面内容Your request contains an invalid PATCH argument. See Update page content.

2012220122

请求指定的 PATCH 操作不受支持。请参阅更新页面内容Your request specifies an unsupported PATCH action. See Update page content.

2012320123

PATCH 请求无法修改指定页面。The PATCH request is unable to alter the specified page.

2012420124

你的多部分 PATCH 请求不包含使用 PATCH 操作 JSON 结构的“命令”部分。Your multipart PATCH request doesn't include a "commands" part with the PATCH action JSON structure. 请参阅更新页面内容See Update page content.

2012520125

PATCH 请求不包含任何操作。请参阅更新页面内容Your PATCH request contains no actions. See Update page content.

2012620126

邮件正文包含格式错误的 JSON 或此操作不支持的字段。The message body contains either incorrectly formatted JSON or fields that are not supported for this operation.

2012720127

您的请求指定了未知属性的名称。Your request specifies the name of an unknown property.

2012820128

您的请求在消息中指示的位置包含 OData 语法错误。Your request contains an OData syntax error at the position indicated in the message.

2012920129

你的请求包含值过高的 top 查询字符串选项。Your request contains a top query string option whose value is too high. 对于页面查询,最大值为 100,默认值为 20。For page queries, the maximum value is 100, and the default value is 20.

2013020130

你的请求包含指向找不到的 HTTP 资源的 URI。Your request contains a URI that points to an HTTP resource that can't be found.

2013120131

你的请求包含无效的内容类型值。Your request contains an invalid value for Content-Type. 请使用消息中指示的值。Use the value indicated in the message.

2013220132

你的请求包含无效的内容。Your request contains invalid content. 此问题的常见原因是缺少内容类型请求标头和/或请求正文中没有内容。Common causes for this are a missing Content-Type request header and/or no content in the body of the request.

2013320133

你的请求指定的 PATCH 目标不受支持。Your request specifies a PATCH target that is not supported. 请参阅更新页面内容See Update page content.

2013420134

您的请求将无效元素指定为 PATCH 操作的目标。如果目标使用 data-id 标识符,请确保其前缀为 # 符号。请参阅更新页面内容Your request specifies an invalid element as the target of the PATCH action. If the target uses the data-id identifier, make sure it's prefixed with a # symbol. See Update page content.

2013520135

你的请求指定的实体类型不受 PATCH 操作支持。Your request specifies an entity type that is not supported for the PATCH operation. 请参阅更新页面内容See Update page content.

2013620136

你的请求包含无效的 data-render-srcdata-render-method 属性或缺失这些属性。Your request contains an invalid or missing data-render-src or data-render-method attribute. 请参阅从捕获内容中提取数据See Extract data from captures.

2013720137

目标页面不支持 PATCH 请求。The target page does not support PATCH requests.

2013820138

PATCH 请求中的目标元素类型不支持 append 操作。请参阅更新页面内容The target element type in your PATCH request doesn't support the append action. See Update page content.

2013920139

请求包含无效的 data-tag 属性值。请参阅使用笔记标记Your request contains an invalid data-tag attribute value. See Use note tags.

2014020140

你的请求包含无效的 data-tag 状态值。Your request contains an invalid data-tag status value. 复选框笔记标记可以包含已完成状态。Check box note tags can have a completed status.

示例:Example:

    <p data-tag="to-do:completed">To-do note tag in completed state (checked box in the UI)</p>

请参阅使用笔记标记See Use note tags.

2014120141

PATCH 请求中的目标不支持指定操作。The target in your PATCH request doesn't support the specified action. 请参阅更新页面内容See Update page content.

2014220142

你的请求包含子实体的父项或父实体的子项的 expand 表达式,但它并不受支持。Your request contains an expand expression for a parent of child entities or a child of parent entities, which is not supported. 请参阅受支持的 OData 查询字符串选项See Supported OData query string options.

2014320143

OData 查询无效。The OData query is invalid.

2014420144

你的请求包含非导航属性的 expand 表达式。Your request contains an expand expression for a non-navigation property. 只能扩展导航属性。Only navigation properties can be expanded.

2014520145

你的请求中的 selectexpand 表达式包含无效条件。The select or expand expression in your request contains an invalid term.

2014620146

元素上指定了 style="position:absolute" 属性,但是 body 元素未指定支持定位所需的 data-absolute-enabled="true"The style="position:absolute" attribute is specified on an element, but the body element does not specify data-absolute-enabled="true", which is required to support positioning. 将忽略所有的定位设置。All position settings will be ignored. 请参阅创建绝对定位的元素See Create absolute positioned elements.

2014720147

在非 body 元素直接子级的元素上指定了不受支持的 style="position:absolute" 属性。The style="position:absolute" attribute is specified on an element that is not a direct child of the body element, which is not supported. 如果元素是 divimgobject,请使其成为正文的直接子级;否则,将忽略定位设置,并在绝对定位的 div 中呈现它的内容。If the element is a div, img, or object, make it a direct child of the body; otherwise the position settings will be ignored and its content will render inside an absolute positioned div. 请参阅创建绝对定位的元素See Create absolute positioned elements.

2014820148

在不支持 style="position:absolute" 属性的元素类型上指定了此属性。The style="position:absolute" attribute is specified on an element type that does not support it. 仅属于页面正文直接子级的 divimg、和 object 元素支持定位。Only div, img, and object elements that are direct children of the page body support positioning. 请参阅创建绝对定位的元素See Create absolute positioned elements.

2014920149

您的请求指定的目标元素找不到。Your request specifies a target element that cannot be found.

2015020150

请求对此身份验证类型无效。The request is not valid for this authentication type. 请改用 ../me/onenote/ 路径。Use the ../me/onenote/ path instead.

2015120151

请求对此身份验证类型无效。The request is not valid for this authentication type. 请使用 ../me/onenote/section/{id}/pages 终结点在特定分区中创建页面。Use the ../me/onenote/section/{id}/pages endpoint to create a page in a specific section.

2015220152

没有为实体指定任何 name 值。必须定义名称,并且其中不能仅包含空格。There is no name value specified for the entity. The name must be defined, and it cannot contain whitespaces only.

2015320153

实体名称包含无效字符。The entity name contains invalid characters. 名称中不能包含下列字符:? * \ / : < > | & # " % ~The name cannot contain the following characters: ? * \ / : < > | & # " % ~

2015420154

实体名称不能以空格开头。The entity name cannot start with a space.

2015520155

实体名称太长。The entity name is too long. 笔记本名称的字符数限制为 128 个。Notebook names have a 128-character limit. 其他实体名称的字符数限制为 50 个。Other entity names have a 50-character limit.

2015620156

目标资源的指定 ID 不存在。The specified ID for the destination resource does not exist.

2015720157

目标实体的指定 ID 无效。The specified ID for the destination entity is invalid.

2015820158

无法获取请求中指定的网站 URL 的元数据。Unable to get metadata for the site URL specified in the request. 请检查所提供的 URL 的格式。Check the format of the supplied URL. 支持的格式包括 https://domain.sharepoint.com/site-ahttps://domain.com/sites/site-aSupported formats include https://domain.sharepoint.com/site-a and https://domain.com/sites/site-a.

2016020160

找不到具有指定 ID 的 Office 365 统一组。Unable to find an Office 365 unified group that has the specified ID.

2016120161

此上下文没有指定有效的用户 ID。The context does not specify a valid user ID. 一个常见错误是 PUID/CID 作为 long 而不是作为 hex 传入。One common error is that PUID/CID was passed in as a long instead of a hex.

2016620166

应用程序在短时间内以用户身份发出的请求过多。The application has issued too many requests on behalf of a user in a short period of time. 当 API 检测到应用程序使用的资源过多时,它会返回 429 状态代码和此错误,以帮助确保 OneNote API 保持稳定和可响应状态。To help ensure that the OneNote API remains stable and responsive, the API returns a 429 status code and this error when it detects that an application is using too many resources.

有关详细信息,请参阅 Microsoft Graph 服务特定限制指南For more information, see Microsoft Graph service-specific throttling guidance.

2016820168

请求中指定的视频源不受支持。The video source specified in the request is not supported. 请参阅支持的视频网站获取最新列表。See Supported video sites for the current list.

从 30001 到 39999 的代码Codes from 30001 to 39999

用户的帐户有问题。Something is wrong with the user's account.

3010130101

用户帐户超出了它的 OneDrive 配额。The user account has exceeded its OneDrive quota. 请参阅 OneDriveSee OneDrive.

3010230102

不能再向请求的节添加任何内容,因为它已经达到其最大大小。Nothing more can be added to the requested section because it has reached its maximum size.

3010330103

此请求的资源消耗过高。Resource consumption is too high for the request. 目标用户帐户的数据集过大或服务将过多数量的并发请求接收到同一个网站(例如,用户的个人网站或团队网站)。Either the target user account has a large dataset, or the service is receiving a high number of concurrent requests to the same site (for example, the user's personal site or a team site).

3010430104

用户帐户已被挂起。The user account has been suspended.

3010530105

未设置用户的个人 OneDrive for Business 网站,需要设置该网站才能访问笔记本。The user's personal OneDrive for Business site is not provisioned, which is required to access notebooks. OneNote 服务将立即设置此网站。The OneNote service will provision the site now. 此进程可能需要几分钟。This process may take several minutes.

3010630106

正在为用户设置 OneDrive for Business。OneDrive for Business is being provisioned for the user.

3010830108

无法检索用户的个人 OneDrive for Business。The user's personal OneDrive for Business could not be retrieved. 下表列出了部分可能的原因。The following table lists some possible causes.

原因Cause 解决方案Resolution
尚未设置用户的个人网站。The user's personal site has not been provisioned. 用户应打开 OneDrive for Business,并按照任意说明设置此网站。The user should open OneDrive for Business and follow any instructions to provision the site. 如果此操作失败,则应联系其 Microsoft 365 租户管理员。If this fails, they should contact their Microsoft 365 tenant administrator.
当前正在设置用户的个人网站。The user's personal site is currently being provisioned. 稍后再尝试请求。Try the request later.
用户没有有效的 OneDrive for Business 许可证。The user does not have a valid OneDrive for Business license. 用户应联系其 Microsoft 365 租户管理员。The user should contact their Microsoft 365 tenant administrator.
网络问题使请求无法成功发送。A network issue prevented the request from being successfully sent. 稍后再尝试请求。Try the request later.

3010930109

请求中的某些用户不存在。Some users in the request do not exist.

3011030110

此租户尚未注册学生信息服务。Student Information Services has not been registered for this tenant.

3011130111

学生信息服务出现一般性错误。There is a generic error with Student Information Services.

3011230112

受请求影响的多个用户具有相同的用户名。Multiple users affected by the request had the same username.

3011330113

笔记本未配置为允许邀请。The notebook is not configured to allow invites.

3011430114

缺少必需的参数。There is a required parameter missing.

从 40001 到 49999 的代码Codes from 40001 to 49999

用户或应用程序没有正确的权限。The user or application does not have the correct permissions.

4000140001

请求不包含有效的 OAuth 标记。The request doesn't contain a valid OAuth token. 请参阅注释权限See Notes permissions.

4000240002

用户在所请求的位置没有写入权限。The user doesn't have permission to write to the requested location.

4000340003

用户没有权限访问所请求的资源。The user doesn't have permission to access the requested resource.

4000440004

OAuth 令牌没有所需的作用域来执行所请求的操作。The OAuth token doesn't have the required scopes to perform the requested action. 请参阅注释权限See Notes permissions.

4000640006

OAuth 令牌没有所需的作用域来执行所请求的操作。The OAuth token doesn't have the required scopes to perform the requested action. 尤其是编辑权限。Specifically the edit permission. 请参阅注释权限See Notes permissions.

4000740007

用户没有权限访问此资源。The user does not have permissions to access this resource.

4000840008

禁止访问此资源。Access is Forbidden for this resource.

4000940009

容器已被其他资源使用。The container is already in use by another resource.

另请参阅See also