Options
All
  • Public
  • Public/Protected
  • All
Menu

Hierarchy

  • SlackOAuthClient

Index

Constructors

constructor

Properties

Readonly accessToken

accessToken: string

The access token used by the client.

Readonly axios

axios: AxiosInstance

The underlying axios instance.

Readonly chat

chat: { scheduledMessages: { list: any }; delete: any; deleteScheduledMessage: any; getPermalink: any; meMessage: any; postEphemeral: any; postMessage: any; scheduleMessage: any; unfurl: any; update: any }

chat.* APIs.

Type declaration

Readonly views

views: { open: any; publish: any; push: any; update: any }

views.* APIs.

Type declaration

  • open:function
    • Open a view for a user.

      see

      https://api.slack.com/methods/views.open

      example
      await client.views.open({
      triggerId: '12345.98765.abcd2358fdea',
      view: {
      id: 'VMHU10V25',
      teamId: 'T8N4K1JN',
      type: 'modal',
      title: {
      type: 'plain_text',
      text: 'Quite a plain modal',
      },
      submit: {
      type: 'plain_text',
      text: 'Create',
      },
      blocks: [
      {
      type: 'input',
      blockId: 'a_block_id',
      label: {
      type: 'plain_text',
      text: 'A simple label',
      emoji: true,
      },
      optional: false,
      element: {
      type: 'plain_text_input',
      actionId: 'an_action_id',
      },
      },
      ],
      privateMetadata: 'Shh it is a secret',
      callbackId: 'identify_your_modals',
      externalId: '',
      state: {
      values: [],
      },
      hash: '156772938.1827394',
      clearOnClose: false,
      notifyOnClose: false,
      },
      });

      Parameters

      Returns Promise<OAuthAPIResponse>

      Typical success response includes the opened view payload.

  • publish:function
    • Publish a static view for a User.

      see

      https://api.slack.com/methods/views.publish

      example
      await client.views.publish({
      userId: 'U0BPQUNTA',
      view: {
      id: 'VMHU10V25',
      teamId: 'T8N4K1JN',
      type: 'modal',
      title: {
      type: 'plain_text',
      text: 'Quite a plain modal',
      },
      submit: {
      type: 'plain_text',
      text: 'Create',
      },
      blocks: [
      {
      type: 'input',
      blockId: 'a_block_id',
      label: {
      type: 'plain_text',
      text: 'A simple label',
      emoji: true,
      },
      optional: false,
      element: {
      type: 'plain_text_input',
      actionId: 'an_action_id',
      },
      },
      ],
      privateMetadata: 'Shh it is a secret',
      callbackId: 'identify_your_modals',
      externalId: '',
      state: {
      values: [],
      },
      hash: '156772938.1827394',
      clearOnClose: false,
      notifyOnClose: false,
      },
      hash: '156772938.1827394,
      });

      Parameters

      Returns Promise<OAuthAPIResponse>

      Typical success response includes the published view payload.

  • push:function
    • Push a view onto the stack of a root view.

      see

      https://api.slack.com/methods/views.push

      example
      await client.views.push({
      triggerId: '12345.98765.abcd2358fdea',
      view: {
      id: 'VMHU10V25',
      teamId: 'T8N4K1JN',
      type: 'modal',
      title: {
      type: 'plain_text',
      text: 'Quite a plain modal',
      },
      submit: {
      type: 'plain_text',
      text: 'Create',
      },
      blocks: [
      {
      type: 'input',
      blockId: 'a_block_id',
      label: {
      type: 'plain_text',
      text: 'A simple label',
      emoji: true,
      },
      optional: false,
      element: {
      type: 'plain_text_input',
      actionId: 'an_action_id',
      },
      },
      ],
      privateMetadata: 'Shh it is a secret',
      callbackId: 'identify_your_modals',
      externalId: '',
      state: {
      values: [],
      },
      hash: '156772938.1827394',
      clearOnClose: false,
      notifyOnClose: false,
      },
      });

      Parameters

      Returns Promise<OAuthAPIResponse>

      Typical success response includes the pushed view payload.

  • update:function
    • Update an existing view.

      see

      https://api.slack.com/methods/views.update

      example
      await client.views.update({
      externalId: 'bmarley_view2',
      view: {
      id: 'VMHU10V25',
      teamId: 'T8N4K1JN',
      type: 'modal',
      title: {
      type: 'plain_text',
      text: 'Quite a plain modal',
      },
      submit: {
      type: 'plain_text',
      text: 'Create',
      },
      blocks: [
      {
      type: 'input',
      blockId: 'a_block_id',
      label: {
      type: 'plain_text',
      text: 'A simple label',
      emoji: true,
      },
      optional: false,
      element: {
      type: 'plain_text_input',
      actionId: 'an_action_id',
      },
      },
      ],
      privateMetadata: 'Shh it is a secret',
      callbackId: 'identify_your_modals',
      externalId: '',
      state: {
      values: [],
      },
      hash: '156772938.1827394',
      clearOnClose: false,
      notifyOnClose: false,
      },
      });

      Parameters

      Returns Promise<OAuthAPIResponse>

      Typical success response includes the updated view payload.

Methods

callMethod

getAllConversationList

getAllConversationMembers

getAllUserList

getChannelInfo

getConversationInfo

getConversationList

getConversationMembers

getUserInfo

getUserList

postEphemeral

postMessage

Static connect

Generated using TypeDoc