Chatwork Files API

The Files API from Chatwork — 2 operation(s) for files.

OpenAPI Specification

chatwork-files-api-openapi.yml Raw ↑
openapi: 3.1.0
info:
  title: Chatwork API v2 Contacts Files API
  version: '2'
  description: 'REST API for Chatwork business messaging. Authentication uses an API

    token sent in the X-ChatWorkToken HTTP header, or OAuth 2.0 for third-

    party integrations. Endpoint inventory sourced from the official

    developer documentation index at https://developer.chatwork.com/llms.txt.

    '
  contact:
    name: Chatwork Developer Portal
    url: https://developer.chatwork.com
servers:
- url: https://api.chatwork.com/v2
security:
- chatworkToken: []
tags:
- name: Files
paths:
  /rooms/{room_id}/files:
    parameters:
    - in: path
      name: room_id
      required: true
      schema:
        type: integer
    get:
      tags:
      - Files
      summary: List files in a room
      operationId: listRoomFiles
      parameters:
      - in: query
        name: account_id
        schema:
          type: integer
      responses:
        '200':
          description: Files
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/File'
    post:
      tags:
      - Files
      summary: Upload a file to a room
      operationId: uploadRoomFile
      requestBody:
        required: true
        content:
          multipart/form-data:
            schema:
              type: object
              required:
              - file
              properties:
                file:
                  type: string
                  format: binary
                message:
                  type: string
      responses:
        '200':
          description: Uploaded
          content:
            application/json:
              schema:
                type: object
                properties:
                  file_id:
                    type: integer
  /rooms/{room_id}/files/{file_id}:
    parameters:
    - in: path
      name: room_id
      required: true
      schema:
        type: integer
    - in: path
      name: file_id
      required: true
      schema:
        type: integer
    get:
      tags:
      - Files
      summary: Retrieve file metadata or download URL
      operationId: getRoomFile
      parameters:
      - in: query
        name: create_download_url
        schema:
          type: integer
          enum:
          - 0
          - 1
      responses:
        '200':
          description: File metadata
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/File'
components:
  schemas:
    File:
      type: object
      properties:
        file_id:
          type: integer
        account:
          type: object
          properties:
            account_id:
              type: integer
            name:
              type: string
            avatar_image_url:
              type: string
              format: uri
        message_id:
          type: string
        filename:
          type: string
        filesize:
          type: integer
        upload_time:
          type: integer
          format: int64
        download_url:
          type: string
          format: uri
  securitySchemes:
    chatworkToken:
      type: apiKey
      in: header
      name: X-ChatWorkToken
      description: API token issued from your Chatwork account settings.