Cryptlex Forums

One product, two policies

J
Juanjo Bermúdez

I can create licenses for the same product with different policies in the dashboard, but can I do the same with the Web API?

C
CryptlexCryptlex team

Hi Juanjo,

The Dashboard itself uses the REST API. So anything you can do in the Dashboard can be done through Web API too.

J
Juanjo Bermúdez

But the documentation does not explain how. I can specify the productId or the metadata but I don’t know what field to use to specify the policy.

$license_body["productId"] = "myproductid";
$metadata["key"] = "order_id";
$metadata["value"] = $order_id;
$metadata["visible"] = false;
$license_body["metadata"] = array($metadata);
$license = CryptlexApi::CreateLicense($license_body);

How do I specify the policy id here? I tried with policyId but didn’t work.

A
Adnan KamiliCryptlex team

It does specify licensePolicyId as one of the post parameters.

J
Juanjo Bermúdez

Thank you. I was looking in the documentation, not in the API reference.
Maybe you should add a link to the API reference at this page.

← Back to all topics · 5 posts · 1077 views · opened 2020-11-17