API Documentation

Download your user's output (graphic/image) and redirect them on your site ?




Introduction :

Within the embedded Studio, your users will be invited to click on a "call-to-action" button as soon as they will have completed their graphic/image. Keep in mind that, you can configure the label button yourself from the "Customization tool".

Once your users will click on this "call-to-action" button, your platform will get full control over graphics/images created by your users! Our platform will automatically send, in real time, an HTTP POST request to your server containing created graphics to let you be notified and process information as you wish.

This API push (HTTP POST) will be performed on the URL of your choice (Configure your "OUTPUT" URL). Once your server will receive those requests, you are free to store output graphics wherever you want on your server (to re-edit them later). Then, using the HTTP Response, you can redirect your user on the webpage of your choice on your own website.


Appendix :





How you server will be notified when your users get finished editing their graphic/image ?




From the studio, your users will be invited to click on a "call-to-action" button as soon as they will have finished editing their graphic/image. You can configure this button label anytime from the "Customization tool".

Our platform will automatically send, in real time, a HTTP POST request to your server containing the updated graphics to let you process them as you wish and redirect users elsewhere on your webapp.

This API push (HTTP POST) will be performed on the URL of your choice (Configure your "OUTPUT" URL)

Find out here what parameters will be posted on your OUTPUT URL ?







Where to define your OUTPUT URL ?




Define your "OUTPUT" URL from the "Customization tool" (accesible from your dashboard). Scroll down the list of customized fields until you read "Output URL".

As a reminder, this URL will be consumed (HTTP Post request) by our API as soon as your user will finish editing inside the Studio. (See image below)











What parameters will be posted on your OUTPUT URL ?




From the HTTP POST Request, your server will receive few parameters:
  • the graphic/image name ("graphicName")
  • the graphic/image as a PNG image ("b64PNG" encoded in the POST request in base 64)
  • the graphic/image as an HTML document ("b64HTML" encoded in the POST request in base 64)
  • Your uid (See this doc to set your internal identifier). (Optional field that you can pass as parameter when opening the Studio with an IFRAME).

Pixelixe Studio import/export mechanism supports HTML document. Therefore, the "b64HTML" is essential if you want to reopen draft or already existing graphic inside the Studio. (You can't reopen RAW image, only HTML file that contains metadata to make editing possible)

Once you will decode the base64 "b64HTML" parameter, we strongly recommend to store this HTML file on your server. For example, to allow your users to update one of their creations later.

Moreover, once decoded, we strongly recommend to store the "b64PNG" image on your server as well. For example, you might want to use this image as a preview to display all your users's graphic created once authenticated.


WARNING : As a reminder, the Studio can edit HTML templates only if they have been exported/downloaded from the Studio itself. (You cannot import external HTML files.)



Find below more details about parameters that will be pushed to your OUTPUT URL each time one of your users will have finished editing a graphic or image inside the studio.
Parameter Type Description
uid string If you passed a uid in the request opening the studio, you will get back the exact same uid in this POST.This way you have an easy way to match connected users on your site with their documents posted on your server. If none, the returned uid will be empty.
graphicName string If you passed a graphicName in the API call to open the studio, you will get back the same graphicName. If you allowed your users to modify the name themselves within your embedded Studio, you will receive their updated name. (You can decide to let them modify the name from the unchecking the "Document name input field" from the "Customization tool")
b64PNG string Base64 encoded PNG image of the graphic/image edited by the user.
b64HTML string Base64 encoded HTML document of the graphic/image edited by the user. This document can be imported again anytime in the studio using the "graphicUrl" parameter. Find here how to re-edit a stored document in the studio










Can I decide whether users should download graphics directly from the studio or not?




Yes, by default, "direct downloads" from the studio are disabled. You can uncheck this settings from the "Customization tool" anytime (See image below). If unchecked, your users will be able to download their document directly inside the studio.

WARNING : Your OUTPUT URL won't receive your users' creation in this case. You won't be notified when they get finished editing either.

If checked, they won't be able to download it right from the Studio. Your server will receive their creation from the POST on your OUTPUT URL and you will be in charge of delivering their creation anytime you want. (See image below to understand where to check/uncheck from the "Customization tool").











Can I tune/customize the Call-to-action button used by users once they will finish editing graphic/images?




Yes, from the "Customization tool", you can change the label of the actionable button that will trigger the HTTP POST on your OUTPUT URL. You can change the name anytime (Ex : Save, Next, Download, Validate)











How to redirect your user after their edits ?




In response to the HTTP POST request pushed to your "OUTPUT" URL, you can redirect your user to the page of your choice. For example, you can notify them you susccessfuly saved their work or you can provide your own download button on the next screen.