ScriptLock API v1.0
Getting Product Information
This is used to fetch the product details for the PRODUCT_ID specified in the URI.
GET http://scriptlock.com/api/product/{PRODUCT_ID}
Example:
GET /api/product/{PRODUCT_ID} HTTP/1.1
Host: scriptlock.com
Authorization: Basic 63f9db5f7b532f1879df8dd751e185d5
The following responses may be returned:
- 302 Found
- 404 Not Found
Adding New Products
This is used to add a new product.
POST http://scriptlock.com/api/product
product_name, product_url, product_rrp, keyphrase
Example:
POST /api/product HTTP/1.1
Host: scriptlock.com
Authorization: Basic 63f9db5f7b532f1879df8dd751e185d5
Content-Length: 143
Content-Type: application/x-www-form-urlencoded
product_name=My+New+Product&product_url=http%3A%2F%2Fexample.com%2Fmy-new-product%2F&product_rrp=39.95&keyphrase=a+secret+encryption+passphrase
The following responses may be returned:
- 201 Created
- 409 Conflict
Modifying Product Details
This is used to modify the product details for the PRODUCT_ID specified in the URI.
PUT http://scriptlock.com/api/product/{PRODUCT_ID}
product_name, product_url
Example:
PUT /api/product/{PRODUCT_ID} HTTP/1.1
Host: scriptlock.com
Authorization: Basic 63f9db5f7b532f1879df8dd751e185d5
Content-Length: 88
Content-Type: application/x-www-form-urlencoded
product_name=New+Product+Name&product_url=http%3A%2F%2Fexample.com%2Fchanged-product-url
The following responses may be returned:
- 200 OK
- 304 Not Modified
Getting a Product List
This is used to fetch a list of products for your account.
GET http://scriptlock.com/api/products
Example:
GET /api/products HTTP/1.1
Host: scriptlock.com
Authorization: Basic 63f9db5f7b532f1879df8dd751e185d5
The following responses may be returned:
- 200 OK
- 204 No Content
Deleting a Product
This is used to delete the product record for the PRODUCT_ID specified in the URI.
DELETE http://scriptlock.com/api/product/{PRODUCT_ID}
Example:
DELETE /api/product/{PRODUCT_ID} HTTP/1.1
Host: scriptlock.com
Authorization: Basic 63f9db5f7b532f1879df8dd751e185d5
The following responses may be returned:
- 410 Gone
- 409 Conflict
Warning: All issued licenses associated with this product will also be revoked. USE WITH CARE!
Encoding a Product
This is used to encode a script for the PRODUCT_ID specified in the URI.
You may only encode one script at a time. Zip or other archive file types are not currently supported, and are not likely to be supported at this stage. However, support for PHAR archives may be considered at a later stage.
PUT http://scriptlock.com/api/product/{PRODUCT_ID}/encode
name, file, type
Example:
PUT /api/product/{PRODUCT_ID}/encode HTTP/1.1
Host: scriptlock.com
Authorization: Basic 63f9db5f7b532f1879df8dd751e185d5
Content-Length: 93
Content-Type: application/x-www-form-urlencoded
name=myscript.php&file=%7Bthe+file+contents+of+myscript.php%7D&type=application%2Fx-httpd-php
The following responses may be returned:
- 200 OK
- 500 Internal Server Error
You will need to pass the actual file contents of your script as a file parameter in the PUT request.
A 200 OK response, indicates that your script was successfuly encoded. The body of the response will contain a download link to the encoded script. Use this link to retrieve your encoded script. Encoded scripts will remain available for download for 1 day - after which they are automatically deleted by the system.
A 500 Internal Server Error is usually caused by syntactical PHP errors in your uploaded script. The response body will contain further detailed error information.
