Forum Replies Created

Viewing 1 replies (of 1 total)
  • Hi everyone,

    If you want to validate a key using this tool in Python, use the following method.

    import requests

    def verify_account_key(account_key_to_check):
    
        yourwebsite = "" #for example, niftynicktools.com
        consumer_key = "" #the consumer_key given to you when you establish your API with License Manager
        consumer_secret = "" #the consumer_secret given to you when you establish your API with License Manager
        url = "https://" + yourwebsite + "/wp-json/lmfwc/v2/licenses/validate/" + account_key_to_check + "?consumer_key=" + \
              consumer_key + "&consumer_secret=" + consumer_secret
    
        verification_json = requests.get(url, headers={"User-Agent": "XY"}).json()
    
        try:
            if verification_json['success'] == True:
                return True
        except:
            return False
    
    #Try some keys
    verify_account_key("")
    verify_account_key("")
    • This reply was modified 5 years, 8 months ago by processzip.
Viewing 1 replies (of 1 total)