Newer Version Available

This content describes an older version of this product. View Latest

Update the Status of an Action Link or Invoke an Action Link

Usage
Use this resource to update the status property of an action link. To invoke an Api or an ApiAsync action link, set the status to PendingStatus. The status of the action link in combination with the labelKey property of the Action Link Definition Input determines the text that displays in the UI.
Different types of action links have different status workflows:
Api
To invoke an Api action link from an app, make a PATCH request to mark the link PendingStatus. Salesforce handles the call out to the actionUrl that was provided in the Action Link Definition Input. For an Api action link, Salesforce sets the status to SuccessfulStatus or FailedStatus based on the HTTP status code returned by your server.
ApiAsync
To invoke this action from an app, make a PATCH request to mark the link PendingStatus. Salesforce handles the call out to the actionUrl that was provided in the Action Link Definition Input. For an ApiAsync action link, the callout starts an asynchronous operation on your server. Salesforce sets status to PendingStatus unless the call returned an error status code, in which case it sets status to FailedStatus. When your server has finished the asynchronous processing it should call back and PATCH the action link to SuccessfulStatus or FailedStatus.
Download and Ui
Direct the user to download or visit the UI from the link in the actionUrl of the Platform Action response body. Your application must decide when to make a PATCH request to set status to SuccessfulStatus or FailedStatus.

You can’t PATCH the status of an action link:

  • Back to NewStatus from a different status.
  • From a terminal status (FailedStatus or SuccessfulStatus) to NewStatus or PendingStatus.
  • When the action link belongs to an action link group whose executionsAllowed property is Unlimited.
  • For an Api or ApiAsync action link whose executionsAllowed property is Once, when a user PATCHes the status to PendingStatus for the first time, the callout is made to the action link. If the same user PATCHes it to PendingStatus again, Salesforce returns the current action link information. However, if another user PATCHes the status to PendingStatus, Salesforce throws an error. In both cases, the callout to the action link is not resent.

Note

Resource
/connect/action-links/actionLinkId
HTTP method
PATCH
Request body
Action Link Input
Request body example
1{ "status":"SuccessfulStatus" }
Request parameter
status
Request parameter example
1/services/data/v43.0/connect/action-links/actionLinkId?status=SuccessfulStatus
Returns
Platform Action