List

This endpoint can be used to list the licenses based on specific query parameters. If not query parameters are provided, the defaults in the below table will be used.

Endpoint

GET
/wp-json/dlm/v1/licenses

Parameters

Name Type Default Is required
page number 1 No
per_page number 30 No

Responses

{
    "success": true,
    "data": [
        {
            "id": 1,
            "order_id": 13,
            "product_id": 10,
            "user_id": 1,
            "license_key": "E272-EB2E-FC3E-FCEF",
            "expires_at": "2022-06-30 18:44:08",
            "valid_for": 365,
            "source": 1,
            "status": 2,
            "times_activated": 2,
            "activations_limit": 2,
            "is_expired": false,
            "created_at": "2021-06-30 18:44:08",
            "created_by": 1,
            "updated_at": "2021-06-30 18:44:08",
            "updated_by": 1
        }
    ]
}
{
    "code": "authentication_error",
    "message": "Consumer key is invalid.",
    "data": {
        "status": 401
    }
}

Examples

Example
use IdeoLogix\DigitalLicenseManagerClient\Service;

$api= new Service( 'http://site.com', 'ck_XXXX', 'cs_XXXX' );

$response = $api->licenses()->get( ['per_page' => 10, 'page' => 1] );

print_r( $response->get_data() ); 
Response
Array
(
    [0] => Array
        (
            [id] => 2
            [order_id] => 23
            [product_id] => 12
            [user_id] => 1
            [license_key] => ABCZ-AC15-352C-21ZW
            [expires_at] => 2021-06-07 00:00:00
            [valid_for] => 365
            [source] => 1
            [status] => 1
            [times_activated] => 0
            [activations_limit] => 5
            [is_expired] => 1
            [created_at] => 2021-06-07 00:31:32
            [updated_at] => 2021-07-07 14:03:08
        )

    [1] => Array
        (
            [id] => 3
            [order_id] => 24
            [product_id] => 12
            [user_id] => 1
            [license_key] => W0Z2-5203-CCA1-Z055
            [expires_at] => 2022-06-07 00:00:00
            [valid_for] => 365
            [source] => 1
            [status] => 2
            [times_activated] => 0
            [activations_limit] => 5
            [is_expired] => 0
            [created_at] => 2021-06-07 00:39:34
            [updated_at] => 2021-06-20 21:26:27
        )
)
For more details please click here.