Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

properties draft

  • Loading branch information...
commit 25d9004270f8fea3c44600f46d10d64bfeb799fd 1 parent 9d56742
Randy Jung rloads authored
3  comment.md
Source Rendered
@@ -78,6 +78,9 @@ Each comment will have `comments` which contains all the replies written for the
78 78
79 79 More filtering options are available:
80 80
  81 +* `GET /comments?page=2` to get the page two of results. The result will be paginated 30 items per page.
  82 +* `GET /comments?order_by=updated_at+desc` will return sorted results by `updated_at` field.
  83 +* `GET /comments?order_by=created_at+desc` will return sorted results by `created_at` field.
81 84 * `GET /comments?commented_on_type=Workspace` will only return comments written for a workspace. Other parameters can be `File`, `Page` or `Comment`.
82 85 * `GET /comments?commented_on_type=File&commented_on_ids=1,2,3` will return comments written for file 1, file 2 or file 3. `commented_on_ids` parameter will only work with `commented_on_type` parameter present.
83 86 * `GET /comments?created_since=2012-09-18T18:11:40-07:00` will return comments which were created after given time.
3  file.md
Source Rendered
@@ -72,6 +72,9 @@ If the user has no permission to access the workspace, server will return `403 F
72 72
73 73 More filtering options are available:
74 74
  75 +* `GET /files?page=2` to get the page two of results. The result will be paginated 30 items per page.
  76 +* `GET /files?order_by=updated_at+desc` will return sorted results by `updated_at` field.
  77 +* `GET /files?order_by=created_at+desc` will return sorted results by `created_at` field.
75 78 * `GET /files?created_since=2012-09-18T18:11:40-07:00` will return files created after given time.
76 79 * `GET /files?updated_since=2012-09-18T18:11:40-07:00` will return files updated after given time.
77 80 * `GET /files?owner_ids=1,2,9` will return files which have owner 1 or owner 2 or owner 9.
3  page.md
Source Rendered
@@ -56,6 +56,9 @@ If a page has share_mode of `anyone`, `expire_at` and `password` options will be
56 56
57 57 More filtering options are available for `GET /pages`:
58 58
  59 +* `GET /pages?page=2` to get the page two of results. The result will be paginated 30 items per page.
  60 +* `GET /pages?order_by=updated_at+desc` will return sorted results by `updated_at` field.
  61 +* `GET /pages?order_by=created_at+desc` will return sorted results by `created_at` field.
59 62 * `GET /pages?created_since=2012-09-18T18:11:40-07:00` will return pages which were created after given time.
60 63 * `GET /pages?updated_since=2012-09-18T18:11:40-07:00` will return pages which were updated after given time.
61 64 * `GET /pages?owner_ids=1,2,9` will return pages which have owner's id of 1 or 2 or 9.
165 property.md
Source Rendered
... ... @@ -1,4 +1,167 @@
1 1 Properties
2 2 =====================
3 3
4   -> Custom properties for workspaces.
  4 +> 5 types of custom properties are `text`, `pulldown`, `multi`, `boolean` or `date`.
  5 +
  6 +Get Properties
  7 +--------------
  8 +
  9 +* `GET /workspaces/1/properties` will return all properties defined in the workspace. Response would look like this:
  10 +
  11 +```json
  12 +[
  13 + {
  14 + "property": {
  15 + "id": 275,
  16 + "kind": "multi",
  17 + "name": "Select best three things about TeamPlatform",
  18 + "description": "not needed to be just three",
  19 + "selections": "Uniqueness, Fits my needs, Affordable, Support, Easy to use, All of the above",
  20 + "required_for": "create",
  21 + "required": true,
  22 + "team_id": 138,
  23 + "values_count": 2,
  24 + "created_at": "2011-06-14T12:33:51-07:00",
  25 + "updated_at": "2011-06-14T12:34:26-07:00"
  26 + },
  27 + "value": {
  28 + "id": 1868,
  29 + "value": "All of the above",
  30 + "property_id": 275,
  31 + "position": 1,
  32 + "target_type": "Workspace"
  33 + "target_id": 1127,
  34 + "created_at": "2011-06-14T12:33:51-07:00",
  35 + "updated_at": "2011-06-14T12:33:51-07:00"
  36 + }
  37 + },
  38 + {} ...more properties
  39 +]
  40 +```
  41 +
  42 +* `GET /properties` will return all properties defined for the team. Response will look similar to above case but will not have `value` part. `value` is only available when the property is added to workspaces and requested from `GET /workspaces/1/properties`.
  43 +
  44 +```json
  45 +[
  46 + {
  47 + "property": {
  48 + "id": 275,
  49 + "kind": "multi",
  50 + "name": "Select best three things about TeamPlatform",
  51 + "description": "not needed to be just three",
  52 + ...property info
  53 + }
  54 + ...no value info here
  55 + },
  56 + {} ...more properties
  57 +]
  58 +```
  59 +
  60 +**Property**
  61 +`selections` is comma separated list of possible choices for `pulldown` and `multi` type of properties.
  62 +`required_for` with `create` means that this property field will be prompted to the user when a new workspace is going to be created from the workspace template which this property belongs to. `required` tells this property is required field to enter when presented to the user.
  63 +`team_id` is the id of the team which owns this property.
  64 +`values_count` goes up by one whenever this property is added to workspaces.
  65 +
  66 +**Value**
  67 +`value` portion of the above example has the actual user input for the property. In the above example, user selected the `All of the above` from the property's selections.
  68 +`property_id` points to the property definition which id is `275` in this case.
  69 +`position` denotes the position of this property-value pair in the target workspace.
  70 +`target_type` and `target_id` tells where this property-value pair exists.
  71 +
  72 +Get Property
  73 +------------
  74 +
  75 +* `GET /workspaces/1/properties/1` returns single property-value pair like this:
  76 +
  77 +```json
  78 +{
  79 + "property": {
  80 + "id": 275,
  81 + "kind": "multi",
  82 + "name": "Select best three things about TeamPlatform",
  83 + ...more info on property
  84 + },
  85 + "value": {
  86 + "id": 1868,
  87 + "value": "All of the above",
  88 + "property_id": 275,
  89 + ...more info on value
  90 + }
  91 +}
  92 +```
  93 +
  94 +* `GET /properties/1`
  95 +
  96 +```json
  97 +{
  98 + "property": {
  99 + "id": 275,
  100 + "kind": "multi",
  101 + "name": "Select best three things about TeamPlatform",
  102 + ...more info on property
  103 + }
  104 + ...no value here
  105 +}
  106 +```
  107 +
  108 +Create Property
  109 +----------------
  110 +
  111 +* `POST /workspaces/1/properties` with JSON:
  112 +
  113 +```json
  114 +{
  115 + "kind": "pulldown",
  116 + "name": "Rate this workspace!",
  117 + "description": "in terms of contents quality",
  118 + "selections": "Super!, A+, A, A-, B+, B, B-, C, D",
  119 + "required_for": "create",
  120 + "required": true,
  121 + "value": "Super!",
  122 + "position": 1
  123 +}
  124 +```
  125 +
  126 +If workspace is present in the request uri and the workspace is accessible, Property-value pair will be created and will return `200 Ok` with created property-value pair.
  127 +
  128 +* `POST /properties` with JSON:
  129 +
  130 +```json
  131 +{
  132 + "kind": "text",
  133 + "name": "What's your name?",
  134 + "description": "just out of curiosity",
  135 + "selections": "",
  136 + "required_for": "",
  137 + "required": false
  138 +}
  139 +```
  140 +
  141 +If workspace is not present, only new property will be created.
  142 +
  143 +Update Property
  144 +---------------
  145 +
  146 +* `PUT /workspaces/1/properties/1` will update the property-value pair.
  147 +
  148 +```json
  149 +{
  150 + "value": "D"
  151 +}
  152 +```
  153 +
  154 +* `PUT /properties/1` will only update the property attributes. Following JSON updates nothing.
  155 +
  156 +```json
  157 +{
  158 + "value": "D",
  159 + "position": 2
  160 +}
  161 +```
  162 +
  163 +Delete Property
  164 +----------------
  165 +
  166 +* `DELETE /properties/1` will delete property 1
  167 +* `DELETE /workspaces/1/properties/1` will remove the property-value pair in workspace 1, but will not delete property 1 itself.
1  task.md
Source Rendered
@@ -55,6 +55,7 @@ Task has three `state`s that are `created`, `started` and `finished`.
55 55
56 56 More filtering options are available for `GET /tasks` and `GET /workspaces/1/tasks`:
57 57
  58 +* `GET /tasks?page=2` to get the page two of results. The result will be paginated 30 items per page.
58 59 * `GET /tasks?created_since=2012-09-18T18:11:40-07:00` will return tasks which were created after given time.
59 60 * `GET /tasks?updated_since=2012-09-18T18:11:40-07:00` will return tasks which were updated after given time.
60 61 * `GET /tasks?workspace_id=1` will return tasks in workspace 1.
3  workspace.md
Source Rendered
@@ -56,6 +56,9 @@ Get Workspaces
56 56
57 57 More filtering options are available for `GET /workspaces`:
58 58
  59 +* `GET /workspaces?page=2` to get the page two of results. The result will be paginated 30 items per page.
  60 +* `GET /workspaces?order_by=updated_at+desc` will return sorted results by `updated_at` field.
  61 +* `GET /workspaces?order_by=created_at+desc` will return sorted results by `created_at` field.
59 62 * `GET /workspaces?status=active` will return active workspaces.
60 63 * `GET /workspaces?status=archived` will return archived workspaces.
61 64 * `GET /workspaces?deleted=[true|false]` will return `deleted/not-deleted` workspaces.

0 comments on commit 25d9004

Please sign in to comment.
Something went wrong with that request. Please try again.