Check Luganda grammar and spelling
POST
/v1/text/grammar
const url = 'https://api.openkob.com/v1/text/grammar';const options = { method: 'POST', headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'}, body: '{"input":"Oli otya otya ?","disabled_rules":["G_REPEATED_WORD"],"ng_style":"ng\'"}'};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}curl --request POST \ --url https://api.openkob.com/v1/text/grammar \ --header 'Authorization: Bearer <token>' \ --header 'Content-Type: application/json' \ --data '{ "input": "Oli otya otya ?", "disabled_rules": [ "G_REPEATED_WORD" ], "ng_style": "ng'\''" }'Authorizations
Section titled “Authorizations”Request Bodyrequired
Section titled “Request Bodyrequired”Media typeapplication/json
object
input
required
string
Example
Oli otya otya ?disabled_rules
Array<string>
Example
[ "G_REPEATED_WORD"]ng_style
Preferred spelling of the velar nasal. Defaults to ng’.
string
Responses
Section titled “Responses”Issues found
Media typeapplication/json
object
object
required
string
issues
required
Array<object>
object
rule_id
required
string
offset
required
Start of the issue in UTF-16 code units (JavaScript string index).
integer
length
required
Length in UTF-16 code units.
integer
severity
required
string
message
required
string
replacements
required
Array<string>
Example
{ "object": "grammar.check", "issues": [ { "rule_id": "G_REPEATED_WORD", "offset": 8, "length": 5, "severity": "error", "message": "Repeated word. Remove it if it's unintended.", "replacements": [ "" ] } ]}Invalid request
Media typeapplication/json
object
error
required
object
type
required
string
code
required
string
message
required
string
param
string
request_id
required
string
Example
{ "error": { "type": "invalid_request_error", "code": "input_too_long", "message": "input exceeds 5000 characters", "param": "input", "request_id": "req_9f8e7d6c5b4a3f2e1d0c" }}Missing, invalid, revoked or expired API key
Media typeapplication/json
object
error
required
object
type
required
string
code
required
string
message
required
string
param
string
request_id
required
string
Example
{ "error": { "type": "invalid_request_error", "code": "input_too_long", "message": "input exceeds 5000 characters", "param": "input", "request_id": "req_9f8e7d6c5b4a3f2e1d0c" }}Rate limit exceeded
Media typeapplication/json
object
error
required
object
type
required
string
code
required
string
message
required
string
param
string
request_id
required
string
Example
{ "error": { "type": "invalid_request_error", "code": "input_too_long", "message": "input exceeds 5000 characters", "param": "input", "request_id": "req_9f8e7d6c5b4a3f2e1d0c" }}Internal error
Media typeapplication/json
object
error
required
object
type
required
string
code
required
string
message
required
string
param
string
request_id
required
string
Example
{ "error": { "type": "invalid_request_error", "code": "input_too_long", "message": "input exceeds 5000 characters", "param": "input", "request_id": "req_9f8e7d6c5b4a3f2e1d0c" }}
