This endpoint can be used to update Generator records in the database. List of parameters and example responses can be found below.
Endpoint
PUT
/wp-json/dlm/v1/generators/{generator_id}
Parameters
Name | Type | Default | Is required |
---|---|---|---|
name | string |
No | |
charset | string |
No | |
chunks | number |
No | |
chunk_length | number |
No | |
expires_in | number |
No | |
activations_limit | number |
No | |
separator | string |
No | |
prefix | string |
No | |
suffix | string |
No |
Responses
{
"success": true,
"data": {
"id": 6,
"name": "Example Generator",
"charset": "ABCD1234",
"chunks": 4,
"chunkLength": 4,
"timesActivatedMax": "1",
"separator": "-",
"prefix": "",
"suffix": "",
"expiresIn": "365",
"createdAt": "2021-05-15 21:23:00",
"createdBy": "1",
"updatedAt": null,
"updatedBy": null
}
}
{
"code": "rest_data_error",
"message": "The Generator name is missing from the request.",
"data": {
"status": 404
}
}
Examples
Example
use IdeoLogix\DigitalLicenseManagerClient\Service;
$api = new Service( 'http://site.com', 'ck_XXXX', 'cs_XXXX' );
$response = $api->generators()->update( 5, [
'name' => 'Android Apps',
]);
print_r($response->get_data());
Response
Array
(
[id] => 5
[name] => Android Apps
[charset] => ABCD1234
[chunks] => 4
[chunk_length] => 4
[activations_limit] => 1
[separator] => -
[prefix] => NULL
[suffix] => NULL
[expires_in] => 365
[created_at] => 2021-08-28 12:06:43
[updated_at] => 2021-08-28 12:42:31
)
For more details please click here.