The CubeTree API is a REST Web services API allowing applications to query and manipulate the resources provided by the CubeTree Web application.
All resources in the CubeTree API are available in the JSON format when requesting resources. See the JSON page on Wikipedia for more information about JSON. For POST or PUT requests, the request format required is the standard HTTP form encoding described in RFC 2045.
Client authorization is accomplished via the Login resource (described below). All interactions with the CubeTree API will be over HTTPS to ensure data security.
In order to provide a high quality of service for all CubeTree API clients, there exists a request rate limit to ensure no one client can overwhelm the system. Each authenticated user account is limited to 30 API requests any given 1 minute period, and 300 total requests per any given 1 hour period, starting from the time of the first eligible request. If your client exceeds this request rate, you will receive an HTTP 509 "Bandwidth Limit Exceeded" response code to indicate this condition.
The version of the API is embedded in the URLs of the resources. For example, version 1.0 of the API would be accessed by a set or resources beginning with:
https://www.cubetree.com/api/v1/...
Timestamps will be emitted in UNIX epoch time, i.e. the number of seconds since Jan 1, 1970. The API expects any timestamps in API requests to also be in this format.
| Method | URL | Description |
|---|---|---|
| POST | https://www.cubetree.com/api/v1/login |
Acquire authorization to access the API on a member's behalf |
| POST | https://www.cubetree.com/api/v1/logout |
Drop authorization for API access on a member's behalf |
Note: /api/v1/logout takes no parameters
Login email address for the authenticating member.
Password for the authenticating member.
The HTTP response for this resource will include a session cookie that should be included on all subsequent requests by the API client in order to prove authentication. There will be no HTTP body on this response.
| Method | URL | Description |
|---|---|---|
| GET | https://www.cubetree.com/api/v1/feed |
All feed items for the authenticated member |
| GET | https://www.cubetree.com/api/v1/feed/comments |
All comments for the given feed item |
Specifies the feed ID with which the particular resource request is interested. If no feed_id is specified, the member's home feed will be assumed. The feed_id parameter can refer to any type of feed specified by the feed_type parameter except the home feed.
Specifies the type of feed referred to in the feed_id parameter. If no feed_type parameter is specified, the target feed will be assumed to be the authenticated member's home feed and any feed_id parameter specified will be ignored.
Specifies the page of results to fetch. This is used to fetch further back in the feed than the latest items.
Specifies the number of items to fetch. This cannot be > 100 or < 20.
Specifies the feed item for which to retrieve comments (only applicable feed/comments resource).
All of the above requests return the same response representation. Any successful response will return up to 100 items, depending on the value of the page_size parameter.
[
{
"id": 1234567890,
"creator-id": 5005,
"creator-name": "Frank Schlobatnik",
"created-at": 1234567890,
"type": "link",
"action": "posted the link",
"link": "http://cubetree.com/",
"link-title": "CubeTree",
"blurb": "this app is pretty awesome",
"photo": "https://www.cubetree.com/images/this-photo.png",
"comments": 1
},
...
]
The item response element will have the following attributes:
| Method | URL | Description |
|---|---|---|
| POST | https://www.cubetree.com/api/v1/feed/status |
Create a new status message for the specified feed |
| POST | https://www.cubetree.com/api/v1/feed/doc |
Create a new doc for the specified feed |
| POST | https://www.cubetree.com/api/v1/feed/photo |
Create a new photo for the specified feed |
| POST | https://www.cubetree.com/api/v1/feed/comment |
Create a new comment for the specified feed item |
(optional) If specified, this parameter indicates the group ID upon which this new item should be added. Otherwise, it will be submitted to the authenticated member's feed.
(optional) Specifies the ID of the feed item onto which this new item will be applied. This parameters is only applicable if posting a comment on a feed item and the item is eligible for commenting.
The body of the message, HTML-escaped. Currently limited to 255 characters in length and will be truncated to 255 characters if found to be over that limit.
For doc and photo requests, the actual doc and photo bodies will be uploaded by the client via form-based file upload techniques common to Web applications (see RFC1867 for more details on that). Only the first attachment in a given attempt will be considered. This first attachment must have the label "data" on it.
| Method | URL | Description |
|---|---|---|
| GET | https://www.cubetree.com/api/v1/members |
Retrieve a member's profile information |
| GET | https://www.cubetree.com/api/v1/members/groups |
Retrieve the list of groups a member is following |
The member ID for which you are requesting information. Eliding this parameter from the request will return the response object representations for the authenticated member.
{
"id": 12345,
"first-name": "John",
"last-name": "Doe",
"nick-name": "Awesome",
"company-name": "Awesome Widgets LLC",
"created-at": 1234567890,
"title": "Sales Associate",
"job-description": "To sell stuff",
"photo": "https://www.cubetree.com/images/your-profile-pic.png",
"email-addresses": [
{
"location": "Corporate",
"address": "john.doe@corporate.com"
},
{
"location": "Home",
"address": "jdoe@myhome.com"
},
...
],
"phone-numbers": [
{
"location": "Office",
"number": "1-800-999-9999"
},
{
"location": "Mobile",
"number": "1-800-555-1212"
},
...
],
"im-accounts": [
{
"service": "AIM",
"handle": "salesdood",
},
...
],
"office-location": "4 Penn Plaza, New York, NY",
"twitter-username": "salesdood",
"current-status": "Selling things"
}
[
{
"id": 1,
"name": "Future Ideas",
"description": "Ideas for the future",
"acl": "public",
"scope": "internal"
},
{
"id": 2,
"name": "All Things Bacon",
"description": "Bacon, bacon, bacon",
"acl": "private",
"scope": "xco"
},
...
]
| Method | URL | Description |
|---|---|---|
| GET | https://www.cubetree.com/api/v1/groups |
Retrieve a groups's information |
| GET | https://www.cubetree.com/api/v1/groups/followers |
Retrieve the list of a group's followers |
The group ID for which you are requesting information.
{
"id": 12345,
"name": "Future Plans",
"description": "Discussions of stuff we'd like to do at some point",
"photo": "https://www.cubetree.com/images/group-profile-pic.png",
"acl": "public",
"scope": "internal",
"created-at": 1234567890,
"creator-id": 12345,
"stats": {
"docs": 0,
"links": 4,
"photos": 1,
"followers": 10
}
}
[
{
"id": 1,
"first-name": "Joe",
"last-name": "Smith",
"title": "Janitor",
"photo": "https://www.cubetree.com/images/your-profile-pic.png",
},
{
"id": 2,
"first-name": "Frank",
"last-name": "Schlobatnik",
"title": "Baseball Player",
"photo": "https://www.cubetree.com/images/your-profile-pic.png"
},
...
]
| Method | URL | Description |
|---|---|---|
| GET | https://www.cubetree.com/api/v1/action_item |
List the given member's tasks (accepts only feed_id parameter; if omitted, will return logged-in member's tasks) |
| POST | https://www.cubetree.com/api/v1/action_item/item |
Assign a new task from the currently logged-in member (accepts assignee_id and message parameters) |
| POST | https://www.cubetree.com/api/v1/action_item/complete |
Mark a task as completed (accepts only id parameter) |
The task ID for which you are requesting information.
The ID of the member on whose behalf you are requesting a list of tasks.
The ID of the member to whom you are assigning a newly-created task.
The message associated with a newly-created task.
[
{
"due-date": 1258088399,
"creator-name": "Joe Brown",
"created-at": 1257181677,
"assignee-name": "Frank Smith",
"assignee-id": 201,
"action": "Update last quarter's sales figures.",
"assigner-id": 112,
"id": 4001,
"creator-id": 112,
"source": null,
"assigner-name": "Joe Brown"
}
...
]
Returns the same as for an individual task from the List Tasks request.
No body response; use HTTP response code to determine success or failure.