Tutorial

Sample Code


REST API

/account/me

DESCRIPTION Retrieves information about the user's account that contains the task.
URL STRUCTURE https://tasks.7kai.org/api/1/account/me
METHOD GET
PARAMETERS
  • if_modified_since lists[].actioned_on at the time of last access.
  • if_modified_lists account.list_ids at the time of last access.
RETURNS

User account information.

Sample JSON response

{
  "success" : 1,
  "invite" : null,
  "lists" : [
    {
      "owner" : "1",
      "tasks" : [
        {
          "registrant" : "1",
          "closed" : 0,
          "due" : "02/11/2013",
          "actions" : [
             {
                "time" : 1360529581018,
                "action" : "fix-task",
                "id" : 1,
                "account_id" : "1",
                "message" : "bought."
             }
          ],
          "status" : 2,
          "name" : "buy the coffee.",
          "duration" : 1,
          "pending" : 0,
          "parent_id" : "",
          "updated_on" : 1360529581018,
          "last_comment_id" : 1,
          "requester" : 1,
          "created_on" : 1360529499179,
          "assign" : [
            "1",
            "2"
          ],
          "id" : "1:19"
        }
      ],
      "original" : 1,
      "actioned_on" : 1360529749454,
      "name" : "su_aska's list",
      "invite_code" : "WoV2Np77D5pZB5tU",
      "public_code" : null,
      "members" : [
        "2"
      ],
      "last_task_id" : "19",
      "id" : "1"
    },
    {
      "owner" : "1",
      "tasks" : [],
      "actioned_on" : 1360529794337,
      "name" : "7kai Tasks",
      "invite_code" : null,
      "description" : "7kai Tasks Issues.",
      "public_code" : null,
      "members" : [],
      "last_task_id" : "2",
      "id" : "6"
    }
  ],
  "holidays" : {
    "2012-12-23" : "天皇誕生日",
    "2012-11-03" : "文化の日",
    "2013-02-11" : "建国記念の日",
    "2013-03-20" : "春分の日",
    "2012-11-23" : "勤労感謝の日",
    "2013-07-15" : "海の日",
    "2013-01-01" : "元日",
    "2012-09-17" : "敬老の日",
    "2012-12-24" : "振替",
    "2013-04-29" : "昭和の日",
    "2012-09-22" : "秋分の日",
    "2012-10-08" : "体育の日",
    "2013-01-14" : "成人の日",
    "2013-05-03" : "憲法記念日",
    "2013-05-04" : "みどりの日",
    "2013-05-05" : "こどもの日",
    "2013-05-06" : "振替"
  },
  "account" : {
    "icon" : "http://a0.twimg.com/profile_images/2358600149/pnkjdsot26kfrczlpe96_normal.png",
    "name" : "su_aska",
    "state" : {
      "sort" : {
        "list" : {
          "6" : 1,
          "1" : 3
        }
      },
      "mute" : {},
      "star" : {
        "1:6" : 1
      },
      "tags" : {
        "6" : "danger",
        "1" : "success"
      },
      "display" : {
        "pin" : "on"
      }
    }
  },
  "sub_accounts" : [
    {
      "tw_account_id" : "1",
      "name" : "su_aska",
      "data" : {
        "icon" : "https://si0.twimg.com/profile_images/2358600149/pnkjdsot26kfrczlpe96_normal.png"
      },
      "account_id" : "1",
      "updated_on" : "2012-08-21 00:52:15",
      "authenticated_on" : "2013-02-11 02:37:14",
      "created_on" : "2012-08-21 00:52:15",
      "code" : "tw-69886580"
    }
  ],
  "list_ids" : "1,6",
  "users" : {
    "1" : {
      "icon" : "https://si0.twimg.com/profile_images/2358600149/pnkjdsot26kfrczlpe96_normal.png",
      "name" : "su_aska"
    },
    "2" : {
      "icon" : "https://si0.twimg.com/sticky/default_profile_images/default_profile_6_normal.png",
      "name" : "7kai_org"
    }
  },
  "notice" : null,
  "modified_on" : "1360529393769",
  "token" : null,
  "sign" : {
    "icon" : "https://si0.twimg.com/profile_images/2358600149/pnkjdsot26kfrczlpe96_normal.png",
    "name" : "su_aska",
    "account_id" : "1"
  }
}

Return value definitions

