ReportingCloud

GET /v1/proofing/check

Endpoint

GET https://api.reporting.cloud/v1/proofing/check

Description

Checks a text for spelling errors with a dictionary and returns the misspelled words, and repeated words such as "the the", each with its position in the text. A text without errors returns an empty array. The names of the dictionaries come from GET /v1/proofing/availabledictionaries. See Spell Checking.

Warning

Spell Checking Quota. Each successful request counts 1 against the spell checking quota. It counts 1 also when the text has several misspelled words. Plans and Licensing lists the quota of each plan.

Examples

Request:

curl -u username:password \
  -X GET "https://api.reporting.cloud/v1/proofing/check?text=Thiss%20is%20a%20testt&language=en_US.dic"

Results:

[{"length":5,"start":0,"text":"Thiss","isDuplicate":false,"language":"en_US.dic"},
{"length":5,"start":11,"text":"testt","isDuplicate":false,"language":"en_US.dic"}]

Authorization

This endpoint requires a "ReportingCloud-APIKey" or a "Basic" user authorization to access the user account, data and templates. Only one of these two methods is required.

API Keys describes how to create an API key, and Authentication explains both header forms.

ReportingCloud-APIKey

Header fieldDescription
AuthorizationRequired. A valid ReportingCloud account is required. The Authorization field is constructed as follows: An API key needs to be generated in the portal or with PUT /v1/account/apikey. The authorization method and a space, "ReportingCloud-APIKey ", is then put before the actual API key string. For example: Authorization: ReportingCloud-APIKey oMDM4MrAqL9QEOpyzupnQW5NjvCNtvE5cVDaaLqxI

Basic

Header fieldDescription
AuthorizationRequired. A valid ReportingCloud account is required. The Authorization field is constructed as follows: The user name and password are combined into a string separated by a colon, for example username:password. The resulting string is encoded using the RFC2045-MIME variant of Base64, except not limited to 76 char/line. The authorization method and a space, "Basic ", is then put before the encoded string. For example: Authorization: Basic QWxhZGRpbjpPcGVuU2VzYW1l

Request Parameters

NameTypeValueOptional
textStringSpecifies the text to spell check. A text that is empty or holds only spaces answers 400. The query string may have at most 2,048 characters, URL-encoded, so a longer text answers 404 and has to be checked in parts.no
languageStringThe dictionary that is used to spell check the specified text: one of the names that /v1/proofing/availabledictionaries returns, such as en_US.dic, matched case-sensitively. Another value answers 400.no

Success Response

StatusDescription
200On success, the HTTP status code in the response header is 200 (OK). The response body contains an array of IncorrectWord objects, one for each misspelled word and each repeated word, in the order of the text. A text without either returns an empty array.

IncorrectWord

NameTypeValueOptional
lengthIntegerGets the length of the word, in UTF-16 code units.no
startIntegerGets the position of the word's first character in the text, counted from 0 in UTF-16 code units: a character such as an emoji counts 2.no
textStringGets the text of the spelled word.no
isDuplicateBooleanGets a value indicating whether the word is returned because the word before it has the same text, compared without regard to case, as in "The the". Such a word is spelled correctly; a repetition across the end of a sentence isn't returned, and a misspelled word that is repeated is returned each time, with false.no
languageStringGets the dictionary the word was checked with: the language of the request, such as en_US.dic.no

Error Response

StatusDescription
400A 400 (Bad Request) with the plain text "Spell checking failed" is returned, if the text is empty or holds only spaces, or if the language is empty or not the name of an available dictionary.
403A 403 (Forbidden) is returned, if the user is not authorized or the spell checking quota is exceeded.
404A 404 (Not Found) is returned, if a required query parameter is missing or the query string is longer than 2,048 characters.
405A 405 (Method Not Allowed) is returned, if the request uses another HTTP method than GET. The Allow header of the response names GET.
500A 500 (Internal Server Error) is returned, if the request has no Authorization header, an empty one or one that is not the authorization method, a space and the credentials.