This repository was archived by the owner on Feb 19, 2020. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
API documentation
anroots edited this page Feb 10, 2012
·
9 revisions
This is the API documentation for Inspire, version 1.2.
Inspire is a RESTful API-centric application, meaning you can do most anything with well crafted API requests.
Currently, 2 main operations are supported: getting and inserting words. Requests should go to the base URL (http://i.jaa.ee), followed by controller/action/id params, separated by slashes. The ID is an optional param and can be either numeric or textual. The API responds with JSON and always includes the following keys:
status – a numerical status code (see the Commoneer module). 200 means OK.
response – Contains meaningful info, depending on the request. for word/inspire, response contains the random word.
The following table explains how to communicate with the API.
| Controller | Action | ID | Method | Params | Example | Description |
| word | inspire | category_id | GET | use_dictionary (optional) int Default: 0 Use dictionary instead of the internal database |
http://i.jaa.ee/word/inspire/2 http://i.jaa.ee/word/inspire/2?use_dictionary=1 |
Get a random word, optionally restricted by category ID. |
| word | add | None | POST |
language_id (optional) int – The ID of the language the word belongs to category_id int – Category ID string string – The word (or sentence |
- | Add a new word to the database |