2025/04/03 APIリクエストの仕様変更についてのお知らせ

[English below]

いつもChatworkをご利用いただき、誠にありがとうございます。
このたび、Chatwork APIについて以下の仕様変更を行いますのでお知らせします。

  1. POSTおよびPUTメソッドの操作についてクエリパラメーターを受け付けなくなります
  2. method パラメーターによるHTTPメソッドの指定を廃止します

変更予定日

2025年7月3日(木)

変更点

1. POSTおよびPUTメソッドの操作についてクエリパラメーターを受け付けなくなります

現在、以下のエンドポイントではボディパラメーターおよびクエリパラメーターの両方のリクエストを受け付けていますが、仕様変更後はボディパラメーター(application/x-www-form-urlencoded)の項目のみを読み取るようになります。

たとえば、以下のようにクエリパラメーターのみを持つリクエストではメッセージを投稿することはできなくなります。

$ curl -X POST 'https://api.chatwork.com/v2/rooms/***/messages?body=hello' \
       -H 'x-chatworktoken: ***' -i
HTTP/2 400
content-type: application/json; charset=utf-8
content-length: 43
date: Wed, 1 Jan 2025 00:00:00 GMT
x-ratelimit-reset: 1735689900
x-ratelimit-remaining: 300
x-ratelimit-limit: 300

{"errors":["Parameter 'body' is required"]}

このリクエストは、以下のようにボディパラメーターを使用するよう修正する必要があります。

$ curl -X POST 'https://api.chatwork.com/v2/rooms/***/messages' \
       -d 'body=hello' \
       -H 'x-chatworktoken: ***' -i
HTTP/2 200
content-type: application/json; charset=utf-8
content-length: 36
date: Wed, 1 Jan 2025 00:00:00 GMT
x-ratelimit-reset: 1735689900
x-ratelimit-remaining: 300
x-ratelimit-limit: 300

{"message_id":"1928374655918273645"}

2. method パラメーターによるHTTPメソッドの指定を廃止します

現在、method というパラメーターにHTTPメソッドを指定することで実際のHTTPリクエストのものとは異なる操作を要求することができますが、 method パラメーターを廃止します。
たとえば、以下のように method=GET を指定してメッセージを取得することはできなくなります。

$ curl -X POST 'https://api.chatwork.com/v2/rooms/1/messages/1928374655918273645' \
       -d 'method=GET' \
       -H 'x-chatworktoken: ***' -i
HTTP/2 400
content-type: application/json; charset=utf-8
content-length: 46
date: Wed, 1 Jan 2025 00:00:00 GMT
x-ratelimit-reset: 1735689900
x-ratelimit-remaining: 300
x-ratelimit-limit: 300

{"errors":["Invalid Endpoint or HTTP method"]}

このリクエストは、以下のように正しいHTTPメソッドを指定するよう修正する必要があります。

$ curl -X GET 'https://api.chatwork.com/v2/rooms/1/messages/1928374655918273645' \
       -H 'x-chatworktoken: ***' -i
HTTP/2 200
content-type: application/json; charset=utf-8
content-length: 161
date: Wed, 1 Jan 2025 00:00:00 GMT
x-ratelimit-reset: 1735689900
x-ratelimit-remaining: 300
x-ratelimit-limit: 300

{"message_id":"1928374655918273645","account":{"account_id":1,"name":"your name","avatar_image_url":"***"},"body":"hello","send_time":1735689600,"update_time":0}

対象の方法でChatwork APIをご利用中のお客様について

仕様変更日までに、変更点に記載の通りAPIのリクエスト方法を修正してください。
修正を行わなかった場合、廃止された方法でのAPIリクエストはエラーになりご利用いただけなくなります。



本件について不明点などがありましたら、下記よりお問い合わせください。
お問い合わせフォーム

ご利用中のお客さまには、大変お手数をおかけします。
今後とも、Chatworkをどうぞよろしくお願いいたします。


