![](https://help.apple.com/assets/5B296C8B680CE27831E138C3/5B296C8E680CE27831E138D3/en_AU/c10e8a839dc838a25d0feb0e9e428a0a.png)
Use x-callback-url with Shortcuts
Shortcuts supports x-callback-url, allowing the calling app to receive a response (a callback), when a particular interaction has completed. You can import and run shortcuts from an X-Callback-URL using the same parameters as discussed in Run a shortcut using an URL scheme and Import a shortcut using an URL scheme. Here’s an example:
shortcuts://x-callback-url/run-shortcut?name=Calculate%20Tip&input=text&text=24.99&x-success=...&x-cancel=...
Per the X-Callback-URL standard, the following additional parameters can be provided:
x-success (optional): An URL that opens when the interaction is successful — for example, after a shortcut is imported or has finished running. If a shortcut is run, a parameter named
result
is appended to the URL and contains the textual output of the shortcut.x-cancel (optional): An URL that opens when the interaction is cancelled by the user.
x-error (optional): An URL that opens when the interaction fails because an error occurred. A parameter named
errorMessage
is appended to the URL and contains a description of the error.
With x-success
, you can provide an URL that opens after the shortcut successfully finishes running. This could be used in conjunction with a multi-step checklist of tasks in OmniFocus, wherein you open the X-Callback-URL to run a shortcut, return to the list and move on to the next task via URL.
With x-cancel
, you can provide a contingency URL to launch if the shortcut stops before it finishes running. Because the shortcut did not complete, no output from the shortcut is provided.
With x-error
, you can provide a contingency URL to launch if the shortcut encounters an error while running and fails to finish. In this case, you can fire up a different URL to handle the issue.