Run links
Mechanic run links give your users a useful point of entry.
Some tasks lend themselves to manual invocation by a user, on demand. In these cases, Mechanic makes available run links: URLs from which a task run may be created, suitable for bookmarking or sharing.
Run links can be useful in an external application, email, or website â anywhere a custom user experience would be improved by a shortcut to an opportunity to craft a specific Mechanic task run.
Shopify admin action links are a form of run link.
Format
Run link format varies based on the style of task run desired.
Manual trigger
For tasks subscribing to mechanic/user/trigger and mechanic/user/text, the run link points to /apps/mechanic/tasks/{task id}/run, as illustrated below:
For tasks subscribing to mechanic/user/text, the text submission may be prefilled using the data
query parameter, as in ?data=drink+me%21
.
Shopify resources
For tasks subscribing to mechanic/user/{Shopify resource} (i.e. for tasks responding to Shopify admin action links), create a link pointing to /apps/mechanic/tasks/run within the Shopify admin, using the resource_type
and ids[]
query parameters as shown below.
Breaking this down, the URL consists of the following:
Protocol, host, path
resource_type
query parameterids[]
query parameter
Repeat the ids[]
query parameter as needed, for each relevant resource ID.
Last updated