API documentation

Weekdone API is RESTful interface, providing access to the data in Weekdone system. The API supports JSON output.

Overview

Weekdone API is RESTful interface, providing access to most of the data in the system.The API accepts form-encoded content and query parameters in requests and all responses are encoded in JSON, including errors. UTF-8 is the only character encoding supported for both requests and responses.

Authentication

All API requests must contain way to authenticate the user and authorize access to requested data. Weekdone API supports OAuth 2.0 Authentication mechanism. A web application with a user’s authorization key, may access information and make changes to data stored in Weekdone as if it were that user.

OAuth 2.0

Weekdone API supports only Authorization Code Grant flow of the OAuth 2.0 framework. This is the most common strategy for traditional web applications and native desktop/mobile apps.

Registering your application

Before starting to implement the Weekdone API a new app must be registered with Weekdone to receive Client ID and Client Secret. This can be done from Applications page. All applications added by a client are visible to all admin level accounts of that client. As with all OAuth apps, you must supply an Application URL as well as a Redirect URL that successful (or failed) authentications will redirect to.

Requesting authorization from the user

Developers should use button with the text “Sign in with Weekdone” when redirecting users to Weekdone to start authorization flow.

To start the authorization flow users must be redirected to https://weekdone.com/oauth_authorize passing parameters in query string.

NameRequiredDescription
client_idyesThe Client ID uniquely identifies the application making the request.
redirect_uriyesThe URI to redirect to on success or error. This must match the Redirect URL specified in the application settings.
response_typeyesMust be ‘code’ (as other authorization flows are not supported).
statenoEncodes state of the app, which will be returned verbatim in the response and can be used to match the response up to a given request.

If either the client_id or redirect_uri do not match, the user will simply see a plain-text error. Otherwise, all errors will be sent back to the redirect_uri specified.

The user then sees a screen giving them the opportunity to accept or reject the request for authorization. In either case, the user will be redirected back to the redirect_uri.

Response back to application

User will be redirected back to redirect_uri with following parameters in the query string on successful authorization:

NameDescription
codeThis is the code your app can exchange for a token
stateThe state parameter that was sent with the authorizing request

Token exchange

If user granted access to the application the code received by application must be exchanged for proper access token. The app must make POST request to https://weekdone.com/oauth_token passing following parameters in form-encoded post body:

NameRequiredDescription
codeyesThe code you are exchanging for an auth token
grant_typeyesMust be authorization_code
client_idyesThe Client ID uniquely identifies the application making the request.
client_secretyesThe Client Secret belonging to the app, found in application details
redirect_uriyesMust match the redirect_uri specified in the original request

Token exchange response

In the response, you will receive a JSON payload with the following parameters:

NameDescription
access_tokenThe token to use in future requests against the API
refresh_tokenIf exchanging a code, a long-lived token that can be used to get new access tokens when old ones expire.
userA JSON object encoding a few key fields about the logged-in user

Requesting new access token with refresh token

access_token will expire in 60 minutes and new tokens must be requested using refresh_token. To request new access token the app must make POST request to https://weekdone.com/oauth_token passing following parameters in form-encoded post body:

NameRequiredDescription
refresh_tokenyesThe refresh_token
grant_typeyesMust be refresh_token
client_idyesThe Client ID uniquely identifies the application making the request.
client_secretyesThe Client Secret belonging to the app, found in application details
redirect_uriyesMust match the redirect_uri specified in the original request

Response will be the new access_token

Tips to get you started

There are several OAuth libraries to get you started

We have Zapier integration available if you are already using Zapier

Items

Items are what reports are made of. Each item may belong to one or several reports and evey item has following parameters:

NameTypeDescription
idnumberUniquely identifies each item
inserteddatetimeWhen the item was added to Weekdone
descriptionstringThe textual description of the item
type_idnumberIn which report category the item belongs to:
0 = Plans on Hold
1 = Progress
2 = Plans
3 = Problems
4... = Custom types
nrnumberPosition of the item within the same type_id
user_idnumberID of user who added the task or to whom the task was assigned
team_idnumberID of the team where item was added
sourcenumberSource of the item 0 = Weekdone
1 = JIRA
2 = Asana
3 = Basecamp
4 = GoogleTasks
5 = Slack
source_idstringID of the item in external system. Maximum length is 50 characters
prioritynumber0 = not specified
1 = green
2 = amber
3 = red
commentcountnumberNumber of comments
likecountnumberNumber of likes
from_idnumberWho assigned this item
due_ondateWhen the item is due
privatenumberWho can see the item
0 – public: item has team permissions
1 – private: item is only visible to owner

