10
edits
No edit summary |
No edit summary |
||
| Line 1: | Line 1: | ||
Below are the Machine-to-machine communication protocols we currently use for Joey server and addon/J2ME client. | Below are the Machine-to-machine communication protocols we currently use for Joey server and addon/J2ME client. If the request is successfully executed, the server returns HTTP code 200 with data in the response body (or, empty body if there is no data). If the server encounters an error, it returns custom HTTP codes as discussed below, and an empty body. | ||
| Line 6: | Line 6: | ||
/users/login | /users/login | ||
Request | Request: | ||
* rest=1 | * rest=1 | ||
* data[User][username]=<username> | * data[User][username]=<username> | ||
* data[User][password]=<password> | * data[User][password]=<password> | ||
Response | Success Response: | ||
* | * HTTP 200 with empty body | ||
* | Error HTTP Status Code: | ||
* | * 512 Login Error | ||
* 513 User not Activated | |||
---- | ---- | ||
| Line 21: | Line 22: | ||
/uploads/index | /uploads/index | ||
Request | Request: | ||
* rest=1 | * rest=1 | ||
* limit=<number of entries to be returned> | * limit=<number of entries to be returned> (optional) | ||
* start=<limit * start is the first entry to be returned> | * start=<limit * start is the first entry to be returned> (optional) | ||
Response: The first line is always a numeric return code | Success Response: The first line is always a numeric return code. A positive (or zero) integer "n" indicates the number of items in this index. The items are organized as follows (i iterates from 1 to n): | ||
title.i=<the title> | title.i=<the title> | ||
referrer.i=<referrer URL> | referrer.i=<referrer URL> | ||
| Line 34: | Line 35: | ||
type.i=<MIME type for the transcode content at /files/view/id> | type.i=<MIME type for the transcode content at /files/view/id> | ||
preview.i=<Base64 encoded preview data -- always image/png> | preview.i=<Base64 encoded preview data -- always image/png> | ||
Error HTTP Status Code: | |||
* 511 No Active Session | |||
---- | ---- | ||
| Line 39: | Line 43: | ||
/uploads/delete/id | /uploads/delete/id | ||
Request | Request: | ||
* The "id" in the URL | * The "id" in the URL | ||
* rest=1 | * rest=1 | ||
Response: | Success Response: | ||
* | * HTTP 200 with empty body | ||
* User | |||
* | Error HTTP Status Code: | ||
* 511 No Active Session | |||
* 515 Not Permitted for This User | |||
* 514 Cannot Delete | |||
---- | ---- | ||
| Line 53: | Line 60: | ||
This one is currently uses multi-part file upload. We need a different URL for the mobile client. Perhaps /uploads/j2me_add ?? | This one is currently uses multi-part file upload. We need a different URL for the mobile client. Perhaps /uploads/j2me_add ?? | ||
Request: | |||
* Multi-part file upload or content upload with the correct MIME type | |||
Success Response: | |||
* HTTP 200 with empty body | |||
Error HTTP Status Code: | |||
* 511 No Active Session | |||
* 517 Out of Space for Upload | |||
* 518 Generic Upload Error | |||
---- | ---- | ||
| Line 58: | Line 76: | ||
/files/view/id | /files/view/id | ||
Request | Request: | ||
* The "id" in the URL | * The "id" in the URL | ||
Response: | Success Response: | ||
* HTTP code 200 | |||
* MIME type in HTTP header | * MIME type in HTTP header | ||
* Binary content in body | * Binary content in body | ||
Error | Error HTTP Status Code: | ||
* | * 511 No Active Session | ||
* | * 515 Not Permitted for This User | ||
* 516 File Access Error | |||
---- | ---- | ||
| Line 73: | Line 93: | ||
/files/view/id/preview | /files/view/id/preview | ||
Request | Request: | ||
* The "id" in the URL | * The "id" in the URL | ||
Response: | Success Response: | ||
* HTTP code 200 | |||
* MIME type in HTTP header | * MIME type in HTTP header | ||
* Binary content in body | * Binary content in body | ||
Error | Error HTTP Status Code: | ||
* | * 511 No Active Session | ||
* | * 515 Not Permitted for This User | ||
* 516 File Access Error | |||
---- | ---- | ||
| Line 88: | Line 110: | ||
/files/view/id/original | /files/view/id/original | ||
Request | Request: | ||
* The "id" in the URL | * The "id" in the URL | ||
Response: | Success Response: | ||
* HTTP code 200 | |||
* MIME type in HTTP header | * MIME type in HTTP header | ||
* Binary content in body | * Binary content in body | ||
Error | Error HTTP Status Code: | ||
* | * 511 No Active Session | ||
* | * 515 Not Permitted for This User | ||
* 516 File Access Error | |||
edits