OpenAdvocate WriteClearly
Developer Documentation
WriteClearly provides an API interface that can be used by third-partyapplications to submit text to WriteClearly for analysis. This document describes how to use the WriteClearly API.
Making Requests
Example:
{
"content" : "Hello world",
"json" : 1
} Response:
The response JSON object contains the following attributes:
Example:
{
"index": 7.43,
"suggestions": [
{
"summary": "Replace polysyllabic words where possible.",
"content": "Bankruptcy is usually
<span class="wc-poly-container">
<span class="wc-hinted" data-word="considered">considered</span>
<span class="wc-hint wc-synonym">
Synonyms:
<span class="wc-replace-word">knowing</span>,
<span class="wc-replace-word">studied</span>,
<span class="wc-replace-word">thoughtful</span>
</span>
</span>
a last resort option.",
"paragraph_id": "oawc-p-1"
}
]
} If present, <p> HTML tags in the source text will help WriteClearly identify paragraphs. The <p> tags may contain the class “oawc-p-[id]”, where [id] is
arbitrary number. When this class is found, the response will contain this
identifier in the returned response. Otherwise, the paragraph_id attribute
will be empty.
The sentence in the “content” attribute is marked up with HTML. Each word in the original sentence that has a corresponding suggestion is wrapped in a element with the “wc-hinted” class. This may be used in CSS styles to highlight the word. In addition, polysyllabic words for which synonyms are offered are wrapped in a element with the “wc-poly-container” class. This element will wrap the word to which the suggestion belongs, as well as a list of suggested synonyms enclosed in a element with the “wc-hint” class. These will need to be styled to appear consistently with your site’s theme. If you do not wish to show them, apply a CSS rule that hides elements with the “wc-hint” class.
