The download requires that you use a temporary script page on your server. This page will call the Download a publication API, and will then redirect the user's browser to the final download URL received in the response. This final download URL is time-limited.
Use the following web service when the user has requested the download of an e-book. The Platform will return a chronodegradable URL (valid for one minute). Do not post the URL to the user: you simply need to redirect the user's browser to this URL so that the download begins immediately and automatically.
Steps for downloading a file:
The user clicks on the link to download a book (from an email or confirmation page);
The merchant receives the request for download and uses the web service for downloading a publication (2.2). In return, he receives a chronodegradable URL for download;
The merchant automatically and instantly redirects the user to the received chronodegradable download URL;
Download starts.
Declaration
Address : /api/organisations/[organisation_id]/customers/[customer_id]/transactions/[transaction_id]/publications/[isbn]/download_links/[format]
Method : GET
Security : HTTP/BASIC (Use your username and password)
Parameters
organisation_id : (Mandatory)
Your merchant number. This number is provided upon registration.
customer_id : (Mandatory)
The client's unique ID number. Alphanumerical characters ("-" and "_" accepted).
transaction_id : (Mandatory)
The transaction / purchase basket's unique ID number.
isbn : (Mandatory)
The publication's ISBN/EAN.
format : (Mandatory)
The publication format (pdf/epub/mobi).
uname : (Mandatory)
First and last name of the user. The value of this parameter will appear in the text of the digital watermark that will be placed on the file.
Responses
200 : OK
Chronodegradable download URL (expires after 1 minute). Redirect user toward this URL.
400 : missing_transaction_id
You did not enter a transaction ID.
401 : access_denied
You do not have access to the resource.
404 : not_found
Your organisation could not be found.