# Software Licensing API - Example using Perl

This document is a subset of the [Software Licensing API document](https://easydigitaldownloads.com/docs/software-licensing-api/ &quot;Software Licensing API document&quot;), which lists all features available via the API. The following is example code showcasing how to implement those features with Perl.

### Request

```
use strict;&lt;br&gt;&lt;/br&gt;use warnings;&lt;br&gt;&lt;/br&gt;&lt;br&gt;&lt;/br&gt;use LWP::UserAgent;&lt;br&gt;&lt;/br&gt;use CGI;&lt;br&gt;&lt;/br&gt;&lt;br&gt;&lt;/br&gt;my $edd_action = &#039;check_license&#039;; # Valid actions are activate_license, deactivate_license, get_version, check_license&lt;br&gt;&lt;/br&gt;my $license    = &#039;&#039;;&lt;br&gt;&lt;/br&gt;my $item_id    = &#039;&#039;; # The ID of the Download on your website&lt;br&gt;&lt;/br&gt;my $url        = &#039;example.org&#039;; # If you have disabled URL checking in the settings, you do not need this value&lt;br&gt;&lt;/br&gt;&lt;br&gt;&lt;/br&gt;my $api = &#039;https://domain.com/&#039;;&lt;br&gt;&lt;/br&gt;&lt;br&gt;&lt;/br&gt;my $ua       = LWP::UserAgent-&gt;new();&lt;br&gt;&lt;/br&gt;my $response = $ua-&gt;post( $api, { &#039;edd_action&#039; =&gt; $edd_action, &#039;license&#039; =&gt; $license, &#039;item_id&#039; =&gt; $item_id, &#039;url&#039; =&gt; $url } );&lt;br&gt;&lt;/br&gt;my $content  = $response-&gt;decoded_content();&lt;br&gt;&lt;/br&gt;&lt;br&gt;&lt;/br&gt;my $cgi = CGI-&gt;new();&lt;br&gt;&lt;/br&gt;# This prints the resposne from the API, you&#039;ll need to validate the data from there using the&lt;br&gt;&lt;/br&gt;# HTTP status headers and the `success` response from the API&lt;br&gt;&lt;/br&gt;print $content;&lt;br&gt;&lt;/br&gt;
```

### Response

A response to the above query would be a JSON-formatted string that would look something like this:

```
{
	&quot;license&quot;: &quot;valid&quot;,
	&quot;item_name&quot;: &quot;EDD Product name&quot;,
	&quot;expires&quot;: &quot;2014-10-23 00:00:00&quot;,
	&quot;payment_id&quot;: 54224,
	&quot;customer_name&quot;: &quot;John Doe&quot;,
	&quot;customer_email&quot;: &quot;john@sample.com&quot;
}
```