Vocab

The vocab route can be used to store vocabulary words. All string parameters can be entered in roman letters or furigana.

The accepted parameters are:

Parameter Notes Type Example
id A unique identifier for the vocab. Read-only. Increment 1
word The word, written in vocab if applicable string 美術館
pronunciation The pronunciation of the word if the word is written in kanji. string びじゅつかん
meaning The meaning of the word. string art museum
sentence An example of a sentence using that word. string 初めてその美術館に行った。
created_at A year-month-day hour-minute-second value showing when the information was created. Read-only. timestamp 2017-04-07 17:38:04
updated_at A year-month-day hour-minute-second value showing when the information was updated. Read-only. timestamp 2017-04-08 12:45:02

GET requests

To get all entries, point a GET request to:

http://localhost:8888/vocabs

To get a single entry, point a GET request to:

http://localhost:8888/vocabs/{id}

A successful response will look like:

{
"id": 1,
"word": "美術館",
"pronunciation": "びじゅつかん",
"meaning": "art museum",
"sentence": "初めてその美術館に行った。",
"created_at": "2017-04-07 17:57:48",
"updated_at": "2017-04-07 17:57:48"
}

POST requests

To post an entry, point a POST request to

http://localhost:8888/vocabs

A successful POST will return:

{
"created": true
}

Any parameter left blank will default to an empty string.

PUT requests

To update an entry, point a PUT request to

http://localhost:8888/vocabs/{id}

You may update as many or as few parameters as you'd like.

A successful PUT will return:

{
"updated": true
}

DELETE requests

To delete an entry, point a DELETE request to

http://localhost:8888/vocabs/{id}

A successful DELETE will return:

{
"deleted": true
}

results matching ""

    No results matching ""