Product Documentation
From version 1.2.0 WLink comes with an API which can be used to automate the process of creating, deleting and fetching links. Accepted content types for WLink are application/json or application/x-www-form-urlencoded.
Ensure WLink 1.2.0 or above is running
The API token has been changed in the config.json
Fetch an existing link by the link/URL name.
Parameters
| [Header] The token set in the config file |
| [URL] The name or url of the link to search for |
Response
{
id: 2,
name: 'g',
url: 'https://google.com',
count: 7,
creator: 'faxes',
creatorID: '282762192544333827',
createdAt: '1713090722076'
}OR
{msg: 'Link not found from name or url.'}Create a link to be used as a shortened URL.
Parameters
| [Header] The token set in the config file |
| [Body] The short name for the link |
| [Body] The URL the link should direct towards |
Response
{
id: 2,
name: 'g',
url: 'https://google.com',
count: 0,
creator: 'API',
creatorID: '0',
createdAt: '1713090722076'
}OR
400: {msg: 'Body fields not passed, name and url are required.'}
409: {msg: 'Duplicate link name.'}
403: {msg: 'Reserved name provided. Paths that the application use are reserved.'}Delete a link from the system and returns the final data before it's removed.
Parameters
| [Header] The token set in the config file |
| [URL] The numerical ID of the link to delete |
Response
{
id: 2,
name: 'g',
url: 'https://google.com',
count: 7,
creator: 'faxes',
creatorID: '282762192544333827',
createdAt: '1713090722076'
}OR
{msg: 'Link not found from the ID'}