How-to: Override link destinations on the fly
When, for example, building a key system, it is often required to override the destination URL of a link to inject sub-ids or other data to identify the user when returning the the key systems website.
To do this, we have created the Link Override API. Just send a request like this:
GET https://work.ink/_api/v2/override?destination=<Destination Override>And you will receive a JSON response like this (in this example for https://example.com):
{"sr":"TUtYZ1VPRk1XUlRCQkFFWVdEWlVTTXRVV1dBQkRDMkdHdlRwazkyV0JmQWJuSm5GV1lHeVRPZDlwOXVycHc3cFpqNFNrWkM3S2NHNFBxM1BDMXg5"}Now, take your Work.ink Link, e.g. https://work.ink/123/example and add the JSON objects data as query parameter to the url, getting you this:
https://work.ink/123/example?sr=TUtYZ1VPRk1XUlRCQkFFWVdEWlVTTXRVV1dBQkRDMkdHdlRwazkyV0JmQWJuSm5GV1lHeVRPZDlwOXVycHc3cFpqNFNrWkM3S2NHNFBxM1BDMXg5Aaaaand... done! Now, this URL you created will redirect to https://example.com instead. You can still use the key system like you're used, e. g. by supplying https://example.com/verify?token={TOKEN}.