FAXES Documentation > FaxStore V2 > Integration

Integration

FAXES

This section covers the backend usage for the license system along with validating the product(s) you wish to authorise.

Simply placing the license request into a program doesn't guarantee security for the product. Research ways to further secure your product via manipulation methods or other methods.

Contents:


Request Format

The license system comes with required and optional options when making the request.

Required options:

  • Product Id - the FaxStore item listing Id.

  • Users License Key - the users license key for this product located on the license dashboard.

Optional Options:

  • log - setting this to false will disable the the request being put into the 'Previous Auths' table.

  • info - information or details that can be passed through the request and logged into the 'Previous Auths' table.


Type: POST
URL: 'https://license.your.domain/api/checkitem/PRODUCT_ID'
Headers:
    User-Agent: '*'
    Accept:  'application/json, text/plain, */*'
    authorization: USERS_LICENSE_KEY

Success Response Information: (Object)

{
  status: 'OK',
  pass: true,
  details: 'Authorisation completed!'
}

Failed Response Information: (Object)

{
  status: 'NOT FOUND',
  pass: false,
  details: 'The supplied license key was not found. Please check your auth key is correct - https://license.my.domain'
}

Node.Js Usage

The Node.Js examples use a package called axios

const axios = require("axios");
const options = {
    productId: 1,
    licenseKey: "phfn2408g02hg04g0230iog",
    log: false,
    info: "Information to add to the request."
}


let licensecheck = axios({
method: 'post',
url: `https://license.your.domain/api/checkitem/${options.productId}`,
    headers: {
        Accept: 'application/json, text/plain, */*',
        'User-Agent': '*',
        'authorization': options.licenseKey,
    },
    params: {
        info: options.info,
        log: options.log
    }
});

if(licensecheck.data.pass) {
    console.log('the license system has passed.');
} else {
    console.log('the license system has failed.');
}

Lua Usage

local productId = 1
local licenseKey = "ABC_123"
PerformHttpRequest("https://yourlinkhere/api/checkitem/" .. productId, function(code, data, headers)
    print("Return code: " .. code)
    print("Return data: " .. data)
    print("Return headers: " .. headers)
end, "POST", "", {
    ["Accept"] = "application/json, text/plain, */*",
    ["User-Agent"] = "*",
    ["authorization"] = licenseKey
})  

Was this article helpful?

24 out of 46 found this helpful