-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathmemo-api.txt
More file actions
166 lines (121 loc) · 3.1 KB
/
memo-api.txt
File metadata and controls
166 lines (121 loc) · 3.1 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
GET /books/{id} - Get Book
resp:
{
"title": "Book Title",
"id": "com.bitmark.book.7657",
"bitTree": [...],
...
}
GET /books/{id}/bits - Get Bits of a Book
GET /books/subjects?lang=de
resp:
{
"subjects": [
{
"id": "64332",
"subject": "Englisch"
},
{
"id": "64333",
"subject": "Deutsch als Fremdsprache"
},
{
"id": "64334",
"subject": "Deutsch"
},
{
"id": "64335",
"subject": "Management"
}
]
}
GET /books/types?lang=en
resp:
{
"types": [
{
"id": "987982374",
"type": "Integrated Course and Work Book",
},
{
"id": "987982224",
"type": "Course book",
},
{
"id": "987982211",
"type": "Work book",
},
]
}
# Find data by partial text (search key)
GET /books?q=Dolphins
GET /bits?q=Dolphins&type=cloze
GET /books/3/bits?q=Elephants
GET /bits?q=Dolphins&l=en&t=cloze&r=video&f=bitmark--
#######
# POST/PUT
#######
POST create a book.
POST /books/
POST data e.g.
{
"title": "Compilerdesign in C",
"id": "com.bitmark.book.92387982374893434",
"bitTree": [],
...
}
PUT /books/ - Update Book
DELETE /books/ - Delete Book
GET /bits/{id} - Get Bit
resp e.g.:
{
"bitmark": "[.multiple-choice-text][+Ich][-Du] würde gerne einen [-Kuchen][+Kaffee][?A hot drink (caffeinated)] bestellen. [+Ich mir][+Wir uns] auch.",
"bit": {
"type": "multiple-choice-text",
...
},
...
POST /bits - Create Bit from bitmark
Create a bitmark.json Bit from bitmark
PUT /bits - Update Bit
Update a bitmark.json Bit.
DELETE /bits - Delete Bit
Delete a bitmark.json Bit.
# Publisher
GET /publishers/{id} - Publisher Details
GET /publishers/{id}/books - Books by Publisher
===========================================
# Client API
## Info, TOC and Chapters
You can request a full bitmark.json Book or a part of it (chapter, sub-chapter, ...).
/books/3/info
/books/3/toc
/books/3/glossary
/books/3/index
/books/3/media-index
/books/3/chapters/3
/books/3/chapters/3/2/1
/books/3/chapters?id=...
/books/3/chapters?anchor=...
## Resources
You can get a list of all resources (images, audio files, video, ...) of a book or a chapter. Use this for offline reading or caching.
/books/3/resources
/books/3/chapters/4/2/resources
Full Text Search and Filter
Full text search and filters work for Books and Bits.
## Request
GET /books?q=Dolphins
GET /bits?q=Dolphins&type=cloze
GET /books/3/bits?q=Elephants
GET /bits?q=Dolphins&l=en&t=cloze&r=video&f=bitmark--
If database----
-------------------------------------------------------------------------
As there would be multiple books in the database...
@ we have static info table.
Publisher, System, Color setting,
@ we have BOOKS table:
seq, timestamp, bookID, bookTitle, subtitle, subject, seriesTitle, format, type, bitmark
@ and we have CHAPTER table
seq, timestamp, bookID, chapterID, title, level, toc, progress... maybe more
@and we will have BITS table
seqNumber, timestamp, bookID, bitID, bitType, bitmark,