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.
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 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.
These methods are 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.
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.
33.0
No
public static ConnectApi.ActionLinkGroupDefinition createActionLinkGroupDefinition(String communityId, ConnectApi.ActionLinkGroupDefinitionInput actionLinkGroup)
- communityId
Type: String
ID for an Experience Cloud site,
internal, ornull.- actionLinkGroup
Type:
ConnectApi.ActionLinkGroupDefinitionInputA
ConnectApi.ActionLinkGroupDefinitionInputobject that defines the action link group.
Type: ConnectApi.ActionLinkGroupDefinition
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 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 standalone 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.
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 Connect REST API. See the Action Link resource in the Connect REST API Developer Guidefor more information.
For more information about this example, see Define an Action Link and Post with a Feed Element.
For more information about this example, see Define an Action Link in a Template and Post with a Feed Element.
Delete an action link group definition. Deleting an action link group definition removes all references to it from feed elements.
33.0
No
public static void deleteActionLinkGroupDefinition(String communityId, String actionLinkGroupId)
- communityId
Type: String
ID for an Experience Cloud site,
internal, ornull.- actionLinkGroupId
Type: String
The ID of the action link group.
Type: Void
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.
Get information about an action link, including state for the context user.
33.0
No
public static ConnectApi.PlatformAction getActionLink(String communityId, String actionLinkId)
- communityId
Type: String
ID for an Experience Cloud site,
internal, ornull.- actionLinkId
Type: String
The ID of the action link.
Type: ConnectApi.PlatformAction
Get diagnostic information returned when an action link executes. Diagnostic information is given only for users who can access the action link.
33.0
No
public static ConnectApi.ActionLinkDiagnosticInfo getActionLinkDiagnosticInfo(String communityId, String actionLinkId)
- communityId
Type: String
ID for an Experience Cloud site,
internal, ornull.- actionLinkId
Type: String
The ID of the action link.
Type: ConnectApi.ActionLinkDiagnosticInfo
Get information about an action link group including state for the context user.
33.0
No
public static ConnectApi.PlatformActionGroup getActionLinkGroup(String communityId, String actionLinkGroupId)
- communityId
Type: String
ID for an Experience Cloud site,
internal, ornull.- actionLinkGroupId
Type: String
The ID of the action link group.
Type: ConnectApi.PlatformActionGroup
All action links must belong to a group. Action links in a group are mutually exclusive and share some properties. Action link groups are accessible by clients, unlike action link group definitions.
Get information about an action link group definition.
33.0
No
public static ConnectApi.ActionLinkGroupDefinition getActionLinkGroupDefinition(String communityId, String actionLinkGroupId)
- communityId
Type: String
ID for an Experience Cloud site,
internal, ornull.- actionLinkGroupId
Type: String
The ID of the action link group.
Type: ConnectApi.ActionLinkGroupDefinition
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.