Data retention policy change.
All inactive accounts (no completed tasks in the last 30 days) will be disabled and deleted by June 30th 2019.
You can export your data at http://www.tomato.es/tomatoes.csv.
Did you find errors or missing information? Edit this page at app/views/pages/api_reference.html.md
Creates a new session using a third party auth provider token.
If a user associated to the access token doesn't exist, a new user will be created.
The response includes a Tomatoes API token that should be used to perform authenticated requests.
Supported providers:
POST /api/session
{
"provider": "github",
"access_token": "348871aaaeec6e4fbf6506e609d71cca8d999e04"
}
200 Ok
400 Bad Request
, the selected provider is not supported401 Unauthorized
, the access token provided is not valid{
"token": "d994a295cf68342b99e3036827d3ef8a"
}
Deletes all Tomatoes API active sessions for the current user.
Authorization: d994a295cf68342b99e3036827d3ef8a
204 No Content
401 Unauthorized
, invalid tokenReturns current user's data.
Authorization: d994a295cf68342b99e3036827d3ef8a
200 Ok
401 Unauthorized
, invalid token{
"id": "57f9c7f57c8402cc74b2cc5c",
"name": "Giovanni Cappellotto",
"email": null,
"image": "https://avatars.githubusercontent.com/u/153842?v=3",
"time_zone": null,
"color": "#000000",
"volume": 2,
"ticking": false,
"work_hours_per_day": null,
"average_hourly_rate": null,
"currency": "USD",
"currency_unit": "$",
"tomatoes_counters": {
"day": 0,
"week": 0,
"month": 2
},
"authorizations": [
{
"provider": "github",
"uid": "153842",
"nickname": "potomak",
"image": "https://avatars.githubusercontent.com/u/153842?v=3"
}
],
"created_at": "2016-10-09T04:30:45.300Z",
"updated_at": "2016-10-09T04:30:45.300Z"
}
Updates current user's attributes.
Authorization: d994a295cf68342b99e3036827d3ef8a
{
"user": {
"name": "Giovanni",
"email": "giovanni@tomato.es",
"image": "http://tomato.es/giovanni.png",
"time_zone": "Europe/Rome",
"color": "#00ccff",
"work_hours_per_day": 8,
"average_hourly_rate": 50,
"currency": "USD",
"volume": 1,
"ticking": false
}
}
200 Ok
401 Unauthorized
, invalid token422 Unprocessable Entity
, validation error{
"id": "57f9c7f57c8402cc74b2cc5c",
"name": "Giovanni",
"email": "giovanni@tomato.es",
"image": "http://tomato.es/giovanni.png",
"time_zone": "Europe/Rome",
"color": "#00ccff",
"volume": 1,
"ticking": false,
"work_hours_per_day": 8,
"average_hourly_rate": 50,
"currency": "USD",
"currency_unit": "$",
"tomatoes_counters": {
"day": 0,
"week": 0,
"month": 2
},
"authorizations": [
{
"provider": "github",
"uid": "153842",
"nickname": "potomak",
"image": "https://avatars.githubusercontent.com/u/153842?v=3"
}
],
"created_at": "2016-10-09T04:30:45.300Z",
"updated_at": "2016-10-09T04:30:45.300Z"
}
Returns a list of current user's tomatoes.
The list of tomatoes is ordered by descending creation date and it's paginated.
Each page contains 25 records, by default the first page is retuned, use the
page
parameter to get any other page in the range [1, total_pages
].
Authorization: d994a295cf68342b99e3036827d3ef8a
page
a positive integer value to select a page in the range
[1, total_pages
]from
a ISO 8601 date time, selects tomatoes where created_at
is greater
than or equals to the parameter valueto
a ISO 8601 date time, selects tomatoes where created_at
is less than
the parameter value200 Ok
401 Unauthorized
, invalid token{
"tomatoes": [
{
"id": "57f9c9377c8402dd306d1c8b",
"created_at": "2016-10-09T04:36:07.787Z",
"updated_at": "2016-10-09T04:36:07.787Z",
"tags": ["one", "two"]
},
{
"id": "57f9c9187c8402dd306d1c88",
"created_at": "2016-10-09T04:35:36.952Z",
"updated_at": "2016-10-09T04:35:36.952Z",
"tags": []
}
],
"pagination": {
"current_page": 1,
"total_pages": 1,
"total_count": 2
}
}
Returns one of current user's tomatoes.
Authorization: d994a295cf68342b99e3036827d3ef8a
200 Ok
401 Unauthorized
, invalid token404 Not Found
{
"id": "57f9c9187c8402dd306d1c88",
"created_at": "2016-10-09T04:35:36.952Z",
"updated_at": "2016-10-09T04:35:36.952Z",
"tags": ["one", "two"]
}
Creates a new tomato.
Authorization: d994a295cf68342b99e3036827d3ef8a
{
"tomato": {
"tag_list": "one, two"
}
}
201 Created
401 Unauthorized
, invalid token422 Unprocessable Entity
, validation error{
"id": "57f9c9187c8402dd306d1c88",
"created_at": "2016-10-09T04:35:36.952Z",
"updated_at": "2016-10-09T04:35:36.952Z",
"tags": ["one", "two"]
}
{
"base": ["Must not overlap saved tomaotes, please wait 24 minutes, 59 seconds"]
}
Updates one of current user's tomatoes.
Authorization: d994a295cf68342b99e3036827d3ef8a
{
"tomato": {
"tag_list": "one, two"
}
}
200 Ok
401 Unauthorized
, invalid token422 Unprocessable Entity
, validation error{
"id": "57f9c9187c8402dd306d1c88",
"created_at": "2016-10-09T04:35:36.952Z",
"updated_at": "2016-10-09T04:35:36.952Z",
"tags": ["one", "two"]
}
Deletes one of current user's tomatoes.
Authorization: d994a295cf68342b99e3036827d3ef8a
204 No Content
401 Unauthorized
, invalid token404 Not Found
Returns a list of current user's projects.
The list of projects is ordered by descending creation date and it's paginated.
Each page contains 25 records, by default the first page is retuned, use the
page
parameter to get any other page in the range [1, total_pages
].
Authorization: d994a295cf68342b99e3036827d3ef8a
page
a positive integer value to select a page in the range
[1, total_pages
]tag_list
a list of tags separated by commas200 Ok
401 Unauthorized
, invalid token{
"projects": [
{
"id": "57f9c9377c8402dd306d1c8b",
"name": "Web app",
"created_at": "2016-10-09T04:36:07.787Z",
"updated_at": "2016-10-09T04:36:07.787Z",
"tags": ["one", "two"],
"money_budget": 1200,
"time_budget": 120
}
],
"pagination": {
"current_page": 1,
"total_pages": 1,
"total_count": 1
}
}
Returns one of current user's projects.
Authorization: d994a295cf68342b99e3036827d3ef8a
200 Ok
401 Unauthorized
, invalid token404 Not Found
{
"id": "57f9c9377c8402dd306d1c8b",
"name": "Web app",
"created_at": "2016-10-09T04:36:07.787Z",
"updated_at": "2016-10-09T04:36:07.787Z",
"tags": ["ruby", "acme"],
"money_budget": 1200,
"time_budget": 120
}
Creates a new project.
Authorization: d994a295cf68342b99e3036827d3ef8a
{
"project": {
"name": "Web app",
"tag_list": "ruby, acme",
"money_budget": 1200,
"time_budget": 120
}
}
201 Created
401 Unauthorized
, invalid token422 Unprocessable Entity
, validation error{
"id": "57f9c9377c8402dd306d1c8b",
"name": "Web app",
"created_at": "2016-10-09T04:36:07.787Z",
"updated_at": "2016-10-09T04:36:07.787Z",
"tags": ["ruby", "acme"],
"money_budget": 1200,
"time_budget": 120
}
{
"name": ["can't be blank"]
}
Updates one of current user's projects.
Authorization: d994a295cf68342b99e3036827d3ef8a
{
"project": {
"name": "Web app",
"tag_list": "ruby, acme",
"money_budget": 1200,
"time_budget": 120
}
}
200 Ok
401 Unauthorized
, invalid token422 Unprocessable Entity
, validation error{
"id": "57f9c9377c8402dd306d1c8b",
"name": "Web app",
"created_at": "2016-10-09T04:36:07.787Z",
"updated_at": "2016-10-09T04:36:07.787Z",
"tags": ["ruby", "acme"],
"money_budget": 1200,
"time_budget": 120
}
Deletes one of current user's projects.
Authorization: d994a295cf68342b99e3036827d3ef8a
204 No Content
401 Unauthorized
, invalid token404 Not Found
Returns the users leaderboard for the selected period.
The period
segment could be daily
, weekly
, monthly
, and overall
.
The list of leaderboard items is ordered by descending score and it's paginated.
Each page contains 25 records, by default the first page is retuned, use the
page
parameter to get any other page in the range [1, total_pages
].
page
a positive integer value to select a page in the range
[1, total_pages
]200 Ok
{
"scores": [
{
"user": {
"id": "586c2be37c8402b5d1db406c",
"name": "Giovanni Cappellotto",
"image": "http://tomato.es/images/users/586c2be37c8402b5d1db406c.png"
},
"score": 2
}
],
"pagination": {
"current_page": 1,
"total_pages": 1,
"total_count": 1
}
}