Each report in Weekdone is identified by it’s number. The number is in form YYYYWW where YYYY is the year and WW is the week number.

Name Type URL Sample response:
Search for items GET https://api.weekdone.com/1/items?token=<OAuth Token>
{
  "status": "ok",
  "items": [
    {
      "id": 690,
      "inserted": "2013-03-28T13:37:54Z",
      "description": "item is here",
      "likecount": 0,
      "commentcount": 0,
      "type_id": 2,
      "team_id": 3,
      "user_id": 12,
      "priority": 1,
      "from_id": 144,
      "source": 0,
      "due_on": "2014-02-02"
    }
  ]
}
Search parameters
Name Description
user_id Search by user ID. Special alias ‘me’ can be used instead of currently authenticated users ID.
team_id Search by team ID
period Search by week number. Defaults to current week
Create item POST https://api.weekdone.com/1/item?token=<OAuth Token>
Supported fields:
Name Required Description
description yes
type_id yes
period no Week where to add the item, defaults to current week
user_id no defaults to OAuth token owner
team_id no defaults to OAuth token owner primary team ID
priority no
source_id no ID of the item in external system
due_on no
private no defaults to 0 (public)
Update item PATCH https://api.weekdone.com/1/item/<item ID>?token=<OAuth Token>
Supported fields:
Name Description
description
type_id Move item to different category
period Required when updating type_id
priority
due_on
Assign item to another user PATCH https://api.weekdone.com/1/item/<item ID>/assign?token=<OAuth Token>
Supported fields:
Name Required
user_id yes
Delete item DELETE https://api.weekdone.com/1/item/<item ID>?token=<OAuth Token>
Get item likes GET https://api.weekdone.com/1/item/<item ID>/likes?token=<OAuth Token> Sample result
{
  "status": "ok",
  "likes": [
    {
      "id": 1360,
      "name": "John Doe"
    }
  ]
}
Add item like POST https://api.weekdone.com/1/item/<item ID>/likes?token=<OAuth Token>
Delete item like DELETE https://api.weekdone.com/1/item/<item ID>/likes?token=<OAuth Token>
Sort items POST https://api.weekdone.com/1/item/<item ID>/sort?token=<OAuth Token>
Supported fields:
Name Required
type_id yes
list yes Comma separated list of item ID’s in this category
period yes Which week to sort
Get item comments GET https://api.weekdone.com/1/item/<item ID>/comments?token=<OAuth Token> Sample result
{
  "status": "ok",
  "comments": [
    {
      "id": 1360,
      "inserted": "2014-02-28T13:37:54Z",
      "comment": "this is item comment",
      "user_id": 12
    }
  ]
}
Add item comment POST https://api.weekdone.com/1/item/<item ID>/comments?token=<OAuth Token>
Supported fields:
Name Required
comment yes
Delete item comment DELETE https://api.weekdone.com/1/item/<item ID>/comments/<comment ID>?token=<OAuth Token>

Report

Get weekly report data grouped by teams. See Items and Users for list of parameters

Each report in Weekdone is identified by it’s number. The number is in form YYYYWW where YYYY is the year and WW is the week number. Defaults to current week.

NameTypeURLSample response:
Get reportGEThttps://api.weekdone.com/1/report?token=<OAuth Token>{ "status": "ok", "period": "201504", "report": [ { "id": 1, "name": "Default Team", "users": [ { "id": 1, "name": "User name", "items": [], "rate": null, "reviews": [], "ratings": { "333":5 } }, { "id": 2, "name": "Second Testuser", "items": [], "rate": 5, "reviews": [], "ratings": [] } ] } ] }
Search parameters
Name Description
user_id Search by user ID. Special alias ‘me’ can be used instead of currently authenticated users ID.
team_id Search by team ID
period Search by week number. Defaults to current week

Teams

Each company account on Weekdone has one or move teams, which have following parameters:

NameTypeDescription
idnumberUniquely identifies each team
namestring
privacynumberWho may see team reports
1 = everybody in the company
1 = team members
2 = team manager only
external_reportsstringAdditional addresses to whom team reports are sent
Following fields exist when each team uses it’s own template
rate_questionstringQuestion for rating week with 5 stars
reportsdue_daynumberWeekday when the report will be sent
reportsdue_hournumberTime of day when the report will be sent
reportreminder_daynumberWeekday when the report reminders will be sent
reportreminder_hournumberTime of day when the report reminders will be sent
timezonestringTimezone of the team. Used to calculate reportsdue and reportreminder values
NameTypeURLSample response:
Get all teamsGEThttps://api.weekdone.com/1/teams?token=<OAuth Token>{ "status": "ok", "teams": [ { "id": 3, "name": "Arendustiim", "privacy": 3, "external_reports": "external@example.com" } ] }

Users

User object has following fields

NameTypeDescription
idnumberUniquely identifies each user
inserteddatetimeWhen the item was created
adminnumberWhether this is company level admin
team_idnumberUser’s primary team
teamsarrayAll teams user belongs to. Each user has two parameters in each team: observer and admin
NameTypeURLDescription
Get all usersGEThttps://api.weekdone.com/1/users?token=<OAuth Token>Example:{ "status": "ok", "users": [ { "id": 1, "name": "Test User", "picture": "http://weekdone.com/favicon2.php?i=T", "admin": 0, "team_id": 1, "teams": [ { "id": 1, "name": "Testing Team", "observer": 0, "admin": 0 } ] } ] }

Types

Reports are divided into types. When all teams in company use different templates, then team_id will be present. Types may have following fields:

NameTypeDescription
idnumberID of the type. There are three pre-defined types which all reports have:
1 = Progress
2 = Plans
3 = Problems

There is one special type with ID=0 – this is carryover category for ‘Plans’ (ID=2). Items cannot be added there.
namestringName of the type
carryoverbooleanWhether items in this category will carry over to next week
overduebooleanWhen items carry over to next week, whether to count items as overdue when they have been carried over more than twice
NameTypeURLDescription
Get all typesGEThttps://api.weekdone.com/1/types?token=<OAuth Token>Example:{ "status": "ok", "same_template": false, "types": [ { "id": 0, "team_id": 1, "name": "In progress" }, { "id": 1, "team_id": 1, "name": "Progress" }, { "id": 103, "team_id": 1, "name": "Custom item type", "carryover": true, "overdue": false } ] }

Tags

Tags added to elements. Optional field “status”

NameTypeURLDescription
Get all tagsGEThttps://api.weekdone.com/1/tag?token=<OAuth Token>Example:{ "status": "ok", "tags": [ { "id": 23, "tag": "design", "status": { "status": "Design is on track", "updated": "2015-01-05 11:33:21", "user_id": 321232 } }, { "id": 44, "tag": "website" } ] }
Get single tagGEThttps://api.weekdone.com/1/tag/<tag ID>?token=<OAuth Token>Example:{ "status": "ok", "tag": { "id": 32, "tag": "products", "status": { "status": "Products are on time", "updated": "2015-04-02 12:51:22", "user_id": 531232 } } }
Update TAG priorityPATCHhttps://api.weekdone.com/1/tag/<tag ID>/priority?token=<OAuth Token>
Supported fields:
Name Required Description
priority yes 0 – this is not priority tag, 1 – this is a priority tag
Update TAG statusPATCHhttps://api.weekdone.com/1/tag/<tag ID>/status?token=<OAuth Token>
Supported fields:
Name Required Description
status yes

Objectives

There are four level of Objectives: Company, Department, Team and Personal. All Objectives have almost same columns with following exceptions

  • Department Objective has department_id
  • Team Objective has team_id
  • Personal Objective has team_id and user_id

“progress” field of Objectives is calculated based on Key Results “progress” and therefore cannot be updated directly.

NameTypeDescription
idnumberID of the Objective
typestringType of Objective (company, department, team, user)
descriptionstringDescription of the Objective
periodstringQuarter of the Objective in form YYYYQ
commentsnumberNumber of comments
progressnumberPercentage of Objective completion
resultsarrayList of Key Results
parent_listarrayList of parent Objectives

Key Results