FieldDescription
lists[]List array.
lists[].idList ID.
lists[].last_task_idSequence for assigning a task ID.
lists[].nameList name.
lists[].descriptionList description.
lists[].ownerList owner account ID.
lists[].original1 ... Can not delete the list.
lists[].invite_codeCodes used to invite URL.
lists[].public_codeCodes used to public URL.
lists[].actioned_onDatetime last modified.
When checking update, specified in the if_modified_since.
lists[].members[]Assigned accounts ID array.
lists[].tasks[]Task array.
lists[].tasks[].idTask ID.
lists[].tasks[].parent_idParent task ID.
lists[].tasks[].nameTask name.
lists[].tasks[].status0 ... open, 1 ... start, 2 ... fixed. ( check icon )
lists[].tasks[].pending0 ... active, 1 ... pending. ( pause icon )
lists[].tasks[].closed0 ... open, 1 ... closed. ( cross icon )
lists[].tasks[].dueDue date.
lists[].tasks[].durationDay of duration.
lists[].tasks[].registrantRegistered the task by the account ID.
lists[].tasks[].requesterRequester account ID.
lists[].tasks[].assign[]Assigned accounts ID array.
lists[].tasks[].created_onDatetime of creation.
lists[].tasks[].updated_onDatetime of last modified.
lists[].tasks[].actions[]Actions array.
lists[].tasks[].actions[].idAction ID
lists[].tasks[].actions[].action
  • comment ... commented
  • reopen-task ... start of fix to open
  • start-task ... open to start
  • fix-task ... open of start to fix
  • close-task ... open or start or fix to closed
  • rereopen-task ... closed to open
  • restart-task... closed to start
  • refix-task... closed to fix
lists[].tasks[].actions[].timeAction on the time.
lists[].tasks[].actions[].account_idAction by the account ID.
lists[].tasks[].actions[].messageComment.
holidaysHolidays, key ... Date(YYYY-MM-DD), value ... Holiday name.
accountAccount information for yourself.
account.nameDisplay name.
account.iconIcon URL.
account.stateSettings for Official Web Application.
sub_accounts[]Account information for signin account.
( twitter or facebook or google )
sub_accounts[].nameDisplay name.
sub_accounts[].codeCode.
sub_accounts[].created_onDatetime of creation.
sub_accounts[].updated_onDatetime of last modified.
sub_accounts[].authenticated_onDatetime of last signin.
sub_accounts[].data.iconIcon URL.
list_idsWhen checking update, specified in the if_modified_lists.
usersInformation of the members that are assigned to the list.
users["account_id"].nameDisplay name.
users["account_id"].iconIcon URL.
modified_onDatetime of last modified.
signAccount information for signed sub account.
sign.account_idAccount ID.
sign.nameDisplay name.
sign.iconIcon URL.

/task/create

DESCRIPTION Create a task.
URL STRUCTURE https://tasks.7kai.org/api/1/task/create
METHOD POST
PARAMETERS
  • list_id * List ID.
  • name * Task name.
  • requester * Requester account ID.
  • due Due date.
  • duration Day of duration.
  • assign Assigned accounts IDs.
  • parent_id Parent Task ID.
RETURNS

User account information.

Sample JSON response

{
  "success" : 1,
  "task" : {
    "registrant" : "1",
    "closed" : 0,
    "due" : "02/11/2013",
    "actions" : [],
    "status" : 0,
    "name" : "buy the coffee.",
    "duration" : 1,
    "pending" : 0,
    "parent_id" : "",
    "updated_on" : 1360529581018,
    "last_comment_id" : 1,
    "requester" : 1,
    "created_on" : 1360529499179,
    "assign" : [
       "1",
       "2"
    ],
    "id" : "1:19"
  }
}

Return value definitions

FieldDescription
successaleady "1".
taskCreated task, see also /account/me lists[].tasks[] field.

/task/update

DESCRIPTION Update a task.
URL STRUCTURE https://tasks.7kai.org/api/1/task/update
METHOD POST
PARAMETERS
  • list_id * List ID.
  • task_id * Task ID.
  • name Task name.
  • requester Requester account ID.
  • due Due date.
  • duration Day of duration.
  • assign Assigned accounts IDs.
  • parent_id Parent Task ID.
  • status 0 ... open, 1 ... start, 2 ... fixed. ( check icon )
  • pending 0 ... active, 1 ... pending. ( pause icon )
  • closed 0 ... open, 1 ... closed. ( cross icon )
RETURNS

User account information.

Sample JSON response

{
  "success" : 1,
  "task" : {
    "registrant" : "1",
    "closed" : 0,
    "due" : "02/11/2013",
    "actions" : [],
    "status" : 0,
    "name" : "buy the coffee.",
    "duration" : 1,
    "pending" : 0,
    "parent_id" : "",
    "updated_on" : 1360529581018,
    "last_comment_id" : 1,
    "requester" : 1,
    "created_on" : 1360529499179,
    "assign" : [
      "1",
      "2"
    ],
    "id" : "1:19"
  }
}

Return value definitions

FieldDescription
successaleady "1".
taskCreated task, see also /account/me lists[].tasks[] field.

/task/move

DESCRIPTION Move a task to another list.
URL STRUCTURE https://tasks.7kai.org/api/1/task/move
METHOD POST
PARAMETERS
  • src_list_id * From List ID.
  • dst_list_id * To List ID.
  • task_id * Task ID.
