Skip to content

API Documentation

Sandesh Menath edited this page Aug 3, 2021 · 6 revisions

Enabling And Configuring API

With the help of Auto Faveo Licenser API, you can perform any action from a remote script. Just enable API using the Software Settings » Advanced Settings tab and send all requests to https://developers.productdemourl.com/sandesh/agora-license-manager/faveo-license-manager/public

Before API can be accessed, a new API key should be created using the API Keys » Add New API Key tab. Application allows creating multiple API keys with different permissions; therefore, you can grant different permissions for different keys. Optionally, you can accept API requests only from specific IP address(es), so connections from other IPs will be blocked. Any API key can be activated/deactivated at any time.

Additionally, you can secure the /apl_api directory using htaccess password protection (don't forget to add authorization headers to all API requests in this case). If you don't use API, leave it disabled.

Formatting And Sending API Requests

All API requests should be sent to /apl_api/api.php using POST method and include unique API secret along with additional data you want to submit. Here's a basic example on how API request should look like:

API URL : https://developers.productdemourl.com/sandesh/agora-license-manager/faveo-license-manager/public/api/admin/API_NAME/action/ Example: https://developers.productdemourl.com/sandesh/agora-license-manager/faveo-license-manager/public/api/admin/products/add/

Post Data : api_key_secret=UNIQUE_API_SECRET&token=UNIQUE_TOKEN_FOR_AUTHORIZATION&argument1=value1&argument2=value2...

API will always return a json response for each request. The list of every response field is below.

Response Field Description Notes
api_action_success API status Success: 1, failure: 0
api_error_detected API error check No error found: 0, error found: 1
action_success User request status Success: 1, failure: 0
error_detected User request error check No error found: 0, error found: 1
page_message Detailed success/failure description Might contain additional data (if any) requested by user

As can be seen, response body contains two types of status/error fields: API itself and original user request. The first one (starting with api_) indicates status/error of API system itself. For example, if API is disabled, api_action_success will have a value of 0 and api_error_detected will have a value of 1. In addition, page_message will say: The action could not be completed because of this reason: API not enabled or invalid API function.

If API is enabled and works properly, but original user request failed (for example, user tried to add a new license without specifying product), api_action_success will have a value of 1 and api_error_detected will have a value of 0 (because there’s nothing wrong with API itself), but action_success will have a value of 0 and error_detected will have a value of 1. Sure enough, page_message will say: Invalid product.

API Argument List

All the API arguments you will ever use are self-explanatory. However, if you find some variable not clear, refer to this list for more details (all variables are sorted alphabetically):

Argument Name Description Notes
banned_host_comments Optional blocked IP comments
banned_host_id Numeric blocked IP ID
banned_host_ip IP address to block
client_email Client email address Must be unique
client_fname Client first name
client_id Numeric client ID Can be parsed from search API
client_lname Client last name
client_status Client status Active: 1, inactive: 0
delete_record Delete particular record Delete: 1
installation_disable_ip_verification Disable IP verification Yes: 1, no: 0
installation_id Numeric installation ID Can be parsed from search API
installation_ip Installation IP address
installation_status Installation IP address Active: 1, inactive: 0
license_code License code Only required for anonymous licenses
license_comments Optional license comments
license_domain Domain(s) to bind license to
license_expire_date Date after which license will expire
license_id Numeric license ID Can be parsed from search API
license_ip IP address(es) to bind license to
license_limit Maximum number of installations
license_order_number Order number of license purchase
license_require_domain Option to always require a domain Yes: 1, no: 0
license_status License status Active: 1, inactive: 0
license_support_date Date after which support will expire
license_updates_date Date after which updates will not be available
product_description Short product description
product_envato_id Product Envato ID Only used for products sold on Envato
product_id Numeric product ID Can be parsed from search API
product_sku Product stock keeping unit Must be unique
product_status Product status Active: 1, inactive: 0
product_title Product name Must be unique
product_url_download Product download URL
product_url_homepage Product homepage URL
product_version Product version
search_keyword Keyword(s) to be used for search
search_type API search type Available values: banned_host, callback, client, installation, license, product, report

Built-in API Arguments

Some API functions require record status and/or date to be included. Hence, these functions use built-in arguments listed below:

Record status : Active (enabled) : 1, Inactive (disabled) : 0

Date: yyyy-mm-dd (date should always be formatted using a locale neutral format, as specified by ISO 8601).

Record removal : In case any record needs to be deleted, an extra argument delete_record with value 1 should be added: delete_record = 1

Adding New Product

API ROUTE : api/admin/products/add

Required Arguments : product_title, product_sku, product_status

Optional Arguments : product_description, product_url_homepage, product_url_download, product_version, product_envato_id

Post data example : api_key_secret = UNIQUE_API_SECRET&token=UNIQUE_TOKEN_FOR_AUTHORIZATION&product_title=My_Product_Name&product_sku=MPN&product_status=1&product_description=some_description&product_url_homepage=http://developers.productdemourl.com/license-manager/WEB&product_url_download=http://developers.productdemourl.com/license-manager/WEB/file.zip&product_version=1.0&product_envato_id=123456

Editing Existing Product

API ROUTE : api/admin/products/edit

Required Arguments : product_id, product_title, product_sku, product_status

Optional Arguments : product_description, product_url_homepage, product_url_download, product_version, product_envato_id, delete_record

Post Data Example : api_key_secret = UNIQUE_API_SECRET&token=UNIQUE_TOKEN_FOR_AUTHORIZATION&product_id=1&product_title=My_Product_Name&product_sku=MPN&product_status=1&product_description=some_description&product_url_homepage=http://developers.productdemourl.com/license-manager/WEB&product_url_download=http://developers.productdemourl.com/license-manager/WEB/file.zip&product_version=1.0&product_envato_id=123456

Adding New Client

API ROUTE : api/admin/clients/add

Required Arguments : client_fname, client_lname, client_email, client_status

Optional Arguments : N/A

Post Data Example : api_key_secret = UNIQUE_API_SECRET&token=UNIQUE_TOKEN_FOR_AUTHORIZATION&client_fname=First_Name&client_lname=Last_Name&client_email=client@email.com&client_status=1

Adding New License

This one is a bit more tricky, since it requires submitting both product and client IDs stored in the database. How do you get required IDs? Using search API! Since detailed instructions on how to use search API is available in the Help Section itself, let's assume you already know how to find records.

API ROUTE : api/admin/license/add

Required Arguments (personal license) : product_id, client_id, license_require_domain, license_status

Optional Arguments (personal license) : license_order_number, license_ip, license_domain, license_limit, license_expire_date, license_updates_date, license_support_date, license_comments

Post Data Example (Personal License) : api_key_secret = UNIQUE_API_SECRET&token=UNIQUE_TOKEN_FOR_AUTHORIZATION&product_id=1&client_id=1&license_require_domain=1&license_status=1&license_order_number=order123&license_ip=192.168.1.1&license_domain=clientdomain.com&license_limit=3&license_expire_date=2022-03-24&license_updates_date=2021-12-24&license_support_date=2021-09-24&license_comments=something

Required Arguments (anonymous license) : product_id, license_code, license_require_domain, license_status

Optional Arguments (anonymous license) : license_order_number, license_ip, license_domain, license_limit, license_expire_date, license_updates_date, license_support_date, license_comments

Post Data Example (anonymous license) : api_key_secret = UNIQUE_API_SECRET&token=UNIQUE_TOKEN_FOR_AUTHORIZATION&product_id=1&license_code=code123456&license_require_domain=1&license_status=1&license_order_number=order123&license_ip=192.168.1.1&license_domain=clientdomain.com&license_limit=3&license_expire_date=2022-03-24&license_updates_date=2021-12-24&license_support_date=2021-09-24&license_comments=something

Editing Existing License

API ROUTE : api/admin/license/edit

Required Arguments (personal license) : product_id, client_id, license_id, license_require_domain, license_status

Optional Arguments (personal license) : license_order_number, license_ip, license_domain, license_limit, license_expire_date, license_updates_date, license_support_date, license_comments, delete_record

Post Data Example (Personal License) : api_key_secret = UNIQUE_API_SECRET&token=UNIQUE_TOKEN_FOR_AUTHORIZATION&product_id=1&client_id=1&license_id=1&license_require_domain=1&license_status=1&license_order_number=order123&license_ip=192.168.1.1&license_domain=clientdomain.com&license_limit=3&license_expire_date=2022-03-24&license_updates_date=2021-12-24&license_support_date=2021-09-24&license_comments=something

Required Arguments (anonymous license) : product_id, license_id, license_code, license_require_domain, license_status

Optional Arguments (anonymous license) : license_order_number, license_ip, license_domain, license_limit, license_expire_date, license_updates_date, license_support_date, license_comments, delete_record

Post Data Example (anonymous license) : api_key_secret = UNIQUE_API_SECRET&token=UNIQUE_TOKEN_FOR_AUTHORIZATION&product_id=1&license_id=1&license_code=code123456&license_require_domain=1&license_status=1&license_order_number=order123&license_ip=192.168.1.1&license_domain=clientdomain.com&license_limit=3&license_expire_date=2022-03-24&license_updates_date=2021-12-24&license_support_date=2021-09-24&license_comments=something

Edit Existing Installations

API ROUTE : /api/admin/installations/edit

Required Arguments : installation_id, installation_ip, installation_status

Optional Arguments : installation_disable_ip_verification, delete_record

Post Data Example : api_key_secret = UNIQUE_API_SECRET&token=UNIQUE_TOKEN_FOR_AUTHORIZATION&installation_id=1&installation_ip=192.168.1.1&installation_status=1&installation_disable_ip_verification=1

Add New Banned Hosts

API ROUTE : api/admin/bannedHosts/add

Required Arguments : banned_host_ip

Optional Arguments : banned_host_comments

Post Data Example : api_key_secret= UNIQUE_API_SECRET&token=UNIQUE_TOKEN_FOR_AUTHORIZATION&banned_host_ip=192.168.1.1&banned_host_comments=Unauthorized

Editing Existing Banned Hosts

API ROUTE : api/admin/bannedHosts/edit Required Arguments : banned_host_id, banned_host_ip Optional Arguments : banned_host_comments, delete_record

Post Data Example : api_key_secret = UNIQUE_API_SECRET&token=UNIQUE_TOKEN_FOR_AUTHORIZATION&banned_host_id=1&banned_host_ip=192.168.1.1&banned_host_comments=Unauthorized

Searching For Data

API ROUTE : api/admin/search

Required Arguments : search_type, search_keyword

Optional Arguments : N/A

Post Data Example : api_key_secret = UNIQUE_API_SECRET&token=UNIQUE_TOKEN_FOR_AUTHORIZATION&search_type=product&search_keyword=My_Product_Name

Argument search_type can contain one of these values: banned_host, callback, client, installation, license, product, report. Argument search_keyword can contain the exact search term or a part of it.

You can find matching records by one of these values:

Banned host : IP address, comments

Callback : email address, license code, callback domain, callback IP

Client : first name, last name, email address

Installation : email address, license code, installation domain, installation IP

License : email address, license code, comments

Product : product name, SKU

Report : report text

Search results are always returned using JSON format.

Ready To Use Code For Connecting to API

If you don't know how to make POST requests, visit Faveo Support Forums; we will provide you with custom code snippet which is designed exclusively for Auto FAVEO Licenser API. The code connects to API, performs specified request, and parses API response in less than a second.

Clone this wiki locally