====== Secure-eBook SDK ====== The Secure-eBook SDK allows you to generate activation keys by having your Web server communicate directly with the Secure-eBook server. In order to use the Secure-eBook SDK, it must be enabled from within your Secure-eBook account. Get [[:sdk_config|more information]] on how to enable the Secure-eBook SDK. ===== How it works ===== The SDK works as a rather straightfoward handshake. Your Web application initiates a transaction by describing what activation keys are required. The Secure-eBook server replies with an XML message of its own, sending a //challenge token//. Your Web application replies to the challenge by encrypting the //challenge token// using information known only by you and the Secure-eBook server. If your application's challenge is validated by the Secure-eBook server, your activation keys will be generated and returned. ===== PHP SDK ===== In order to faciliate the use of the Secure-eBook SDK, we are providing you with an easy-to-use PHP script that is ready to communicate with the Secure-eBook server. You will only need to activate the Secure-eBook SDK for your account and follow the instructions found in the following link: *[[sdk:php|PHP SDK v1.1.0 download & documentation]] \\ The rest of the documentation explains how the SDK works, should you wish to communicate with it directly using XML. ===== The XML command chain ===== The SDK uses XML messages that are sent using the POST method to the Secure-eBook SDK URL: * https://www.secure-ebook.com/sdk.jsp\\ :!: NB: The current version of the SDK accepts messages in the //application/x-www-form-urlencoded// "content-type". The message should be assigned to the variable "xml". \\ Your application inintiates by sending the //request// message.\\ -> [[sdk:request]]\\ \\ If the message is validted, the Secure-eBook server returns a challenge //token//\\ <- [[sdk:token]]\\ \\ Your application confirms the token by sending a //confirm//ation message.\\ -> [[sdk:confirm]]\\ \\ If the confirmation is accepted, the Secure-eBook server returns the key within a //success// message.\\ <- [[sdk:success]]\\ \\ If anything goes wrong, the Secure-eBook server will reply by returning an //error// message.\\ <- [[sdk:error]]\\