Skip to content

Instantly share code, notes, and snippets.

@astronaughts
Last active December 31, 2015 19:39
Show Gist options
  • Save astronaughts/8034855 to your computer and use it in GitHub Desktop.
Save astronaughts/8034855 to your computer and use it in GitHub Desktop.
-- クエリ文字列から roomid を取得
local roomid = request.query.roomid
-- http.request で ChatWork API で指定したルームにメッセージを送信
local response = http.request {
method = 'POST',
url = 'https://api.chatwork.com/v1/rooms/'..roomid..'/messages',
headers = {
-- ChatWork API の token を指定
['X-ChatWorkToken'] = 'YOUR_TOKEN'
},
params = {
-- メッセージ内容を指定
body = 'webscript からテスト'
}
}
-- 成功したら Status 200 を返す
return 200
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment