Más contenido relacionado
La actualidad más candente (10)
Similar a Copy Smallchat Arcana meetup#43 (20)
Copy Smallchat Arcana meetup#43
- 1. Slack Web API を使用して
Webページにサクッとお問合せ機能を
実装する
2018/10/25 Arcana Meetup #43 Kashiwagi Ryota
- 9. Slack Web API とは?
• Slackのワークスペースの情報を照会するインターフェースです
• こんな感じで呼び出せます
呼び出す前にtokenを取得する必要あり
- 11. メッセージを送信する
{
"ok": true,
"channel": "C1H9RESGL",
"ts": "1503435956.000247",
"message": {
"text": "Here's a message for you",
"username": "ecto1",
"bot_id": "B19LU7CSY",
"attachments": [
{
"text": "This is an attachment",
"id": 1,
"fallback": "This is an attachment's fallback"
}
],
"type": "message",
"subtype": "bot_message",
"ts": "1503435956.000247"
}
}
chat.postMessage
Method URL: https://slack.com/api/chat.postMessage
Preferred HTTP
method:
POST
Argument Example Required
token xxxx-xxxxxxxxx-xxxx Required
channel C1234567890 Required
text Hello world Required
thread_ts 1234567890.123456 Optional
- 12. メッセージを受信する
{
"messages": [
{
"type": "message",
"user": "U061F7AUR",
"text": "island",
"thread_ts": "1482960137.003543",
"reply_count": 3,
"replies": [
{
"user": "U061F7AUR",
"ts": "1483037603.017503"
},
{
"user": "U061F7AUR",
"ts": "1483051909.018632"
},
{
"user": "U061F7AUR",
"ts": "1483125339.020269"
}
],
"subscribed": true,
"last_read": "1484678597.521003",
"unread_count": 0,
"ts": "1482960137.003543"
},
{
"type": "message",
"user": "U061F7AUR",
"text": "three for the land",
"thread_ts": "1482960137.003543",
"parent_user_id": "U061F7AUR",
"ts": "1483125339.020269"
}
],
"has_more": true,
"ok": true,
"response_metadata": {
"next_cursor": "bmV4dF90czoxNDg0Njc4MjkwNTE3MDkx"
}
}
conversations.replies
Method URL: https://slack.com/api/conversations.replies
Preferred HTTP
method:
GET
Argument Example Required
token xxxx-xxxxxxxxx-xxxx Required
channel C1234567890 Required
Ts 1234567890.123456 Required