Work with Pins

The following are Apex classes for the Slack pins API methods.

Sends a request to pin an item to a channel.

Usage

See Slack’s pins.add method.

PinsAddRequest Methods

The following are methods for PinsAddRequest.

builder()

Builds a request object that's used when executing the API call.

Signature

Return Value

Type: Slack.PinsAddRequest.Builder


Contains methods to build an instance of the Slack.PinsAddRequest class.

A Builder object is obtained by invoking one of the PinsAddRequest.builder methods defined by the PinsAddRequest class.

PinsAddRequest.Builder Methods

The following are methods for PinsAddRequest.Builder. These methods are optional unless specified otherwise.

build()

Required. Returns an instance of Slack.PinsAddRequest.

Signature

Return Value

Type: Slack.PinsAddRequest

channel(channel)

Required. The channel to pin the message to.

Signature

Parameters

channel

Type: String

Return Value

Type: Slack.PinsAddRequest.Builder

file(file)

Signature

Parameters

file

Type: String

Return Value

Type: Slack.PinsAddRequest.Builder

fileComment(fileComment)

Signature

Parameters

fileComment

Type: String

Return Value

Type: Slack.PinsAddRequest.Builder

timestamp(timestamp)

Required. The timestamp for the message pinned within the conversation.

Signature

Parameters

timestamp

Type: String

Return Value

Type: Slack.PinsAddRequest.Builder


Pins an item to a channel.

Usage

See Slack’s pins.add method.

PinsAddResponse Methods

This class contains standard response methods.

The following are methods for PinsAddResponse.

getResponseMetadata()

Signature

Return Value

Type: Slack.ErrorResponseMetadata

setResponseMetadata(responseMetadata)

Signature

Parameters

responseMetadata

Type: Slack.ErrorResponseMetadata

Return Value

Type: void


Sends a request to list items that are pinned to a channel.

Usage

See Slack’s pins.list method.

PinsListRequest Methods

The following are methods for PinsListRequest.

builder()

Builds a request object that's used when executing the API call.

Signature

Return Value

Type: Slack.PinsListRequest.Builder


Contains methods to build an instance of the Slack.PinsListRequest class.

A Builder object is obtained by invoking one of the PinsListRequest.builder methods defined by the PinsListRequest class.

PinsListRequestBuilder Methods

The following are methods for PinsListRequest.Builder.

build()

Required. Returns an instance of Slack.PinsListRequest.

Signature

Return Value

Type: Slack.PinsListRequest

channel(channel)

Required. The channel to get pinned items for.

Signature

Parameters

channel

Type: String

Return Value

Type: Slack.PinsListRequest.Builder


Lists items that are pinned to a channel.

Usage

See Slack’s pins.list method.

PinsListResponse Methods

This class contains standard response methods.

The following are methods for PinsListResponse.

getItems()

Signature

Return Value

Type: List<Slack.PinsListResponse.MessageItem>

setItems(items)

Signature

Parameters

items

Type: List<Slack.PinsListResponse.MessageItem>

Return Value

Type: void


Contains methods to build an instance of the Slack.PinsListResponse class.

PinsListResponse.MessageItem Methods

The following are methods for PinsListResponse.MessageItem.

getChannel()

Signature

Return Value

Type: String

getCreatedBy()

Signature

Return Value

Type: String

getComment()

Signature

Return Value

Type: Slack.FileComment

getFile()

Signature

Return Value

Type: Slack.File

getMessage()

Signature

Return Value

Type: Slack.Message

getType()

Signature

Return Value

Type: String

setChannel(channel)

Signature

Parameters

channel

Type: String

Return Value

Type: void

setComment(comment)

Signature

Parameters

comment

Type: Slack.FileComment

Return Value

Type: void

setCreated(created)

Signature

Parameters

created

Type: Integer

Return Value

Type: void

setCreatedBy(createdBy)

Signature

Parameters

createdBy

Type: String

Return Value

Type: void

setFile(file)

Signature

Parameters

file

Type: Slack.File

Return Value

Type: void

setMessage(message)

Signature

Parameters

message

Type: Slack.Message

Return Value

Type: void

setType(type)

Signature

Parameters

type

Type: String

Return Value

Type: void


Sends a request to unpin an item from a channel.

Usage

See Slack’s pins.remove method.

PinsRemoveRequest Methods

The following are methods for PinsRemoveRequest.

builder()

Builds a request object that's used when executing the API call.

Signature

Return Value

Type: Slack.PinsRemoveRequest.Builder


Contains methods to build an instance of the Slack.PinsRemoveRequest class.

A Builder object is obtained by invoking one of the PinsRemoveRequest.builder methods defined by the PinsRemoveRequest class.

PinsRemoveRequest.Builder Methods

The following are methods for PinsRemoveRequest.Builder.

build()

Required. Returns an instance of Slack.PinsRemoveRequest.

Signature

Return Value

Type: Slack.PinsRemoveRequest

channel(channel)

Required. The channel where the item is pinned to.

Signature

Parameters

channel

Type: String

Return Value

Type: Slack.PinsRemoveRequest.Builder

file(file)

Required if fileComment(fileComment) or timestamp(timestamp) is not used.

Signature

Parameters

file

Type: String

Return Value

Type: Slack.PinsRemoveRequest.Builder

fileComment(fileComment)

Required if file(file) or timestamp(timestamp) is not used.

Signature

Parameters

fileComment

Type: String

Return Value

Type: Slack.PinsRemoveRequest.Builder

timestamp(timestamp)

Required if file(file) or fileComment(fileComment) is not used. Timestamp of the message to unpin.

Signature

Parameters

timestamp

Type: String

Return Value

Type: Slack.PinsRemoveRequest.Builder


Unpins an item to a channel.

Usage

See Slack’s pins.remove method.

PinsRemoveResponse Methods

This class contains standard response methods.