Get Document Metrics
Purpose
To get the count of the characters, words, sentences, comments and tracked changes present in the document.
Quick Reference
| Property | Value |
|---|---|
| Method | GET |
| Request URL | https://{zohoapis_domain}/writer/api/v1/documents/{document_id}/metrics |
| Scopes | ZohoWriter.documentEditor.ALL, ZohoPC.files.ALL, WorkDrive.files.ALL, WorkDrive.organization.ALL, WorkDrive.workspace.ALL |
| Rate Limit | See Writer API throttle limits |
Parameters
Path Parameters
| Parameter | Data Type | Mandatory/Optional | Description |
|---|---|---|---|
| document_id | String | Mandatory | Specify 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
}
}