Connect REST API (Core)

POST Action Link Group Definitions

POST /connect/action-link-group-definitions

Operation ID: postActionLinkGroupDefinitionCollection. Tags: Action Links Resources.

Allows creation of new action link group definitions.

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.

Experience Cloud site path

/connect/communities/{communityId}/action-link-group-definitions

Available in: v33.0

Request body

The definition of an action link group. 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 definition can be sensitive to a third party (for example, OAuth bearer token headers). For this reason, only requests made via the client app that created the action link definition can read, modify, or delete the definition. In addition, the user making the request must have created the definition or have View All Data permission.

Media type: application/json. Schema: ActionLinkGroupDefinitionInput.

Example: example_1 Payload 1

This example instantiates an action link group definition without a template:

{
  "actionLinks": [
    {
      "actionType": "Api",
      "labelKey": "Like",
      "groupDefault": "true",
      "actionUrl": "https://test.com/this",
      "method": "HttpPost",
      "requiresConfirmation": "false"
    },
    {
      "actionType": "Api",
      "labelKey": "Unlike",
      "groupDefault": "false",
      "actionUrl": "https://test.com/that",
      "method": "HttpPost",
      "requiresConfirmation": "false"
    }
  ],
  "executionsAllowed": "OncePerUser",
  "expirationDate": "2014-07-07T23:59:11.168Z",
  "category": "Primary"
}

Example: example_2 Payload 2

This example instantiates an action link group definition from a template:

{
  "templateId": "07gD00000004C9r",
  "templateBindings": [
    {
      "key": "Bindings.version",
      "value": "v33.0"
    }
  ]
}

Responses

  • 200 Action Link Group Definition The definition of an action link group. 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.

    Media type: application/json. Schema: ActionLinkGroupDefinition.

Code samples

Example: Example 1 · HTTP

# To associate an action link group with a feed item, first create an action
# link group definition:
#
# An `actionUrl` to a Salesforce resource can be relative. All others must be
# absolute and start with `https://`.

POST /connect/action-link-group-definitions

{
    "actionLinks": [
    {
       "actionType" : "Api",
       "actionUrl" : "https://www.example.com/api/v1/confirm",
       "groupDefault" : "true",
       "headers" : [
       {
          "name" : "Authorization",
          "value" : "OAuth 00DRR0000000N0g!ARoAQMZyQtsP1Gs27EZ8hl7vdpYXH5O5rv1
                        VNprqTeD12xYnvygD3JgPnNR._nmE6thZakAbBVJUsjUInMUaKMlkNKaWXdHO"
       },
       {
          "name" : "Content-Type",
          "value" : "application/json"
       },
       {
          "name" : "Accept",
          "value" : "application/json"
       },
       {
          "name" : "X-PrettyPrint",
          "value" : "1"
       } 
       ],
       "labelKey" : "Confirm",
       "method" : "HttpPost",
       "requiresConfirmation" : "true"
    },
    {
       "actionType" : "Api",
       "actionUrl" : "https://www.example.com/api/v1/deny",
       "groupDefault"  : "false",
       "headers" : [
       {
          "name" : "Authorization",
          "value" : "OAuth 00DRR0000000N0g!ARoAQMZyQtsP1Gs27EZ8hl7vdpYXH5O5rv1
                        VNprqTeD12xYnvygD3JgPnNR._nmE6thZakAbBVJUsjUInMUaKMlkNKaWXdHO"
       },
       {
          "name" : "Content-Type",
          "value" : "application/json"
       },
       {
          "name" : "Accept",
          "value" : "application/json"
       },
       {
          "name" : "X-PrettyPrint",
          "value" : "1"
       } 
       ],
       "labelKey": "Deny",
       "method" : "HttpPost",
       "requiresConfirmation"  : "true"
    },
    {
       "actionType": "Ui",
       "actionUrl" : "https://www.example.com/reviewPage.html",
       "groupDefault" : "false",
       "labelKey" : "Review",
       "method" : "HttpGet",
       "requiresConfirmation" : "false"
    },
    "executionsAllowed" : "OncePerUser",
    "category" : "Primary",
    "expirationDate" :  "2014-05-09T18:45:39.000Z"
}

# 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`](/docs/platform/connect-rest-api/references/connect-rest-api-chatter-feeds#tag/Feed-Elements-Resources/operation/getFeedElementCollection).
#
# Different types of action links have different workflows to set their `status`
# property, whose value displays in the UI. See
# [`/connect/action-links/{actionLinkId}`](/docs/platform/connect-rest-api/references/connect-rest-api-core#tag/Action-Links-Resources/operation/getActionLink)
# for more information.
#
# This example doesn’t include other capabilities, but feed items with action
# links do support other capabilities, such as content, polls, and links.

POST  /chatter/feed-elements

{
  "body": {
    "messageSegments": [
      {
        "type": "Text",
        "text": "Please confirm or deny this item. You can also click Review to provide more feedback."
       }
    ]
    },
  "subjectId": "me",
  "feedElementType": "FeedItem",
  "capabilities": {
    "associatedActions": {
      "actionLinkGroupIds": ["0AgRR0000004CTr0AM"]
    }
  }
}