{"templateId":"GuidePage","sharedDataIds":{"sidebar":"sidebar-miniapps/sidebars.yaml"},"props":{"metadata":{"markdoc":{"tagList":[]},"type":"markdown"},"seo":{"title":"Slack","description":"Developer API, partner integration, MCP, SDK, and customer help center.","llmstxt":{"hide":false,"sections":[{"title":"Table of contents","includeFiles":["**/*"],"excludeFiles":[]}],"excludeFiles":[]}},"dynamicMarkdocComponents":[],"compilationErrors":[],"ast":{"$$mdtype":"Tag","name":"article","attributes":{},"children":[{"$$mdtype":"Tag","name":"Heading","attributes":{"level":1,"id":"slack","__idx":0},"children":["Slack"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["A communication platform with bearer token auth, composite event extraction, challenge response, 10 actions, 8 triggers, and RPC sources."]},{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"data-language":"javascript","header":{"controls":{"copy":{}}},"source":"const slackMiniApp = {\n  ns: 'slack',\n  name: 'slack',\n  type: 'slack',\n  title: 'Slack',\n  label: 'Slack',\n  description: 'Send messages, manage channels, and receive event triggers.',\n  shortDescription: 'Team messaging & channel management',\n  status: 'public',\n  version: '1.0.0',\n  category: 'communication',\n  icon: 'https://cdn.karzoun.com/miniapps/slack/icon.svg',\n  logo: 'https://cdn.karzoun.com/miniapps/slack/logo.svg',\n  docsUrl: 'https://api.slack.com/docs',\n\n  auth: {\n    type: 'bearer_token',\n    sensitiveKeys: ['accessToken'],\n    config: { accessToken: '' },\n    userDetails: {\n      url: 'https://slack.com/api/auth.test',\n      method: 'POST',\n      headers: {\n        Authorization: 'Bearer [[accessToken]]',\n        'Content-Type': 'application/json',\n      },\n      bodyType: 'json',\n      body: {},\n      mapping: { uid: '$.user_id', name: '$.user' },\n    },\n  },\n\n  // Dynamic data sources for dropdowns\n  source: {\n    rpc_channels_list: {\n      url: 'https://slack.com/api/conversations.list?limit=1000&types=public_channel,private_channel',\n      method: 'GET',\n      headers: { Authorization: 'Bearer [[accessToken]]' },\n      dataPath: 'channels',\n      valueField: 'id',\n      labelField: 'name',\n    },\n    rpc_users_list: {\n      url: 'https://slack.com/api/users.list?limit=1000',\n      method: 'GET',\n      headers: { Authorization: 'Bearer [[accessToken]]' },\n      dataPath: 'members',\n      valueField: 'id',\n      labelField: 'profile.real_name',\n    },\n  },\n\n  triggers: [\n    { type: 'miniapps:slack', event: 'message.posted', icon: 'comment-1',\n      label: 'Message Posted', description: 'New message in a channel', isCustom: false, img: 'automation3.svg' },\n    { type: 'miniapps:slack', event: 'reaction.added', icon: 'heart-1',\n      label: 'Reaction Added', description: 'Emoji reaction on a message', isCustom: false, img: 'automation3.svg' },\n    // ... more triggers\n  ],\n\n  actions: [\n    // Simple single-request action with RPC source\n    {\n      name: 'postMessage',\n      title: 'Post Message',\n      description: 'Post a message to a Slack channel',\n      renderStrategy: 'auto',\n      parameters: {\n        type: 'object',\n        required: ['channel', 'text'],\n        properties: {\n          channel: {\n            type: 'string',\n            title: 'Channel',\n            'x-source': 'rpc_channels_list',\n            'x-fallback': 'input',\n          },\n          text: { type: 'string', title: 'Message Text' },\n        },\n      },\n      requests: [{\n        url: 'https://slack.com/api/chat.postMessage',\n        method: 'POST',\n        headers: {\n          Authorization: 'Bearer [[accessToken]]',\n          'Content-Type': 'application/json',\n        },\n        bodyType: 'json',\n        body: { channel: '{{channel}}', text: '{{text}}' },\n        mapping: { channelId: '$.channel', messageTs: '$.ts' },\n      }],\n    },\n\n    // Multi-request chained action\n    {\n      name: 'sendDirectMessage',\n      title: 'Send Direct Message',\n      description: 'Open a DM and send a message to a user',\n      renderStrategy: 'auto',\n      parameters: {\n        type: 'object',\n        required: ['userId', 'messageText'],\n        properties: {\n          userId: {\n            type: 'string',\n            title: 'User',\n            'x-source': 'rpc_users_list',\n            'x-fallback': 'input',\n          },\n          messageText: { type: 'string', title: 'Message' },\n        },\n      },\n      requests: [\n        // Step 1: Open the DM channel\n        {\n          url: 'https://slack.com/api/conversations.open',\n          method: 'POST',\n          headers: {\n            Authorization: 'Bearer [[accessToken]]',\n            'Content-Type': 'application/json',\n          },\n          bodyType: 'json',\n          body: { users: '{{userId}}' },\n          mapping: [\n            { name: 'dmChannelId', value: '$.channel.id' },\n          ],\n        },\n        // Step 2: Send message to the DM channel\n        {\n          url: 'https://slack.com/api/chat.postMessage',\n          method: 'POST',\n          headers: {\n            Authorization: 'Bearer [[accessToken]]',\n            'Content-Type': 'application/json',\n          },\n          bodyType: 'json',\n          body: {\n            channel: '{{dmChannelId}}',   // From step 1\n            text: '{{messageText}}',       // From user input\n          },\n          mapping: { messageTs: '$.ts', channelId: '$.channel' },\n        },\n      ],\n    },\n  ],\n\n  // Webhook configuration\n  webhook: {\n    eventExtraction: {\n      source: 'body',\n      path: '$.event.type',\n      compositeStrategy: {\n        parts: [\n          { source: 'body', path: '$.event.type' },\n          { source: 'body', path: '$.event.subtype' },\n        ],\n        separator: '.',\n      },\n    },\n    transactionId: { path: '$.event_id', fallback: 'generate' },\n    verification: {\n      type: 'hmac-sha256',\n      headerName: 'X-Slack-Signature',\n      secretKey: 'signingSecret',    // Resolves from credentials (per-workspace secret)\n    },\n    response: { statusCode: 200, body: { ok: true } },\n    challengeResponse: {\n      identifyField: 'type',\n      identifyValue: 'url_verification',\n      challengePath: '$.challenge',\n      responseField: 'challenge',\n    },\n  },\n};\n","lang":"javascript"},"children":[]}]},"headings":[{"value":"Slack","id":"slack","depth":1}],"frontmatter":{"title":"Slack example","titleTranslationKey":"sidebar.miniapps.exampleSlack","audience":"developer","status":"published","locales":["en"],"template":"GuidePage","seo":{"title":"Slack"}},"lastModified":"2026-06-23T12:06:12.000Z","pagePropGetterError":{"message":"","name":""}},"slug":"/miniapps/examples/slack","userData":{"isAuthenticated":false,"teams":["anonymous"]},"isPublic":true}