04/03/2025 Notice of changes to API requests


Thank you for using Chatwork.

We would like to inform you of the following changes to Chatwork APIs.

  1. Query parameters will no longer be accepted for POST and PUT method operations.

  2. Specification of HTTP method using the method parameter will be obsoleted.

Scheduled date of change

July 3rd, 2025 (Thursday)

Changelog

1. Query parameters will no longer be accepted for POST and PUT method operations.

Currently, the following APIs accept requests with both body and query parameters, but from July 3rd, 2025 (Thursday), only body parameter items will be read.

  • Creating group chats
  • Editing chat information
  • Editing chat members
  • Posting messages in chats
  • Setting messages to read in chats
  • Setting messages to unread in chats
  • Updating chat messages
  • Adding tasks to chats
  • Changing completion status of tasks in chats
  • Creating chat invitation links
  • Editing chat invitation links

As an example, it is no longer possible to post a message using a request with only a query parameter, as shown below.

$ curl -X POST '<https://api.chatwork.com/v2/rooms/**_/messages?body=hello'>  
       -H 'x-chatworktoken: \_\*\*' -i  
HTTP/2 400  
content-type: application/json; charset=utf-8  
content-length: 43  
date: Wed, 1 Jan 2025 00:00:00 GMT  
x-ratelimit-reset: 1735689900  
x-ratelimit-remaining: 300  
x-ratelimit-limit: 300  

{"errors":["Parameter 'body' is required"]}

This request must be modified to have a body parameter as follows.

$ curl -X POST '<https://api.chatwork.com/v2/rooms/**_/messages'>  
       -d 'body=hello'  
       -H 'x-chatworktoken: \_\*\*' -i  
HTTP/2 200  
content-type: application/json; charset=utf-8  
content-length: 36  
date: Wed, 1 Jan 2025 00:00:00 GMT  
x-ratelimit-reset: 1735689900  
x-ratelimit-remaining: 300  
x-ratelimit-limit: 300

{"message_id":"1928374655918273645"}

2. Specification of HTTP method using the method parameter will be obsoleted

Currently, it is possible to request an operation different from the actual HTTP request by specifying an HTTP method in the method parameter, but the method parameter will be obsoleted on July 3rd, 2025 (Thursday).

As an example, it will no longer be possible to retrieve messages by specifying method=GET as follows.

$ curl -X POST '<https://api.chatwork.com/v2/rooms/1/messages/1928374655918273645'>  
       -d 'method=GET'  
       -H 'x-chatworktoken: \*\*\*' -i  
HTTP/2 400  
content-type: application/json; charset=utf-8  
content-length: 46  
date: Wed, 1 Jan 2025 00:00:00 GMT  
x-ratelimit-reset: 1735689900  
x-ratelimit-remaining: 300  
x-ratelimit-limit: 300  

{"errors":["Invalid Endpoint or HTTP method"]}  

This request must be modified to specify the correct HTTP method as follows.

$ curl -X GET 'https://api.chatwork.com/v2/rooms/1/messages/1928374655918273645' \
       -H 'x-chatworktoken: ***' -i
HTTP/2 200
content-type: application/json; charset=utf-8
content-length: 161
date: Wed, 1 Jan 2025 00:00:00 GMT
x-ratelimit-reset: 1735689900
x-ratelimit-remaining: 300
x-ratelimit-limit: 300

{"message_id":"1928374655918273645","account":{"account_id":1,"name":"your name","avatar_image_url":"***"},"body":"hello","send_time":1735689600,"update_time":0}

For customers using Chatwork APIs with the specified methods

Please modify the API request method as described in the changelog before the date of the specification change.

Failure to modify the API request method will result in errors when making API requests using the obsoleted method.



If you have any questions about this matter, please contact us using the following link.

Inquiry Form


We apologize for any inconvenience this may cause to our customers.

Thank you for your continued support of Chatwork.