Using the API

To connect to the live Sales API on Glassboxx Server, your website should send HTTPS POST requests to the base URL:
https://server.glassboxx.co.uk/rest/V1. (Note that Enterprise Glassboxx clients will be given dedicated base URL.)
Request headers
Request headers must include the following:-
| Header name | Content-Type |
| Header value | application/json |
After the authorisation request, all subsequent request headers must also include the following:-
| Header name | Authorization |
| Header value | Bearer <value of token returned by authorization request>, eg. ‘Bearer uu3q4d2oj1t446psdfveusbozm9k0yvu’ – without the single quotes |
UX Handling
To give your website customers a smooth and simple UX, after the audiobook and/or eBook purchase has been confirmed, the order success page on your website and any outgoing new order emails sent by your website should include details how the end customer can access their purchases.
For sample copy, graphics and the app stores links to be used on your order success page and order confirmation emails, go to https://glassboxx.com/demo/ebook-audiobook-help/.
(Please note. Glassboxx does not send an order confirmation email for orders sent to the Sales API.)
Error handling
Standard error handling should be included so that errors returned by Glassboxx can be gracefully handled for the end user. It is also worth implementing retry logic in the event of errors being returned.
Testing Procedure
To test the set up, from your own test/staging or live website, place an order for an audiobook or eBook. Using the Glassboxx links on the order success page, download and install the Glassboxx app on your smartphone or tablet, and then log using the same email address as used for your purchase. You should see your purchased book under MY BOOKS in the app, and tapping on the cover image should open the ereader or audioplayer allowing you to read/listen to the book.
After having made your purchase, and used the Glassboxx app to read/listen to your eBook/Audiobook, you should then log in to your Glassboxx Vendor portal, where you will see a record of the purchase you made under SALES / Orders.