API reference
Reference for the MojiCare public API. Moderation is a single endpoint, so you can integrate it as soon as you have an API key.
Quickstart
Issue an API key, then send a single request. Pick your language.
- 1.
Issue an API key
Create one under "API keys" in the dashboard. The key is shown only once, right after you create it.
- 2.
Send it in the Authorization header
Use the format below. The x's stand in for the key you created.
Authorization: Bearer mc_live_xxxxx - 3.
Call the moderation endpoint
POST the text you want to check as text. Here is what comes back.
curl -X POST https://api.moji-care.com/v1/moderations \
-H "Authorization: Bearer $MOJICARE_API_KEY" \
-H "Content-Type: application/json" \
-d '{"text":"これはうんこです"}'Response (200)
{
"id": "mod_9f8a7b6c5d4e",
"flagged": true,
"masked": "これは***です",
"matches": [
"うんこ"
],
"usage": {
"chars": 8
}
}- Detected
- うんこ
- Masked
- これは***です
segments (the positions of each match) is left out to keep the example short. See the reference below for the full shape.
MOJICARE_API_KEY in the samples is a server-side environment variable. Never hard-code the key itself.
Endpoints
Requests, responses and error codes. The definition file for code generation: OpenAPI 3.1 (JSON)
openapi.en.json
Loading…