RETURNS

User account information.

Sample JSON response

{
  "success" : 1,
  "tasks" : [
    {
      "registrant" : "1",
      "closed" : 0,
      "due" : "02/11/2013",
      "actions" : [],
      "status" : 0,
      "name" : "buy the coffee.",
      "duration" : 1,
      "pending" : 0,
      "parent_id" : "",
      "updated_on" : 1360529581018,
      "last_comment_id" : 1,
      "requester" : 1,
      "created_on" : 1360529499179,
      "assign" : [
        "1",
        "2"
      ],
      "id" : "1:19"
    }
  ]
}

Return value definitions

FieldDescription
successaleady "1".
tasks[]Modified tasks tree, see also /account/me lists[].tasks[] field.

/comment/create

DESCRIPTION Create a comment.
URL STRUCTURE https://tasks.7kai.org/api/1/comment/create
METHOD POST
PARAMETERS
  • list_id * List ID.
  • task_id * Task ID.
  • message * Message.
  • status 0 ... open, 1 ... start, 2 ... fixed. ( check icon )
  • closed 0 ... open, 1 ... closed. ( cross icon )
RETURNS

User account information.

Sample JSON response

{
  "success" : 1,
  "task" : {
    "registrant" : "1",
    "closed" : 0,
    "due" : "02/11/2013",
    "actions" : [],
    "status" : 0,
    "name" : "buy the coffee.",
    "duration" : 1,
    "pending" : 0,
    "parent_id" : "",
    "updated_on" : 1360529581018,
    "last_comment_id" : 1,
    "requester" : 1,
    "created_on" : 1360529499179,
    "assign" : [
      "1",
      "2"
    ],
    "id" : "1:19"
  }
}

Return value definitions

FieldDescription
successaleady "1".
taskModified task, see also /account/me lists[].tasks[] field.

/comment/delete

DESCRIPTION Delete the comment.
URL STRUCTURE https://tasks.7kai.org/api/1/comment/delete
METHOD POST
PARAMETERS
  • list_id * List ID.
  • task_id * Task ID.
  • comment_id * Action ID.
RETURNS

User account information.

Sample JSON response

{
  "success" : 1,
  "task" : {
    "registrant" : "1",
    "closed" : 0,
    "due" : "02/11/2013",
    "actions" : [],
    "status" : 0,
    "name" : "buy the coffee.",
    "duration" : 1,
    "pending" : 0,
    "parent_id" : "",
    "updated_on" : 1360529581018,
    "last_comment_id" : 1,
    "requester" : 1,
    "created_on" : 1360529499179,
    "assign" : [
      "1",
      "2"
    ],
    "id" : "1:19"
  }
}

Return value definitions

FieldDescription
successaleady "1".
taskModified task, see also /account/me lists[].tasks[] field.

/comment/pin

DESCRIPTION Attach a pin to comment.
URL STRUCTURE https://tasks.7kai.org/api/1/comment/pin
METHOD POST
PARAMETERS
  • list_id * List ID.
  • task_id * Task ID.
  • comment_id * Action ID.
RETURNS

User account information.

Sample JSON response

{
  "success" : 1,
  "task" : {
    "registrant" : "1",
    "closed" : 0,
    "due" : "02/11/2013",
    "actions" : [],
    "status" : 0,
    "name" : "buy the coffee.",
    "duration" : 1,
    "pending" : 0,
    "parent_id" : "",
    "updated_on" : 1360529581018,
    "last_comment_id" : 1,
    "requester" : 1,
    "created_on" : 1360529499179,
    "assign" : [
      "1",
      "2"
    ],
    "id" : "1:19"
  }
}

Return value definitions

FieldDescription
successaleady "1".
taskModified task, see also /account/me lists[].tasks[] field.

/comment/unpin

DESCRIPTION Remove the pin from the comment.
URL STRUCTURE https://tasks.7kai.org/api/1/comment/unpin
METHOD POST
PARAMETERS
  • list_id * List ID.
  • task_id * Task ID.
  • comment_id * Action ID.
RETURNS

User account information.

Sample JSON response

{
  "success" : 1,
  "task" : {
    "registrant" : "1",
    "closed" : 0,
    "due" : "02/11/2013",
    "actions" : [],
    "status" : 0,
    "name" : "buy the coffee.",
    "duration" : 1,
    "pending" : 0,
    "parent_id" : "",
    "updated_on" : 1360529581018,
    "last_comment_id" : 1,
    "requester" : 1,
    "created_on" : 1360529499179,
    "assign" : [
      "1",
      "2"
    ],
    "id" : "1:19"
  }
}

Return value definitions

FieldDescription
successaleady "1".
taskModified task, see also /account/me lists[].tasks[] field.