Our API allows developers and businesses to integrate all Wannaprint print services into their website, intranet or application. You can do everything from your intranet without need to browse our website : get products list, make an order, send modifications, confirm proof, etc...
Wether you are a corporate account or provide your customers with printed products, our API will fit your interconnection needs. The implementation process is quick and easy. Our support team will stay by your side to build up the best connection between your business and our services.
A key is needed to use our API. Contact us and explain your project and we will provide you a valid API key.
Most of the methods must be authenticated (list below). The authentication process is sent securely through the API. You need the same valid login/password as on our website. Once authenticated, you will be provided by a session ID (token) what can be used to call again other methods without using login/password again.
We provide you a test environment for your development phase : testapi.wannaprint.com. This environment will allow you to make all the possible tests without engage your company into real printing production. Once your application is ready, you just have to switch to our real production server : api.wannaprint.com.
Methods execute specific functions on our system and return exploitable results. The following table presents all the available methods within our API and the documentation to use it.
| Methods | Authentication | Description |
|---|---|---|
| test | No | Return "SUCCESS" |
| loginUser | No | Log a user for authentication |
| verifyToken | Yes | Verify if authentication is alive |
| refreshToken | Yes | Renew authentication token |
| createOrder | Yes | Create an order ID |
| listProducts | Yes | List of the products |
| addItem | Yes | Add an item associated to an order ID |
| logout | Yes | Remove authentication token |
HTTP
Our API is a REST API, available via standard HTTP calls, using GET and POST queries with standard arguments.
More information about REST
Base URL
The base URL for the REST API is: http://testapi.wannaprint.com/Rest/1/[API Key]/
Return format
The data returned by the REST API is based on JSON standard format.
More information about JSON
Query Example
In this example, we call the "test" method.
GET /Rest/1/[API Key]/api/test/ HTTP/1.0 Host: testapi.wannaprint.com
http://testapi.wannaprint.com/Rest/1/[API Key]/api/test/
{
"text":["SUCCESS"]
}
We propose a PHP kit to ease your developments on a higher level. No other languages are planned for the moment.
Don't remember to ask us for a valid API key, you will have to set up in your kit.
First you have to download one of our kits :
PHPkit.zip : single PHP script to insert in your application
PHPdemo.zip : complete demo with a web interface
Unzip the archive somewhere on your server. Edit the file called settings.php by replacing the API Key and API domain with the correct one we provided you.
<?php
define('API_KEY', 'your_key_here');
define('API_DOMAIN', 'your_domain');
?>
After that call our API using this PHP code:
<?php
include_once '[Installed path]/settings.php';
include_once '[Installed path]/api.php';
$apicaller = new ApiCaller(API_KEY, API_DOMAIN);
?>
Call Methods<?php session_start(); $api_items = $apicaller->sendRequest( array( 'controller' => 'api', 'action' => '[method]', 'argument 1' => value, …. ) ); ?>