/v1/proofing/suggestions/
https://api.reporting.cloud/v1/proofing/suggestions
Returns suggestions for a misspelled word.
This method counts against the spell checking quota. For each request, the quota count is increased by 1.
Authorization
This endpoint requires a "ReportingCloud-APIKey" or a "Basic" user authorization to access the user acount, data and templates. Only one of these two methods are required.
ReportingCloud-APIKey
Header field | Description |
---|---|
Authorization |
Required. A valid ReportingCloud account is required. The Authorization field is constructed as follows: An API Key needs to be generated using the portal or /v1/account/apikey endpoint. The authorization method and a space i.e. "ReportingCloud-APIKey " is then put before the actual API Key string. Sample: Authorization: ReportingCloud-APIKey oMDM4MrAqL9QEOpyzupnQW5NjvCNtvE5cVDaaLqxI |
Basic
Header field | Description |
---|---|
Authorization |
Required. A valid ReportingCloud account is required. The Authorization field is constructed as follows: The username and password are combined into a string separated by a colon, e.g.: 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 i.e. "Basic " is then put before the encoded string. Sample: Authorization: Basic QWxhZGRpbjpPcGVuU2VzYW1l |
Request Parameters
Query Parameter | Value Type | Description |
---|---|---|
word | String | Specifies the incorrect word that has to be determined for suggestions. |
language | String | The language that is used to spell check the specified text. |
max | Integer | Specifies the maximum number of suggestions that has to be determined. |
Success Response
Return Value | Description |
---|---|
200 (OK) |
On success, the HTTP status code in the response header is 200 (OK). The response body contains an array of strings with suggestions. |
Error Response
Return Value | Description |
---|---|
403 (Forbidden) |
A 403 (Forbidden) is returned, if the user is not authorized or the proofing quota is exceeded. |
Sample Requests
Request:
curl -u username:password \ | |
-X GET "https://api.reporting.cloud/v1/proofing/suggestions?word=Thiss&language=en_US.dic&max=10 |
Results:
["This","Hiss","Thesis","Thins","Thurs","Thirsts","Thieu","Thirds","Theists","Thais"] |
Request:
ReportingCloud rc = new ReportingCloud("username", "password"); | |
string[] saSuggestions = rc.GetSuggestions("dooper", rc.GetAvailableDictionaries()[0], 10); |
Request:
<?php | |
use TxTextControl\ReportingCloud\Console\Helper; | |
use TxTextControl\ReportingCloud\ReportingCloud; | |
$reportingCloud = new ReportingCloud([ | |
'api_key' => Helper::apiKey(), | |
]); | |
var_dump($reportingCloud->getProofingSuggestions('Thiss', 'en_US.dic', 10)); |
Results:
array(10) { | |
[0] => | |
string(4) "This" | |
[1] => | |
string(4) "Hiss" | |
[2] => | |
string(6) "Thesis" | |
[3] => | |
string(5) "Thins" | |
[4] => | |
string(5) "Thurs" | |
[5] => | |
string(7) "Thirsts" | |
[6] => | |
string(5) "Thieu" | |
[7] => | |
string(6) "Thirds" | |
[8] => | |
string(7) "Theists" | |
[9] => | |
string(5) "Thais" | |
} |