-
Notifications
You must be signed in to change notification settings - Fork 0
/
API.txt
181 lines (139 loc) · 11.2 KB
/
API.txt
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
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
This explanation assumes a web application named "StringPool" and the path "sp" mapped to the servlet
OnnServlet servlet (/StringPool/sp):
GET (response content depends on action parameter):
action=admin (also as /StringPool/sp/admin): retrieve login form for the OnnServlet node administration HTML page (used in browser, not part of API)
action=nodes (also as /StringPool/sp/nodes): retrieve list of other OnnServlet nodes known to this one
additional parameters: none
response (MIME type text/xml, encoding UTF-8):
<nodes>
<node name="name of StringPool node" accessUrl="preferred access URL of node" />
<node ... />
</nodes>
action=ping (also as /StringPool/sp/ping): ping node
additional parameters: none
response (MIME type text/xml, encoding UTF-8):
<nodes />
action=name (also as /StringPool/sp/name): retrieve data of this OnnServlet node
additional parameters: none
response (MIME type text/xml, encoding UTF-8):
<nodes>
<node name=&qout;<name of OnnServlet node>&qout; accessUrl="preferred access URL of node" />
</nodes>
POST: requests from OnnServlet administration HTML page, or infrastructure replication:
/StringPool/sp/admin: process input from the OnnServlet node administration HTML page (used in browser, not part of API)
/StringPool/sp/nodes: retrieve list of other OnnServlet nodes known to this one
request body: none
response (MIME type text/xml, encoding UTF-8):
<nodes>
<node name="name of OnnServlet node" accessUrl="preferred access URL of node" />
<node ... />
</nodes>
/StringPool/sp/ping: ping node
request body: none
response (MIME type text/xml, encoding UTF-8):
<nodes />
/StringPool/sp/name: retrieve data of this OnnServlet node
request body: none
response (MIME type text/xml, encoding UTF-8):
<nodes>
<node name="name of OnnServlet node" accessUrl="preferred access URL of node" />
</nodes>
/StringPool/sp/introduce: introduce a new OnnServlet to this one, retrieve list of other known OnnServlet
request body (parameters):
name: the name of the OnnServlet introducing itself
accessUrl: the preferred access URL of the OnnServlet introducing itself
response (MIME type text/xml, encoding UTF-8):
<nodes>
<node name="name of OnnServlet node" accessUrl="preferred access URL of node" />
<node ... />
</nodes>
StringPoolServlet servlet (extends OnnServlet) (/StringPool/sp):
GET (response content depends on action parameter):
action=feed: retrieve the string update feed, ordered by increasing update time
additional parameters:
updatedSince: minimum update time for strings to include in the feed, formatted as UTC HTTP timestamp
response: compact feed of strings updated since the specified timestamp (MIME type text/xml, encoding UTF-8)
<stringSet>
<string id="string ID" canonicalId="ID of canonical string" deleted="deleted flag, true or false" createTime="UTC timestamp string was first added to StringPool" updateTime="UTC timestamp string was last updated" localUpdateTime="UTC timestamp string was last updated on this StringPool node" parseChecksum="MD5 hash of parsed version, if available" />
<string ... />
</stringSet>
action=rss: retrieve an RSS feed announcing recently added strings, ordered by decreasing upload time
additional parameters:
top: number of strings to include in the feed (defaults to 100 if not specified)
response: an RSS feed announcing the latest additions (MIME type application/rss+xml, encoding UTF-8)
action=count: retrieve the number of strings stored in the node
additional parameters:
since: the UTC timestamp since which to count the strings (optional, defaults to 0)
format: the format to represent the response (optional, defaults to the native XML representation if omitted)
response: the number of strings stored in the node (MIME type text/xml, encoding UTF-8)
<stringSet count="number of strings" since="argument since" />
action=get: resolve StringPool internal identifiers
additional parameters:
id: the identifier(s) to resolve, can be multi-valued
format: the format to represent the parsed versions of strings in (optional, defaults to the native XML representation if omitted)
response: the string(s) with the specified identifier(s) (MIME type text/xml, encoding UTF-8)
<stringSet>
<string id="string ID" canonicalId="ID of canonical string" deleted="deleted flag, true or false" createTime="UTC timestamp string was first added to StringPool" createUser="name of the user to first add string to StringPool" createDomain="name of StringPool node string was first added to" updateTime="UTC timestamp string was last updated" updateUser="name of the user to last update string" updateDomain="name of StringPool node string was last updated at">
<stringPlain><plain string></stringPlain>
<stringParsed><parsed version of string (if available), as XML or in format specified by format parameter></stringParsed>
</string>
<string>...</string>
</stringSet>
action=find: search strings
additional parameters:
query: full text query against strings, can be multi-valued
combine: or or and, controls if multiple full text queries are combined conjunctively (the default) or disjunctively
type: type of string, only finds string with parsed version available
user: contributing user
format=concise: exclude parsed version of strings from response
format: the name of the format for representing the parsed version of the strings (defaults to the native XML if not specified)
limit: the maximum number of strings to include in the search result (0, the default, means no limit)
sco: set to sco to restrict search results to strings not marked as duplicates of others
response: the string matching the specified search criteria (MIME type text/xml, encoding UTF-8)
<stringSet>
<string id="string ID" canonicalId="ID of canonical string" deleted="deleted flag, true or false" createTime="UTC timestamp string was first added to StringPool" createUser="name of the user to first add string to StringPool" createDomain="name of StringPool node string was first added to" updateTime="UTC timestamp string was last updated" updateUser="name of the user to last update string" updateDomain="name of StringPool node string was last updated at" parseChecksum="MD5 hash of parsed version, if available and format set to concise">
<stringPlain><plain string></stringPlain>
<stringParsed><parsed version of string (if available), as XML or in format specified by format parameter></stringParsed>
</string>
<string ...>...</string>
</stringSet>
action=apiStats: retrieve statistics on the usage of the node, in particular for the data handling actions
additional parameters:
format: the name of the XSLT stylesheet to use for transforming the result (defaults to the native XML if not specified)
response: the API call statistics (MIME type text/xml, encoding UTF-8)
<apiStats total="total number of API calls" feed="number of calls to feed action" rss="number of calls to RSS feed action" find="number of calls to find action" get="number of calls to get action" update="number of calls to update action" count="number of calls to count action" stats="number of calls to API statistics"/>
POST: requests from StringPool node administration HTML page, infrastructure replication, or meta data updates for existing strings:
/StringPool/sp/update: for deleting or un-deleting existing strings or updating canonical string ID
request headers to set:
user: the user to credit for the update
request body:
<stringSet>
<string id="string ID" canonicalId="ID of canonical string to set" deleted="deleted flag to set, true or false"/>
</stringSet>
response (MIME type text/xml, encoding UTF-8):
<stringSet>
<string id="string ID" canonicalId="ID of canonical string" deleted="deleted flag, true or false" createTime="UTC timestamp string was first added to StringPool" createUser="name of the user to first add string to StringPool" createDomain="name of StringPool node string was first added to" updateTime="UTC timestamp string was last updated" updateUser="name of the user to last update string" updateDomain="name of StringPool node string was last updated at" parseChecksum="MD5 hash of parsed version, if available">
<stringPlain><plain string></stringPlain>
</string>
</stringSet>
PUT: upload new or update existing strings:
request headers to set:
Data-Format: the upload data format, xml or txt (tried to auto-detect if not specified)
User-Name: the user to credit for uploaded string (defaults to 'Anonymous' if not specified)
request body: the strings as plain text or wrapped in XML, corresponding to the format specified in the header; to be encoded in UTF-8
Data-Format=txt: one plain string per line, adds new strings, un-deletes ones that are re-added and were flagged as deleted
Data-Format=xml:
<stringSet>
<string>
<stringPlain><plain string></stringPlain>
<stringParsed><parsed string in XML, if available></stringParsed>
</string>
<string>...</string>
</stringSet>
response: update statistics (MIME type text/xml, encoding UTF-8), in particular the uploaded or otherwise updated strings, with attributes indicating whether they were updated or alltogether newly added to the open string pool:
<stringSet created="number of strings newly added" updated="number of strings updated, less newly created ones">
<string id="string ID" canonicalId="ID of canonical string" deleted="deleted flag, true or false" createTime="UTC timestamp string was first added to StringPool" updateTime="UTC timestamp string was last updated" parseChecksum="MD5 hash of parsed version, if available" parseError="explanation why parsed version was rejected, if any" created="true or false, indicating whether string was newly added to StringPool" updated="true or false, indicating whether string existed and was updated">
<stringPlain><plain string, as stored in StringPool></stringPlain>
</string>
<string ...>...</string>
</stringSet>