An Interest In:
Web News this Week
- April 27, 2024
- April 26, 2024
- April 25, 2024
- April 24, 2024
- April 23, 2024
- April 22, 2024
- April 21, 2024
March 28, 2022 10:59 pm GMT
Original Link: https://dev.to/kaede_io/gas-no-urlfetchapp-de-slack-api-no-conversationslist-dequan-tenotiyannerurisutowoqu-de-suru-2l2b
GAS UrlFetchApp Slack API conversations.list
GAS
getSlackChByName
Slack API Doc
api.slack.com Slack API
https://api.slack.com/messaging/retrieving#finding_conversation
const { WebClient, LogLevel } = require("@slack/web-api");
GAS npm
conversations.list
https://api.slack.com/methods/conversations.list
GET
https://slack.com/api/conversations.list
API
https://qiita.com/seratch/items/2158cb0abed5b8e12809
payload
function callWebApi(token, apiMethod) { const response = UrlFetchApp.fetch( `https://www.slack.com/api/${apiMethod}`, { method: "post", contentType: "application/x-www-form-urlencoded", headers: { "Authorization": `Bearer ${token}` }, } ); console.log(`Web API (${apiMethod}) response: ${response}`) return response;}
UrlFetchApp GAS fetch
apiMethod GET/POST Slack API Method
Slack Workspace Slack API Method
const token = "xoxp-1234"const apiResponse = callWebApi(token, "conversations.list");
Slack conversations.list Slack API Method
GAS
Web API (conversations.list) response: { "ok":true,"channels":[ {"id":"C0385KDLRD5","name":"making-bot",... }, {"id":"C038L782V3M","name":"random",... }, {"id":"C038NHHFN3E","name":"general",...}, "response_metadata":{"next_cursor":""},}
json
random general, making-bot,
making-bot
"name":"making-bot","is_channel":true,"is_group":false,"is_im":false,"is_mpim":false,"is_private":false,"created":1648155092,"is_archived":false,"is_general":false,"unlinked":0,"name_normalized":"making-bot","is_shared":false,"is_org_shared":false,"is_pending_ext_shared":false,"pending_shared":[],"parent_conversation":null,"creator":"U038DHKP87Q","is_ext_shared":false,"shared_team_ids":["T038NHHEJJY"],"pending_connected_team_ids":[],"is_member":true,
Slack API
DM
Slack DogAPI Twitter API
Original Link: https://dev.to/kaede_io/gas-no-urlfetchapp-de-slack-api-no-conversationslist-dequan-tenotiyannerurisutowoqu-de-suru-2l2b
Share this article:
Tweet
View Full Article
Dev To
An online community for sharing and discovering great ideas, having debates, and making friendsMore About this Source Visit Dev To