ScriptLock API v1.0
Getting Started
The ScriptLock web service implements a RESTful API. You can use this API to remotely create and manage your products, customers and licenses.
You can also use the API to encode your PHP scripts on-the-fly and remotely verify licenses.
Requirements
You will require cURL — or a suitable HTTP client that has the ability — to send GET, POST, PUT and DELETE requests over HTTP Basic Auth.
API Credentials
The API credentials can be found on your account details page.
You will need to send these credentials via HTTP Basic Auth for each and every request to the ScriptLock web service.
Making a Basic Request
The following is an example of how to make a basic request to the ScriptLock web service, to fetch a customer record:
GET http://scriptlock.com/api/customer/{CUSTOMER_ID}
Example:
GET /api/customer/{CUSTOMER_ID} HTTP/1.1
Host: scriptlock.com
Authorization: Basic 63f9db5f7b532f1879df8dd751e185d5
By default, the returned response will ALWAYS be a JSON string (Content-Type: application/json). The above request is the same as:
GET http://scriptlock.com/api/customer/{CUSTOMER_ID}.json
Example:
GET /api/customer/{CUSTOMER_ID}.json HTTP/1.1
Host: scriptlock.com
Authorization: Basic 63f9db5f7b532f1879df8dd751e185d5
To request an XML response, simply append .xml to the end of the URI:
GET http://scriptlock.com/api/customer/{CUSTOMER_ID}.xml
Example:
GET /api/customer/{CUSTOMER_ID}.xml HTTP/1.1
Host: scriptlock.com
Authorization: Basic 63f9db5f7b532f1879df8dd751e185d5
To request a PHP serialized string, append .php to the end of the URI:
GET http://scriptlock.com/api/customer/{CUSTOMER_ID}.php
Example:
GET /api/customer/{CUSTOMER_ID}.php HTTP/1.1
Host: scriptlock.com
Authorization: Basic 63f9db5f7b532f1879df8dd751e185d5
YAML requests are NOT supported at this stage, but may be introduced later if there is a demand for it.
Standard HTTP/1.1 status codes are returned as per RFC-2616.
Only GET, PUT, POST and DELETE methods are supported at this stage.
