source: publico/webscan/wiki/WebServicesAPI.wiki

Última Alteração nesse arquivo foi 4417, incluída por jeanferri, 11 anos atrás

Adicionando os diretórios do projeto hospedado no Google em: http://webscan.googlecode.com/svn/

File size: 3.4 KB
Linha 
1#summary Web Services API.
2#labels Phase-Design,Phase-Implementation,Not-Implemented
3
4= Web Services API =
5
6== Important Considerations ==
7
8 # All strings between [] are variables.
9 # All returns are JSON.
10 # The default return is an associative array containing the error code and msg. If the error code is equal to 0 (zero) there is no errors.
11 # Arguments marked with `*` are optional.
12 
13== Concepts ==
14
15 * Method
16 * Instanced Object
17 * Collection (list of instanced objects)
18
19A string followed by / (slash) in an URL represents object members (method or object) and followed by . (dot) represents collection members.
20
21ie:
22
23 * *modify* is a method of an instanced object scanner:
24{{{
25/scanner/[name]/modify
26}}}
27
28 * *add* is a method of the collection of scanners:
29{{{
30/scanner.add
31}}}
32
33== Services ==
34
35=== Scanner ===
36
37Show all configured scanners:
38{{{
39URL: /scanner
40Args: None
41Method: GET, POST
42Returns: Collection containing all scanner objects.
43}}}
44
45Add a new scanner to the list:
46{{{
47URL: /scanner.add
48Args: name, location*, description*, manufacturer, model, papersize*, isindexable*, user*, group*
49Method: POST
50Returns: Scanner object.
51}}}
52
53Get a scanner object:
54{{{
55URL: /scanner/[name]
56Args: None
57Method: GET, POST
58Returns: Scanner object.
59}}}
60
61Modify a scanner configuration:
62{{{
63URL: /scanner/[name]/modify
64Args: name*, location*, description*, manufacturer*, model*, papersize*, isindexable*, user, group
65Method: POST
66Returns: Scanner object.
67}}}
68
69Remove a scanner:
70{{{
71URL: /scanner/[name]/delete
72Args: None
73Method: DELETE
74Returns: Default
75}}}
76
77Get the scanner status code (See ScannerStatusCode):
78{{{
79URL: /scanner/[name]/status
80Args: None
81Method: GET, POST
82Returns: Default
83}}}
84
85Scan a page:
86{{{
87URL: /scanner/[name]/scan
88Args: None
89Method: GET, POST
90Return: Page object.
91}}}
92
93=== User ===
94
95List all registered users:
96{{{
97URL: /user
98Args: None
99Method: GET, POST
100Returns: Collection containing all user objects.
101}}}
102
103Add a new user:
104{{{
105URL: /user.add
106Args: username, password, role
107Method: POST
108Returns: User object.
109}}}
110
111Get an user object:
112{{{
113URL: /user/[username]
114Args: None
115Method: GET, POST
116Returns: User object.
117}}}
118
119Modify an user registry:
120{{{
121URL: /user/[username]/modify
122Args: username*, password*, role*
123Method: POST
124Returns: User object.
125}}}
126
127Deletes an user:
128{{{
129URL: /user/[username]/delete
130Args: None
131Method: DELETE
132Returns: Default
133}}}
134
135List all the scanned (and not used) pages:
136{{{
137URL: /user/[username]/page
138Args: None
139Method: GET, POST
140Returns: Collection of page objects.
141}}}
142
143Delete a page:
144{{{
145URL: /user/[username]/page/[pageid]/delete
146Args: None
147Method: DELETE
148Returns: Default
149}}}
150
151List all the generated documents:
152{{{
153URL: /user/[username]/document
154Args: None
155Method: GET, POST
156Return: Collection of document objects.
157}}}
158
159Create a new document using the selected pages:
160{{{
161URL: /user/[username]/document.create
162Args: docname, docdescript, pages (list of page ids)
163Method: GET, POST
164Return: Document object.
165}}}
166
167Delete a document:
168{{{
169URL: /user/[username]/document/[docname]/delete
170Args: None
171Method: DELETE
172Return: Default
173}}}
174
175Download a document using the docname:
176{{{
177URL: /user/[username]/document/[docname]
178Args: None
179Method: GET, POST
180Return: Downloadable PDF document.
181}}}
182
183=== Auth ===
184
185Authenticate an user:
186{{{
187URL: /auth/signin
188Args: username, password
189Method: POST
190Returns: Default
191}}}
192
193Sign out an user:
194{{{
195URL: /auth/signout
196Args: None
197Method: GET, POST
198Returns: Default
199}}}
Note: Veja TracBrowser para ajuda no uso do navegador do trac.
 

The contents and data of this website are published under license:
Creative Commons 4.0 Brasil - Atribuir Fonte - Compartilhar Igual.