![](https://help.apple.com/assets/5B296C8B680CE27831E138C3/5B296C8E680CE27831E138D3/en_GB/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 a URL scheme and Import a shortcut using a 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): A URL that opens when the interaction is successful — for example, after a shortcut is imported or 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): A URL that opens when the interaction is cancelled by the user.
x-error (optional): A 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 a 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 kick off a different URL to handle the issue.