Get Document Metrics

Purpose

To get the count of the characters, words, sentences, comments and tracked changes present in the document.

Quick Reference

PropertyValue
MethodGET
Request URLhttps://{zohoapis_domain}/writer/api/v1/documents/{document_id}/metrics
ScopesZohoWriter.documentEditor.ALL, ZohoPC.files.ALL, WorkDrive.files.ALL, WorkDrive.organization.ALL, WorkDrive.workspace.ALL
Rate LimitSee Writer API throttle limits

Parameters

Path Parameters

ParameterData TypeMandatory/OptionalDescription
document_idStringMandatorySpecify the unique id for the Writer document.

Notes

  • This API is subject to throttle limits. For details on the applicable rate limits, please refer to this help link.
  • For possible errors, refer to error codes.

Sample Request

Copiedcurl -X GET "https://www.zohoapis.com/writer/api/v1/documents/{document_id}/metrics" \
  -H "Authorization: Zoho-oauthtoken <ACCESS_TOKEN>"
Copiedresponse = invokeurl
[
	url :"https://www.zohoapis.com/writer/api/v1/documents/{document_id}/metrics"
	type :GET
	connection:"<connection_name>"
];
info response;

Sample Response

Copied{
    "comments_metrics": {
        "all": 1,
        "unresolved": 0,
        "resolved": 1
    },
    "content_metrics": {
        "number_of_sentences": 31,
        "number_of_characters": 1817,
        "number_of_words": 263,
        "number_of_characters_without_whitespaces": 1557
    },
    "tracked_changes_metrics": {
        "all": 3,
        "insertions": 1,
         "deletions": 1,
         "replacements": 1,
         "fields_updated": 0
    }
}