GET /v1/proofing/availabledictionaries
GET https://api.reporting.cloud/v1/proofing/availabledictionaries
Description
Returns the names of the dictionaries of the spell checker, such as en_US.dic. Every name can be passed as the language of GET /v1/proofing/check and GET /v1/proofing/suggestions. en_US_OpenMedSpel.dic (medical terms) and en_US_Legal.txd (legal terms) are supplementary word lists, not complete dictionaries: a check with one of them reports common words such as "the" as misspelled. This method doesn't count against the spell checking quota.
Examples
Request:
curl username:password \
GET "https://api.reporting.cloud/v1/proofing/availabledictionaries"
Results:
[
"af_ZA.dic", "an_ES.dic", "ar.dic", "be_BY.dic", "bg_BG.dic", "br_FR.dic", "ca.dic",
"cs_CZ.dic", "da_DK.dic", "de_AT_frami.dic", "de_CH_frami.dic", "de_DE_frami.dic", "el_GR.dic", "en_AU.dic",
"en_CA.dic", "en_GB.dic", "en_US.dic", "en_US_OpenMedSpel.dic", "en_ZA.dic", "es_ES.dic", "et_EE.dic",
"fa.dic", "fr.dic", "gd_GB.dic", "gl_ES.dic", "he_IL.dic", "hr_HR.dic", "hy_AM.dic",
"it_IT.dic", "ku_TR.dic", "lt_LT.dic", "nb_NO.dic", "nl_NL.dic", "nn_NO.dic", "oc_FR.dic",
"pl_PL.dic", "pt_BR.dic", "pt_PT.dic", "ro_RO.dic", "ru_RU.dic", "sh.dic", "sk_SK.dic",
"sl_SI.dic", "sr.dic", "sv_SE.dic", "uk_UA.dic", "ur.dic", "vi_VN.dic", "en_US_Legal.txd"
]
Request:
using System;
using TXTextControl.ReportingCloud;
class RCSamples
{
public static void GetAvailableDictionaries()
{
ReportingCloud rc = new ReportingCloud(
"username",
"password",
new Uri("https://api.reporting.cloud"));
string[] dictionaries = rc.GetAvailableDictionaries();
Console.WriteLine(dictionaries.Length + " dictionaries: " + string.Join(", ", dictionaries));
}
}
Results:
49 dictionaries: af_ZA.dic, an_ES.dic, ar.dic, be_BY.dic, bg_BG.dic, br_FR.dic, ca.dic, cs_CZ.dic, da_DK.dic, de_AT_frami.dic, de_CH_frami.dic, de_DE_frami.dic, el_GR.dic, en_AU.dic, en_CA.dic, en_GB.dic, en_US.dic, en_US_OpenMedSpel.dic, en_ZA.dic, es_ES.dic, et_EE.dic, fa.dic, fr.dic, gd_GB.dic, gl_ES.dic, he_IL.dic, hr_HR.dic, hy_AM.dic, it_IT.dic, ku_TR.dic, lt_LT.dic, nb_NO.dic, nl_NL.dic, nn_NO.dic, oc_FR.dic, pl_PL.dic, pt_BR.dic, pt_PT.dic, ro_RO.dic, ru_RU.dic, sh.dic, sk_SK.dic, sl_SI.dic, sr.dic, sv_SE.dic, uk_UA.dic, ur.dic, vi_VN.dic, en_US_Legal.txd
Request:
import com.textcontrol.reportingcloud.ReportingCloud;
import java.io.IOException;
import java.util.List;
public class ReportingCloudSample {
public static void main(String[] args) throws IOException {
ReportingCloud r = new ReportingCloud("username", "password");
List<String> dictionaries = r.getAvailableDictionaries();
System.out.println(dictionaries.size() + " dictionaries: " + String.join(", ", dictionaries));
}
}
Results:
49 dictionaries: af_ZA.dic, an_ES.dic, ar.dic, be_BY.dic, bg_BG.dic, br_FR.dic, ca.dic, cs_CZ.dic, da_DK.dic, de_AT_frami.dic, de_CH_frami.dic, de_DE_frami.dic, el_GR.dic, en_AU.dic, en_CA.dic, en_GB.dic, en_US.dic, en_US_OpenMedSpel.dic, en_ZA.dic, es_ES.dic, et_EE.dic, fa.dic, fr.dic, gd_GB.dic, gl_ES.dic, he_IL.dic, hr_HR.dic, hy_AM.dic, it_IT.dic, ku_TR.dic, lt_LT.dic, nb_NO.dic, nl_NL.dic, nn_NO.dic, oc_FR.dic, pl_PL.dic, pt_BR.dic, pt_PT.dic, ro_RO.dic, ru_RU.dic, sh.dic, sk_SK.dic, sl_SI.dic, sr.dic, sv_SE.dic, uk_UA.dic, ur.dic, vi_VN.dic, en_US_Legal.txd
Request:
#!/usr/bin/env ruby
require "txtextcontrol/reportingcloud"
reporting_cloud = TXTextControl::ReportingCloud::ReportingCloud.new("username", "password")
dictionaries = reporting_cloud.get_available_dictionaries
puts "#{dictionaries.length} dictionaries: #{dictionaries.join(", ")}"
Results:
49 dictionaries: af_ZA.dic, an_ES.dic, ar.dic, be_BY.dic, bg_BG.dic, br_FR.dic, ca.dic, cs_CZ.dic, da_DK.dic, de_AT_frami.dic, de_CH_frami.dic, de_DE_frami.dic, el_GR.dic, en_AU.dic, en_CA.dic, en_GB.dic, en_US.dic, en_US_OpenMedSpel.dic, en_ZA.dic, es_ES.dic, et_EE.dic, fa.dic, fr.dic, gd_GB.dic, gl_ES.dic, he_IL.dic, hr_HR.dic, hy_AM.dic, it_IT.dic, ku_TR.dic, lt_LT.dic, nb_NO.dic, nl_NL.dic, nn_NO.dic, oc_FR.dic, pl_PL.dic, pt_BR.dic, pt_PT.dic, ro_RO.dic, ru_RU.dic, sh.dic, sk_SK.dic, sl_SI.dic, sr.dic, sv_SE.dic, uk_UA.dic, ur.dic, vi_VN.dic, en_US_Legal.txd
Request:
require_once __DIR__ . '/vendor/autoload.php';
use TextControl\ReportingCloud\ReportingCloud;
$reportingCloud = new ReportingCloud([
'api_key' => (string) getenv('REPORTINGCLOUD_API_KEY'),
]);
var_dump($reportingCloud->getAvailableDictionaries());
Results:
array(49) {
[0]=>
string(9) "af_ZA.dic"
[1]=>
string(9) "an_ES.dic"
[2]=>
string(6) "ar.dic"
[3]=>
string(9) "be_BY.dic"
[4]=>
string(9) "bg_BG.dic"
[5]=>
string(9) "br_FR.dic"
[6]=>
string(6) "ca.dic"
[7]=>
string(9) "cs_CZ.dic"
[8]=>
string(9) "da_DK.dic"
[9]=>
string(15) "de_AT_frami.dic"
[10]=>
string(15) "de_CH_frami.dic"
[11]=>
string(15) "de_DE_frami.dic"
[12]=>
string(9) "el_GR.dic"
[13]=>
string(9) "en_AU.dic"
[14]=>
string(9) "en_CA.dic"
[15]=>
string(9) "en_GB.dic"
[16]=>
string(9) "en_US.dic"
[17]=>
string(21) "en_US_OpenMedSpel.dic"
[18]=>
string(9) "en_ZA.dic"
[19]=>
string(9) "es_ES.dic"
[20]=>
string(9) "et_EE.dic"
[21]=>
string(6) "fa.dic"
[22]=>
string(6) "fr.dic"
[23]=>
string(9) "gd_GB.dic"
[24]=>
string(9) "gl_ES.dic"
[25]=>
string(9) "he_IL.dic"
[26]=>
string(9) "hr_HR.dic"
[27]=>
string(9) "hy_AM.dic"
[28]=>
string(9) "it_IT.dic"
[29]=>
string(9) "ku_TR.dic"
[30]=>
string(9) "lt_LT.dic"
[31]=>
string(9) "nb_NO.dic"
[32]=>
string(9) "nl_NL.dic"
[33]=>
string(9) "nn_NO.dic"
[34]=>
string(9) "oc_FR.dic"
[35]=>
string(9) "pl_PL.dic"
[36]=>
string(9) "pt_BR.dic"
[37]=>
string(9) "pt_PT.dic"
[38]=>
string(9) "ro_RO.dic"
[39]=>
string(9) "ru_RU.dic"
[40]=>
string(6) "sh.dic"
[41]=>
string(9) "sk_SK.dic"
[42]=>
string(9) "sl_SI.dic"
[43]=>
string(6) "sr.dic"
[44]=>
string(9) "sv_SE.dic"
[45]=>
string(9) "uk_UA.dic"
[46]=>
string(6) "ur.dic"
[47]=>
string(9) "vi_VN.dic"
[48]=>
string(15) "en_US_Legal.txd"
}
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 field | Description |
|---|---|
| Authorization | Required. 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 field | Description |
|---|---|
| Authorization | Required. 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 |
Success Response
| Status | Description |
|---|---|
| 200 | On success, the HTTP status code in the response header is 200 (OK). The response body contains an array of strings with dictionary names. |
Error Response
| Status | Description |
|---|---|
| 403 | A 403 (Forbidden) is returned, if the user is not authorized. |
| 405 | A 405 (Method Not Allowed) is returned, if the request uses another HTTP method than GET. The Allow header of the response names GET. |
| 500 | A 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. |