API Reference version 2

Actions

Add-ons can declare two types of actions: Context-sensitive actions for chat messages and input actions next to the chat input field.

API Documentation

See the API documentation for Actions

Descriptor Attribute Reference

Type Property Description Required?
string key

Unique key (in the context of the integration) to identify this action.

Valid length range: 1 - 40.

Required
string location

The location of this action

Valid values: hipchat.message.action, hipchat.input.action.

Required
object name

The display name of the action.

Required
string i18n

The optional localization key, used to look up the localized value.

Valid length range: 1 - 40.

string value

The default text.

Valid length range: 1 - 100.

Required
str | obj target

Defines how the action is handled in the client, such as opening a dialog or a sidebar.

Required
object [target, object 2]

An object with the following properties.

Required
string key

The key of a dialog, glance or web panel that should be opened in response to this action.

Valid length range: 1 - 40.

Required
object options

An object containing options which vary based on the type of target.

integer weight

Determines the order in which the action appears in menu or list.

Defaults to 100.

Conditions Reference

Message actions can be context sensitive. For example, you can choose to show actions only if a message contains a link or a certain pattern.

Type Property Description Required?
array conditions

Conditions determine whether this action is shown

A mixed array of the following types.

object [conditions array, option 1]

An object with the following properties.

Required
string condition

The identifier of a built-in condition.

Valid values: room_is_public, user_is_admin, user_is_guest, user_is_room_owner, message_matches, message_contains_link, message_sent_by_current_user, card_matches.

Required
boolean invert

A flag indicating whether to invert the boolean result of the condition.

object params

A map of key/value parameters for a built-in condition.

object [conditions array, option 2]

An object with the following properties.

Required
array conditions

The conditions to compose using the specific logical operator.

A mixed array of the following types.

Required
object [conditions array, option 1]

An object with the following properties.

Required
string condition

The identifier of a built-in condition.

Valid values: room_is_public, user_is_admin, user_is_guest, user_is_room_owner, message_matches, message_contains_link, message_sent_by_current_user, card_matches.

Required
boolean invert

A flag indicating whether to invert the boolean result of the condition.

object params

A map of key/value parameters for a built-in condition.

object [conditions array, option 2]

An object with the following properties.

Required
array conditions

The conditions to compose using the specific logical operator.

A mixed array of the following types.

Required
object [conditions array, option 1]

An object with the following properties.

Required
string condition

The identifier of a built-in condition.

Valid values: room_is_public, user_is_admin, user_is_guest, user_is_room_owner, message_matches, message_contains_link, message_sent_by_current_user, card_matches.

Required
boolean invert

A flag indicating whether to invert the boolean result of the condition.

object params

A map of key/value parameters for a built-in condition.

string type

Defines what logical operator is used to evaluate the list of conditions.

Valid values: and, or, AND, OR.

Required
string type

Defines what logical operator is used to evaluate the list of conditions.

Valid values: and, or, AND, OR.

Required