No Results
Search Tips:
- Please consider misspellings
- Try different search keywords
Newer Version Available
Action Link Group Definitions
An action link is an indicator on a feed element that targets an API, a Web page, or a file and is represented by a button in the Salesforce Chatter feed UI. An action link includes an HTTP method and can include header information, such as a bearer token for authentication. Use action links to integrate Salesforce and third-party systems into the feed.
This image shows a feed element with one action link group containing two action links:
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. Because information in the action link group definition can be sensitive to a third party (for example, OAuth bearer token headers), only requests made via the connected app that created the action link group definition can read or modify information about the definition.
- Resource
1/connect/action-link-group-definitions- Available since release
- 31.0
- Requires Chatter
- No
- HTTP methods
- POST
The Action Link Group Definitions resource doesn’t support query parameters for POST. You must use the following Action Link Group Definition Input request body.
- Request body for POST
- Root XML tag
- <actionLinkGroup>
- JSON example
1{ 2 "actionLinks": [ 3 { 4 "actionType": "Api", 5 "labelKey": "Like", 6 "groupDefault": "true", 7 "actionUrl": "https://test.com/this", 8 "method": "POST", 9 "requiresConfirmation": "false" 10 }, 11 { 12 "actionType": "Api", 13 "labelKey": "Unlike", 14 "groupDefault": "false", 15 "actionUrl": "https://test.com/that", 16 "method": "POST", 17 "requiresConfirmation": "false" 18 } 19 ], 20 "executionsAllowed": "OncePerUser", 21 "expirationDate": "2014-07-07T23:59:11.168Z", 22 "category": "Primary" 23}- Properties
-
Name Type Description Required or Optional Available Version actionLinks Action Link Definition Input[] The action links in the group. Within an action link group, action links are displayed in the order listed in the actionLinks property of the Action Link Group Definition Input request body. Within a feed item, action link groups are displayed in the order specified in the actionLinkGroupIds property of the Associated Actions Capability Input request body.
Required 31.0 category String Indicates the priority and relative locations of action links in an associated feed item. Values are: - Primary—The action link is displayed in the feed item’s auxiliary body.
- Overflow—The action link is displayed in the drop-down menu at the top right corner of the feed item.
Required 31.0 executionsAllowed String Defines the number of times an action link can be executed. Values are: - Once—An action link can be executed only once across all users.
- OncePerUser—An action link can be executed only once for each user.
- Unlimited—An action link can be executed an unlimited number of times by each user. You can’t use this value if the action link’s actionType is Api or ApiAsync.
Required 31.0 expirationDate Date ISO 8601 date string, for example, 2011-02-25T18:24:31.000Z, that represents the date and time this action link group is removed from associated feed items and can no longer be executed. The expirationDate must be within one year of the creation date. We recommend setting the expirationDate to coincide with the expiration of your OAuth token to prevent users from clicking and getting an OAuth error.
Required 31.0
- Response body for POST
- Action Link Group Definition
- Example for POST
- To associate an action link group with a feed item, first create an action link group definition:
1POST /connect/action-link-group-definitions 2 3{ 4 "actionLinks": [ 5 { 6 "actionType" : "Api", 7 "actionUrl" : "https://www.example.com/api/v1/cofirm", 8 "groupDefault" : "true", 9 "headers" : [ 10 { 11 "name" : "Authorization", 12 "value" : "OAuth 00DRR0000000N0g!ARoAQMZyQtsP1Gs27EZ8hl7vdpYXH5O5rv1 13 VNprqTeD12xYnvygD3JgPnNR._nmE6thZakAbBVJUsjUInMUaKMlkNKaWXdHO" 14 }, 15 { 16 "name" : "Content-Type", 17 "value" : "application/json" 18 }, 19 { 20 "name" : "Accept", 21 "value" : "application/json" 22 }, 23 { 24 "name" : "X-PrettyPrint", 25 "value" : "1" 26 } 27 ], 28 "labelKey" : "Confirm", 29 "method" : "Post", 30 "requiresConfirmation" : "true" 31 }, 32 { 33 "actionType" : "Api", 34 "actionUrl" : "https://www.example.com/api/v1/deny", 35 "groupDefault" : "false", 36 "headers" : [ 37 { 38 "name" : "Authorization", 39 "value" : "OAuth 00DRR0000000N0g!ARoAQMZyQtsP1Gs27EZ8hl7vdpYXH5O5rv1 40 VNprqTeD12xYnvygD3JgPnNR._nmE6thZakAbBVJUsjUInMUaKMlkNKaWXdHO" 41 }, 42 { 43 "name" : "Content-Type", 44 "value" : "application/json" 45 }, 46 { 47 "name" : "Accept", 48 "value" : "application/json" 49 }, 50 { 51 "name" : "X-PrettyPrint", 52 "value" : "1" 53 } 54 ], 55 "labelKey": "Deny", 56 "method" : "Post", 57 "requiresConfirmation" : "true" 58 }, 59 { 60 "actionType": "Ui", 61 "actionUrl" : "https://www.example.com/reviewPage.html", 62 "groupDefault" : "false", 63 "labelKey" : "Review", 64 "method" : "Get", 65 "requiresConfirmation" : "false" 66 }, 67 "executionsAllowed" : "OncePerUser", 68 "category" : "Primary", 69 "expirationDate" : "2014-05-09T18:45:39.000Z" 70}- Next, associate the action link group with the feed item and post the feed item. Grab the action
link group ID from the /connect/action-link-group-definitions response and pass it in a POST
request to /chatter/feed-elements.
1POST /chatter/feed-elements 2 3{ 4 "body": { 5 "messageSegments": [ 6 { 7 "type": "Text", 8 "text": "Please confirm or deny this item. You can also click Review to provide more feedback." 9 } 10 ] 11 }, 12 "subjectId": "me", 13 "feedElementType": "FeedItem", 14 "capabilities": { 15 "associatedActions": { 16 "actionLinkGroupIds": ["0AgRR0000004CTr0AM"] 17 } 18 } 19} - Different types of action links have different workflows to set the status. See /connect/action-links/actionLinkId for more information.