---
schema_version: "1"
id: e69141b5685aa1664a2f1faf9d08af8e98006709e785416f411ca10453cf6e69
title: Working with Action Links
collection: legacydeveloper
version: current
locale: en-us
portal_url: https://docs.salesforce.com/legacydeveloper/current/en-us/apexcode/connectapi_features_action_links.md
canonical_url: https://developer.salesforce.com/docs/atlas.en-us.apexcode.meta/apexcode/connectapi_features_action_links.htm
source_site: developer.salesforce.com
content_type: documentation
content_hash: 67349810608a0389b1cd853ea8623646e26eebe877747babbde1193a41a7409a
description: 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.
---
# Working with Action Links

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.

## Workflow

This feed item contains one action link group with one visible action link, **Join**.

![Join action link on a feed item](https://developer.salesforce.com/docs/atlas.en-us.apexcode.meta/apexcode/dev_guides/apex/images/actionlinks_join.png)

The workflow to create and post action links with a feed element:

1. (Optional) Create an [action link template](https://developer.salesforce.com/docs/atlas.en-us.apexcode.meta/apexcode/connectapi_features_action_links_overview.htm#templates).
2. Call [ConnectApi.ActionLinks.createActionLinkGroupDefinition(communityId, actionLinkGroup)](https://developer.salesforce.com/docs/atlas.en-us.264.0.apexref.meta/apexref/apex_ConnectAPI_ActionLinks_static_methods.htm#apex_ConnectAPI_ActionLinks_createActionLinkGroupDefinition_1) to define an action link group that contains at least one action link.
3. Call [ConnectApi.ChatterFeeds.postFeedElement(communityId, feedElement)](https://developer.salesforce.com/docs/atlas.en-us.264.0.apexref.meta/apexref/apex_ConnectAPI_ChatterFeeds_static_methods.htm#apex_ConnectAPI_ChatterFeeds_postFeedElement_3) to post a feed element and associate the action link with it.

Use these methods to work with action links.

<table class="featureTable sort_table" summary="">


          <thead class="thead sorted" align="left">
            <tr>
              <th class="featureTableHeader  " id="d52346e88">ConnectApi Method</th>

              <th class="featureTableHeader  " id="d52346e91">Task</th>

            </tr>

          </thead>

          <tbody class="tbody">
            <tr>
              <td class="entry" headers="d52346e88" data-title="ConnectApi Method">
                <a class="xref" href="https://developer.salesforce.com/docs/atlas.en-us.264.0.apexref.meta/apexref/apex_ConnectAPI_ActionLinks_static_methods.htm#apex_ConnectAPI_ActionLinks_createActionLinkGroupDefinition_1" target="_blank"><samp class="codeph apex_code">ActionLinks.createActionLinkGroupDefinition​(communityId,
                    actionLinkGroup)</samp></a>
                <p class="p"><a class="xref" href="https://developer.salesforce.com/docs/atlas.en-us.264.0.apexref.meta/apexref/apex_ConnectAPI_ActionLinks_static_methods.htm#apex_ConnectAPI_ActionLinks_deleteActionLinkGroupDefinition_1" target="_blank"><samp class="codeph apex_code">ActionLinks.deleteActionLinkGroupDefinition(communityId,
                      actionLinkGroupId)</samp></a></p>
                <p class="p"><a class="xref" href="https://developer.salesforce.com/docs/atlas.en-us.264.0.apexref.meta/apexref/apex_ConnectAPI_ActionLinks_static_methods.htm#apex_ConnectAPI_ActionLinks_getActionLinkGroupDefinition_1" target="_blank"><samp class="codeph apex_code">ActionLinks.getActionLinkGroupDefinition(communityId,
                      actionLinkGroupId)</samp></a></p>
              </td>

              <td class="entry" headers="d52346e91" data-title="Task">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.</td>

            </tr>

            <tr>
              <td class="entry" headers="d52346e88" data-title="ConnectApi Method"><a class="xref" href="https://developer.salesforce.com/docs/atlas.en-us.264.0.apexref.meta/apexref/apex_ConnectAPI_ChatterFeeds_static_methods.htm#apex_ConnectAPI_ChatterFeeds_postFeedElement_3" target="_blank"><samp class="codeph apex_code">ChatterFeeds.postFeedElement(communityId, feedElement)</samp></a></td>

              <td class="entry" headers="d52346e91" data-title="Task">Post a feed element with an associated actions capability. Associate up to 10
                action link groups with a feed element.</td>

            </tr>

            <tr>
              <td class="entry" headers="d52346e88" data-title="ConnectApi Method"><a class="xref" href="https://developer.salesforce.com/docs/atlas.en-us.264.0.apexref.meta/apexref/apex_ConnectAPI_ActionLinks_static_methods.htm#apex_ConnectAPI_ActionLinks_getActionLink_1" target="_blank"><samp class="codeph apex_code">ActionLinks.getActionLink(communityId, actionLinkId)</samp></a></td>

              <td class="entry" headers="d52346e91" data-title="Task">Get information about an action link, including state for the context
                user.</td>

            </tr>

            <tr>
              <td class="entry" headers="d52346e88" data-title="ConnectApi Method"><a class="xref" href="https://developer.salesforce.com/docs/atlas.en-us.264.0.apexref.meta/apexref/apex_ConnectAPI_ActionLinks_static_methods.htm#apex_ConnectAPI_ActionLinks_getActionLinkGroup_1" target="_blank"><samp class="codeph apex_code">ActionLinks.getActionLinkGroup(communityId,
                    actionLinkGroupId)</samp></a></td>

              <td class="entry" headers="d52346e91" data-title="Task">Get information about an action link group including state for the context
                user.</td>

            </tr>

            <tr>
              <td class="entry" headers="d52346e88" data-title="ConnectApi Method"><a class="xref" href="https://developer.salesforce.com/docs/atlas.en-us.264.0.apexref.meta/apexref/apex_ConnectAPI_ActionLinks_static_methods.htm#apex_ConnectAPI_ActionLinks_getActionLinkDiagnosticInfo_1" target="_blank"><samp class="codeph apex_code">ActionLinks.getActionLinkDiagnosticInfo(communityId,
                    actionLinkId)</samp></a></td>

              <td class="entry" headers="d52346e91" data-title="Task">Get diagnostic information returned when an action link executes. Diagnostic
                information is given only for users who can access the action link.</td>

            </tr>

            <tr>
              <td class="entry" headers="d52346e88" data-title="ConnectApi Method"><a class="xref" href="https://developer.salesforce.com/docs/atlas.en-us.apexcode.meta/apexcode/connectapi_examples_get_feed_elements.htm#connectapi_examples_get_feed_elements" title="Call a method to get feed elements from a feed."><samp class="codeph apex_code">ChatterFeeds.getFeedElementsFromFeed()</samp></a></td>

              <td class="entry" headers="d52346e91" data-title="Task">Get the feed elements from a specified feed type. If a feed element has action
                links associated with it, the action links data is returned in the feed element’s
                associated actions capability.</td>

            </tr>

          </tbody>

        </table>

- **[Action Links Overview, Authentication, and Security](https://developer.salesforce.com/docs/atlas.en-us.apexcode.meta/apexcode/connectapi_features_action_links_overview.htm)**  
    Learn about Apex action links security, authentication, labels, and errors.
- **[Action Links Use Case](https://developer.salesforce.com/docs/atlas.en-us.apexcode.meta/apexcode/connectapi_features_action_links_use_cases.htm)**  
    Use action links to integrate Salesforce and third-party services with a feed. An action link can make an HTTP request to a Salesforce or third-party API. An action link can also download a file or open a web page. This topic contains an example use case.

#### See Also

- [Define an Action Link and Post with a Feed Element](https://developer.salesforce.com/docs/atlas.en-us.apexcode.meta/apexcode/connectapi_examples_define_post_action_link.htm "Create one action link in an action link group, associate the action link group with a feed item, and post the feed item.")
- [Define an Action Link in a Template and Post with a Feed Element](https://developer.salesforce.com/docs/atlas.en-us.apexcode.meta/apexcode/connectapi_examples_define_post_action_link_template.htm "Create an action link and action link group and instantiate the action link group from a template.")