Using the Key System to make money with your Software

Using the Key System to make money with your Software

The Work.ink Key System allows you to lock your software behind Work.ink using a key. The user will have to complete steps as usual to get a key to enter in your software.

Setting up the Key System

Create a new link with either this url:

https://work.ink/token

Or create a new link with a destination URL containing `{TOKEN}` which will then be replaced by the key generated on work.ink. Here is an example:

https://mysoftware.example.com/validateKey?key={TOKEN}

And that's it for creating the link. The user will now either be redirected to a page showing the key (first example) or to the custom URL you set containing the key.

Validating the Key in your Software

To make sure that the key is actually valid, you can send the following request to work.ink:

GET https://work.ink/_api/v2/token/isValid/<Token>

This will then respond with a JSON object like this, where you can check the valid field to make sure the token is - well - valid.

{
  "valid": true, // Is Token valid
  "deleted": false, // Has token been deleted by this request
  "info": {
    "token": "<Token>", // The token itself
    "createdAt": 1740939793036, // Timestamp of when the token was created
    "byIp": "<Users IP Address>", // IP of the user that created this token
    "linkId": 10345, // ID of the link that created this token
    "expiresAfter": 1740940213036 // Expires at this timestamp
  }
}

If you want to make sure that a token can only be used once, you can add the ?deleteToken=1 parameter. This will instantly delete the token after sending the validation request, making sure, that the token is single-use only.

For more in-depth information have a look at our Dashboard.