ActionLinks Class

Create, delete, and get information about an action link group definition; get information about an action link group; get action link diagnostic information.

Namespace

ConnectApi

Usage

An action link is a button on a feed element. Clicking an action link can take a user to a Web page, initiate a file download, or invoke an API call to Salesforce or to an external server. An action link includes a URL and an HTTP method, and can include a request body and header information, such as an OAuth token for authentication. Use action links to integrate Salesforce and third-party services into the feed so that users can take action to drive productivity and accelerate innovation.

There are two views of an action link and an action link group: the definition, and the context user’s view. The definition includes potentially sensitive information, such as authentication information. The context user’s view is filtered by visibility options and the values reflect the state of the context user.

Action link definition can be sensitive to a third party (for example, OAuth bearer token headers). For this reason, only calls made from the Apex namespace that created the action link definition can read, modify, or delete the definition. In addition, the user making the call must have created the definition or have “View All Data” permission. Use these methods to operate on action link group definitions (which contain action link definitions):
  • createActionLinkGroupDefinition(communityId, actionLinkGroup)
  • deleteActionLinkGroupDefinition(communityId, actionLinkGroupId)
  • getActionLinkGroupDefinition(communityId, actionLinkGroupId)
Use these methods to operate on a context user’s view of an action link or an action link group:
  • getActionLink(communityId, actionLinkId)
  • getActionLinkGroup(communityId, actionLinkGroupId)
  • getActionLinkDiagnosticInfo(communityId, actionLinkId)

For information about how to use action links, see Working with Action Links.

ActionLinks Methods

The following are methods for ActionLinks. All methods are static.

  • createActionLinkGroupDefinition(communityId, actionLinkGroup)
    Create an action link group definition. To associate an action link group with a feed element, first create an action link group definition. Then post a feed element with an associated actions capability.
  • deleteActionLinkGroupDefinition(communityId, actionLinkGroupId)
    Delete an action link group definition. Deleting an action link group definition removes all references to it from feed elements.
  • getActionLink(communityId, actionLinkId)
    Get information about an action link, including state for the context user.
  • getActionLinkDiagnosticInfo(communityId, actionLinkId)
    Get diagnostic information returned when an action link executes. Diagnostic information is given only for users who can access the action link.
  • getActionLinkGroup(communityId, actionLinkGroupId)
    Get information about an action link group including state for the context user.
  • getActionLinkGroupDefinition(communityId, actionLinkGroupId)
    Get information about an action link group definition.

createActionLinkGroupDefinition(communityId, actionLinkGroup)

Create an action link group definition. To associate an action link group with a feed element, first create an action link group definition. Then post a feed element with an associated actions capability.

API Version

33.0

Requires Chatter

No

Signature

public static ConnectApi.ActionLinkGroupDefinition createActionLinkGroupDefinition(String communityId, ConnectApi.ActionLinkGroupDefinitionInput actionLinkGroup)

Parameters

communityId
Type: String
Use either the ID for a community, internal, or null.
actionLinkGroup
Type: ConnectApi.ActionLinkGroupDefinitionInput
A ConnectApi.ActionLinkGroupDefinitionInput object that defines the action link group.

Return Value

Type: ConnectApi.ActionLinkGroupDefinition

Usage

An action link is a button on a feed element. Clicking an action link can take a user to a Web page, initiate a file download, or invoke an API call to Salesforce or to an external server. An action link includes a URL and an HTTP method, and can include a request body and header information, such as an OAuth token for authentication. Use action links to integrate Salesforce and third-party services into the feed so that users can take action to drive productivity and accelerate innovation.

All action links must belong to a group. Action links in a group are mutually exclusive and share some properties. Define stand-alone actions in their own action group.

Information in the action link group definition can be sensitive to a third party (for example, OAuth bearer token headers). For this reason, only calls made from the Apex namespace that created the action link group definition can read, modify, or delete the definition. In addition, the user making the call must have created the definition or have “View All Data” permission.

Note

Note

Invoking ApiAsync action links from an app requires a call to set the status. However, there isn’t currently a way to set the status of an action link using Apex. To set the status, use Chatter REST API. See the Action Link resource in the Chatter REST API Developer's Guide for more information.

See Also:

  • Define an Action Link and Post with a Feed Element

deleteActionLinkGroupDefinition(communityId, actionLinkGroupId)

Delete an action link group definition. Deleting an action link group definition removes all references to it from feed elements.

API Version

33.0

Requires Chatter

No

Signature

public static void deleteActionLinkGroupDefinition(String communityId, String actionLinkGroupId)

Parameters

communityId
Type: String
Use either the ID for a community, internal, or null.
actionLinkGroupId
Type: String
The ID of the action link group.

Return Value

Type: Void

Usage

Information in the action link group definition can be sensitive to a third party (for example, OAuth bearer token headers). For this reason, only calls made from the Apex namespace that created the action link group definition can read, modify, or delete the definition. In addition, the user making the call must have created the definition or have “View All Data” permission.

getActionLink(communityId, actionLinkId)

Get information about an action link, including state for the context user.

API Version

33.0

Requires Chatter

No

Signature

public static ConnectApi.PlatformAction getActionLink(String communityId, String actionLinkId)

Parameters

communityId
Type: String
Use either the ID for a community, internal, or null.
actionLinkId
Type: String
The ID of the action link.

Return Value

Type: ConnectApi.PlatformAction

getActionLinkDiagnosticInfo(communityId, actionLinkId)

Get diagnostic information returned when an action link executes. Diagnostic information is given only for users who can access the action link.

API Version

33.0

Requires Chatter

No

Signature

public static ConnectApi.ActionLinkDiagnosticInfo getActionLinkDiagnosticInfo(String communityId, String actionLinkId)

Parameters

communityId
Type: String
Use either the ID for a community, internal, or null.
actionLinkId
Type: String
The ID of the action link.

Return Value

Type: ConnectApi.ActionLinkDiagnosticInfo

getActionLinkGroup(communityId, actionLinkGroupId)

Get information about an action link group including state for the context user.

API Version

33.0

Requires Chatter

No

Signature

public static ConnectApi.PlatformActionGroup getActionLinkGroup(String communityId, String actionLinkGroupId)

Parameters

communityId
Type: String
Use either the ID for a community, internal, or null.
actionLinkGroupId
Type: String
The ID of the action link group.

Return Value

Type: ConnectApi.PlatformActionGroup

Usage

All action links must belong to a group. Action links in a group are mutually exclusive and share some properties. Note that action link groups are accessible by clients, unlike action link group definitions.

getActionLinkGroupDefinition(communityId, actionLinkGroupId)

Get information about an action link group definition.

API Version

33.0

Requires Chatter

No

Signature

public static ConnectApi.ActionLinkGroupDefinition getActionLinkGroupDefinition(String communityId, String actionLinkGroupId)

Parameters

communityId
Type: String
Use either the ID for a community, internal, or null.
actionLinkGroupId
Type: String
The ID of the action link group.

Return Value

Type: ConnectApi.ActionLinkGroupDefinition

Usage

Information in the action link group definition can be sensitive to a third party (for example, OAuth bearer token headers). For this reason, only calls made from the Apex namespace that created the action link group definition can read, modify, or delete the definition. In addition, the user making the call must have created the definition or have “View All Data” permission.