NameTypeDescription
idnumberID of the Key Result
resultstringKey Result description
inserteddatetimeKey Result creation time
typestringType of Key Result (default %)
startvalnumberKey Result minumum value
maxvalnumberKey Result maximum value
weightnumberKey Result weight -4…+4
progressnumberKey Result progress
updateddatetimeLast Key Result progress update date
user_idnumberID of user who updated Key Result progress
commentsarrayList of Key Result comments
Name Type URL Description
Get all Objectives GET https://api.weekdone.com/1/objective?token=<OAuth Token> Example:
{
  "status": "ok",
  "data": [
    {
      "id": 1,
      "description": "Reach the goal"
      "type": "company",
      "progress": 60,
      "results": [
        {
          "id": 1,
          "result": "Do important things 5 times",
          "type": "times",
          "weight": 1,
          "progress": 3,
          "startval": 0,
          "maxval": 5,
          "commentcount": 0,
          "comments": []
        }
      ]
    }
  ]
}
Search parameters
Name Description
type Return specific type of objectives (company, department, team, user)
department_id Return department objectives
team_id Return team objectives
user_id Return user objectives
period Return objectives for period: YYYYQ or YYYY
Create new Objective POST https://api.weekdone.com/1/objective?token=<OAuth Token>
Supported fields:
Name Required Description
type yes Objective type (company, department, team, user).
  • Department requires field department_id
  • Team requires field team_id
  • User requires fields team_id and user_id
description yes
period no Defaults to current quarter. In format YYYYQ
Update Objective PATCH https://api.weekdone.com/1/objective/<objective_id>?token=<OAuth Token>
Supported fields:
Name Required Description
description yes
Delete Objective DELETE https://api.weekdone.com/1/objective/<objective_id>?token=<OAuth Token>
List Objective comments GET https://api.weekdone.com/1/objective/<objective_id>/comments?token=<OAuth Token>
Add Objective comment POST https://api.weekdone.com/1/objective/<objective_id>/comments?token=<OAuth Token>
Update Objective comment PATCH https://api.weekdone.com/1/objective/<objective_id>/comments/<comment_id>?token=<OAuth Token>
Delete Objective comment DELETE https://api.weekdone.com/1/objective/<objective_id>/comments/<comment_id>?token=<OAuth Token>
Add Objective result POST https://api.weekdone.com/1/objective/<objective_id>/result?token=<OAuth Token>
Supported fields:
Name Required Description
description yes Key Result description
Update Objective result PATCH https://api.weekdone.com/1/objective/<objective_id>/result/<result_id>?token=<OAuth Token>
Supported fields:
Name Required Description
description no
progress no Update progress of Key Result in current period
Delete Objective result DELETE https://api.weekdone.com/1/objective/<objective_id>/result/<result_id>?token=<OAuth Token>

Company details

Each company has several configuration settings:

NameTypeDescription
same_schedulebooleanWhether all teams use the same schedule
same_templatebooleanWhether all teams use the same template
external_emailsstringList of e-mail addresses where company reports are sent
company_objectivesbooleanWhether company objectives are used
team_objectivesbooleanWhether team objectives are used
user_objectivesbooleanWhether personal objectives are used
Following fields are only present when same_schedule=true
reportsdue_daynumberWeekday when reports will be sent
reportsdue_hournumberTime of day when reports will be sent
reportreminder_daynumberWeekday when report reminders will be sent
reportreminder_hournumberTime of day when report reminders will be sent
timezonestringTimezone of the company. Used to calculate reportsdue and reportreminder values
NameTypeURLSample response:
Get company infoGEThttps://api.weekdone.com/1/company?token=<OAuth Token>{ "status": "ok", "data": { "same_schedule": true, "same_template": false, "external_emails": "", "company_objectives": 1, "team_objectives": 1, "user_objectives": 1, "reportsdue_day": 5, "reportsdue_hour": 19, "timezone":"US/Hawaii" } }

Responses

StatusResponse
202{“status”:”ok”}
400{“status”:”error”} – Invalid request, this usually occurs due to missing or invalid parameters in the request.
401{“status”:”error”} – No authorization is returned when no valid API key was supplied.
403{“status”:”error”} – Forbidden, when OAuth authenticated user does not have permission to access this resource.
404{“status”:”error”} – Not found is returned when request method and path are uknown.
500{“status”:”error”} – Internal Server error, means that a problem occurred in Weekdone system. This will usually resolve by itself but if consistent, please contact hello@weekdone.com