From fbe4ed7e11f96a696b0366c8c3bb1fc188653604 Mon Sep 17 00:00:00 2001 From: sue445 Date: Fri, 27 Jan 2017 18:23:07 +0900 Subject: [PATCH 1/2] Update API version (v2) API update support for May 2017 http://help.chatwork.com/hc/ja/articles/115000019401 --- api.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/api.go b/api.go index 88dd61b..953e186 100644 --- a/api.go +++ b/api.go @@ -6,7 +6,7 @@ import ( ) // BaseURL ChatWork API endpooint URL -const BaseURL = `https://api.chatwork.com/v1` +const BaseURL = `https://api.chatwork.com/v2` // Me model type Me struct { From b491ccb189809b711aafdfa6ef8369cee904e55f Mon Sep 17 00:00:00 2001 From: sue445 Date: Fri, 27 Jan 2017 23:30:12 +0900 Subject: [PATCH 2/2] Change message_id type to string --- api.go | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/api.go b/api.go index 953e186..72a395e 100644 --- a/api.go +++ b/api.go @@ -211,7 +211,7 @@ type Account struct { // Message model type Message struct { - MessageID int `json:"message_id"` + MessageID string `json:"message_id"` Account Account `json:"account"` Body string `json:"body"` SendTime int64 `json:"send_time"` @@ -261,7 +261,7 @@ type Task struct { TaskID int `json:"task_id"` Account Account `json:"account"` AssignedByAccount Account `json:"assigned_by_account"` - MessageID int `json:"message_id"` + MessageID string `json:"message_id"` Body string `json:"body"` LimitTime int64 `json:"limit_time"` Status string `json:"status"` @@ -309,7 +309,7 @@ func (c *Client) RoomTask(roomID, taskID string) (task Task, err error) { type File struct { FileID int `json:"file_id"` Account Account `json:"account"` - MessageID int `json:"message_id"` + MessageID string `json:"message_id"` Filename string `json:"filename"` Filesize int `json:"filesize"` UploadTime int64 `json:"upload_time"`