Method: ChatWork::Client::FileMethods#get_files

Defined in:
lib/chatwork/client/file_methods.rb

#get_files(room_id:, account_id:) {|response_body, response_header| ... } ⇒ Array<Hashie::Mash>

Get the list of files associated with the specified chat

Examples:

response format

[
  {
    "file_id": 3,
    "account": {
      "account_id": 123,
      "name": "Bob",
      "avatar_image_url": "https://example.com/ico_avatar.png"
    },
    "message_id": "22",
    "filename": "README.md",
    "filesize": 2232,
    "upload_time": 1384414750
  }
]

Parameters:

  • room_id (Integer)
  • account_id (Integer)

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:



31
32
33
# File 'lib/chatwork/client/file_methods.rb', line 31

def get_files(room_id:, account_id:, &block)
  get("/rooms/#{room_id}/files", account_id: , &block)
end