Module: ChatWork::Client::MyTaskMethods

Included in:
ChatWork::Client
Defined in:
lib/chatwork/client/my_task_methods.rb

Instance Method Summary collapse

Instance Method Details

#get_my_tasks(assigned_by_account_id: nil, status: nil) {|response_body, response_header| ... } ⇒ Array<Hashie::Mash>

Get the list of all unfinished tasks

(*This method returns up to 100 entries. We are planning to implement pagination to support larger number of data retrieval)

Examples:

response format

[
  {
    "task_id": 3,
    "room": {
      "room_id": 5,
      "name": "Group Chat Name",
      "icon_path": "https://example.com/ico_group.png"
    },
    "assigned_by_account": {
      "account_id": 456,
      "name": "Anna",
      "avatar_image_url": "https://example.com/def.png"
    },
    "message_id": "13",
    "body": "buy milk",
    "limit_time": 1384354799,
    "status": "open"
  }
]

Parameters:

  • assigned_by_account_id (Integer) (defaults to: nil)

    Account ID of the person who assigned task

  • status (String) (defaults to: nil)

    Task status (open, done)

Yields:

  • (response_body, response_header)

    if block was given, return response body and response header through block arguments

Yield Parameters:

  • response_body (Array<Hashie::Mash>)

    response body

  • response_header (Hash<String, String>)

    response header (e.g. X-RateLimit-Limit, X-RateLimit-Remaining, X-RateLimit-Reset)

Returns:

  • (Array<Hashie::Mash>)

See Also:



38
39
40
# File 'lib/chatwork/client/my_task_methods.rb', line 38

def get_my_tasks(assigned_by_account_id: nil, status: nil, &block)
  get("/my/tasks", assigned_by_account_id: , status: status, &block)
end