Skip to content

Latest commit

 

History

History
308 lines (287 loc) · 7.08 KB

File metadata and controls

308 lines (287 loc) · 7.08 KB
title info
sidebarTitle info
description Return document summary info including word, character, paragraph, heading, table, image, comment, tracked-change, SDT-field, list, and page counts, plus outline and capabilities.

{/* GENERATED FILE: DO NOT EDIT. Regenerate via pnpm run docapi:sync. */}

Summary

Return document summary info including word, character, paragraph, heading, table, image, comment, tracked-change, SDT-field, list, and page counts, plus outline and capabilities.

  • Operation ID: info
  • API member path: editor.doc.info(...)
  • Mutates document: no
  • Idempotency: idempotent
  • Supports tracked mode: no
  • Supports dry run: no
  • Deterministic target resolution: yes

Expected result

Returns a DocumentInfo object with counts (words, characters, paragraphs, headings, tables, images, comments, trackedChanges, sdtFields, lists, and optionally pages when pagination is active), document outline, capability flags, and revision.

Input fields

No fields.

Example request

{}

Output fields

Field Type Required Description
capabilities object yes
capabilities.canComment boolean yes
capabilities.canFind boolean yes
capabilities.canGetNode boolean yes
capabilities.canReplace boolean yes
counts object yes
counts.characters integer yes
counts.comments integer yes
counts.headings integer yes
counts.images integer yes
counts.lists integer yes
counts.pages integer no
counts.paragraphs integer yes
counts.sdtFields integer yes
counts.tables integer yes
counts.trackedChanges integer yes
counts.words integer yes
defaults object no
defaults.fontFamily string no
defaults.fontSize number no
defaults.styleId string no
outline object[] yes
revision string yes
styles object no
styles.paragraphStyles object[] no

Example response

{
  "capabilities": {
    "canComment": true,
    "canFind": true,
    "canGetNode": true,
    "canReplace": true
  },
  "counts": {
    "characters": 1,
    "comments": 0,
    "headings": 3,
    "images": 2,
    "lists": 1,
    "pages": 1,
    "paragraphs": 12,
    "sdtFields": 1,
    "tables": 1,
    "trackedChanges": 1,
    "words": 250
  },
  "defaults": {
    "fontFamily": "example",
    "fontSize": 12.5
  },
  "outline": [
    {
      "level": 1,
      "nodeId": "node-def456",
      "text": "Hello, world."
    }
  ],
  "revision": "example",
  "styles": {
    "paragraphStyles": [
      {
        "count": 1,
        "fontFamily": "example",
        "fontSize": 12.5,
        "styleId": "style-001"
      }
    ]
  }
}

Pre-apply throws

  • None

Non-applied failure codes

  • None

Raw schemas

```json { "additionalProperties": false, "properties": {}, "type": "object" } ``` ```json { "additionalProperties": false, "properties": { "capabilities": { "additionalProperties": false, "properties": { "canComment": { "type": "boolean" }, "canFind": { "type": "boolean" }, "canGetNode": { "type": "boolean" }, "canReplace": { "type": "boolean" } }, "required": [ "canFind", "canGetNode", "canComment", "canReplace" ], "type": "object" }, "counts": { "additionalProperties": false, "properties": { "characters": { "type": "integer" }, "comments": { "type": "integer" }, "headings": { "type": "integer" }, "images": { "type": "integer" }, "lists": { "type": "integer" }, "pages": { "type": "integer" }, "paragraphs": { "type": "integer" }, "sdtFields": { "type": "integer" }, "tables": { "type": "integer" }, "trackedChanges": { "type": "integer" }, "words": { "type": "integer" } }, "required": [ "words", "characters", "paragraphs", "headings", "tables", "images", "comments", "trackedChanges", "sdtFields", "lists" ], "type": "object" }, "defaults": { "additionalProperties": false, "description": "Document's default body text formatting. Use these values when creating new content to match existing style.", "properties": { "fontFamily": { "description": "Most common body text font family.", "type": "string" }, "fontSize": { "description": "Most common body text font size in half-points.", "type": "number" }, "styleId": { "description": "Most common body paragraph style ID.", "type": "string" } }, "type": "object" }, "outline": { "items": { "additionalProperties": false, "properties": { "level": { "type": "integer" }, "nodeId": { "type": "string" }, "text": { "type": "string" } }, "required": [ "level", "text", "nodeId" ], "type": "object" }, "type": "array" }, "revision": { "type": "string" }, "styles": { "additionalProperties": false, "description": "Styles currently in use in the document.", "properties": { "paragraphStyles": { "description": "Paragraph styles in use, sorted by frequency (most common first).", "items": { "additionalProperties": false, "properties": { "count": { "description": "Number of paragraphs using this style.", "type": "integer" }, "fontFamily": { "description": "Font family used by text in this style.", "type": "string" }, "fontSize": { "description": "Font size in half-points used by text in this style.", "type": "number" }, "styleId": { "description": "Style identifier (e.g. 'Normal', 'Heading1', 'BodyText').", "type": "string" } }, "required": [ "styleId", "count" ], "type": "object" }, "type": "array" } }, "required": [ "paragraphStyles" ], "type": "object" } }, "required": [ "counts", "outline", "capabilities", "revision" ], "type": "object" } ```