Work with Response Metadata

The following are Apex classes to work with response metadata for errors and warnings. Slack returns response metadata as part of the Web API calls, which are helpful for debugging or error handling. Detailed errors and warnings are returned in the messages field in the response metadata.

Represents response metadata from a Slack Web API call.

When receiving a response from Slack's API call, use getResponseMetadata().getMessages() to retrieve any error messages. This example shows how to retrieve the error messages from Slack.ChatPostMessageResponse.

The following are methods for ResponseMetadata.

Signature

Return Value

Type: List<String>

Responses include the next_cursor value to navigate through additional results. See Paginating through collections.

Signature

Return Value

Type: String

Signature

Return Value

Type: Slack.ResponseMetadata

Signature

Return Value

Type: List<String>

Signature

Parameters

messages

Type: List<String>

Return Value

Type: void

Signature

Parameters

messages

Type: String

Return Value

Type: void

Signature

Parameters

responseMetadata

Type: Slack.ResponseMetadata

Return Value

Type: void

Signature

Parameters

warnings

Type: List<String>

Return Value

Type: void

Represents response metadata for an error.

The following are methods for ErrorResponseMetadata.

Signature

Return Value

Type: List<String>

Signature

Parameters

messages

Type: List<String>

Return Value

Type: void

Represents response metadata for a warning.

The following are methods for WarningResponseMetadata.

Signature

Return Value

Type: List<String>

Parameters

warnings

Type: List<String>

Return Value

Type: void