-
Notifications
You must be signed in to change notification settings - Fork 2
Server API
spratt edited this page Feb 6, 2013
·
1 revision
The Code Review server responds to the following GET requests:
| Request Intention | Request URL | Request Param Name | Request Param Description | Response Object |
| Get Code | /do/code | id | The uuid of the code being requested. | Code |
| Get comments | /do/comments | code_id | The uuid of the code with which the comments are associated. | MultipleComment |
The Code Review server responds to the following POST requests:
| Request Intention | Request URL | Request Object | Response Object |
| Add Code | /do/newcode | A Code object without uuid, createdAt, or updatedAt. | Code |
| Add a comment | /do/newcomment | A Code object without id, createdAt, or updatedAt. | Comment |
Code objects have the following parameters:
| Parameter | Type | Description |
| uuid | String | The uuid of the code. |
| text | String | The text of the code. |
| language_id | Number | The id of the language in which the code is written. |
| createdAt | Date | When the code was submitted. |
| createdAt | Date | When the code was last updated. |
MultipleComment objects have the following parameters:
| Parameter | Type | Description |
| code_id | String | The uuid of the code with which the comments are associated. |
| comments | Array | The array of all Comment objects associated with the given code uuid. |
Comment objects have the following parameters:
| Parameter | Type | Description |
| user | String | The name of the user who submitted the comment. |
| code_id | Number | The uuid of the code with which the comment is associated. |
| line_start | Number | The first line to which the comment refers. |
| line_end | Number | The last line to which the comment refers. |
| id | Number | The numerical id of the comment. |
| createdAt | Date | When the comment was submitted. |
| createdAt | Date | When the comment was last updated. |