diff --git a/src/www/gf-cloud-api.html b/src/www/gf-cloud-api.html index 5549764d1..b21817b97 100644 --- a/src/www/gf-cloud-api.html +++ b/src/www/gf-cloud-api.html @@ -6,31 +6,52 @@
-
GF Cloud Service API (preliminary)
GF Cloud Service API (preliminary)+This is preliminary and subject to change! + +
The service is available from
-http://cloud.grammaticalframework.org.
+http://cloud.grammaticalframework.org/.
Users that have GF installed on their own computer can also
run the service locally by starting GF with the command gf -server.
+Requests are made via HTTP with the GET or POST method. (The examples below +show GET requests, but POST is preferred for requests that change the state +on the server.) +
+Data in requests is in the application/x-www-form-urlencoded format
+(the format used by default by web browsers when submitting form data).
+
+Data in responses is usually in JSON format. +The HTTP response code is usually 200, but can also be +204 (after file upload), +404 (file to download or remove was not found), +400 (for unrecognized commands or missing/unacceptable parameters in requests) +or +501 (for unsupported HTTP request methods). -This is preliminary and subject to change! +
/new command to obtain a
-working directory (which also servces as a session identifier) on the server,
+working directory (which also serves as a session identifier) on the server,
see below.
/gfshell&dir=...&command=i+Foods.pgf
+ /gfshell?dir=...&command=i+Foods.pgf
/gfshell&dir=...&command=gr
- Pred (That Pizza) (Very Boring)
+ /gfshell?dir=...&command=gr
+ Pred (That Pizza) (Very Boring)
+ /gfshell?dir=/tmp/gfse.t6GFEY6b/&command=ps+-lextext+%22That+pizza+is+very+boring.%22
+ that pizza is very boring .
+
/new
/tmp/gfse.123456.
- Most of the clouds service commands require that a working directory
- is specified in the dir parameter.
+ /tmp/gfse.123456.
+ Most of the cloud service commands require that a working directory
+ is specified in the dir parameter.
The working directory is persistent, so clients are expected
to remember and reuse it. Access to previously
uploaded files requires that the same working directory is used.
@@ -87,18 +111,19 @@ For documentation of GF shell commands, see:
/cloud?&dir=...&command=upload&path1=source1&path2=source2&...
+ /cloud?dir=...&command=upload&path1=source1&path2=source2&...
/cloud?&dir=...&command=make&path1=source1&path2=source2&...
+ /cloud?dir=...&command=make&path1=source1&path2=source2&...
/cloud?&dir=...&command=download&file=path
+ The response code is 204 if the upload was successful.
+ /cloud?dir=...&command=download&file=path
/cloud?&dir=...&command=ls&ext=.pgf
- ["Foods.pgf","Letter.pgf"] (list files with the specified extension)
-
- /cloud?&dir=...&command=rm&file=path
+ /cloud?dir=...&command=ls&ext=.pgf
+ ["Foods.pgf","Letter.pgf"].
+ /cloud?dir=...&command=rm&file=path
/cloud?&dir=...&command=link_directories&newdir=...
+ /cloud?dir=...&command=link_directories&newdir=...