API

Use our powerful API to use Sumo apps in your websites or apps.

Sumopaint

Example (open): https://sumo.app/paint/en?url=https://sumo.app/images/icon.png
Variable Default value Description
bg opaque Image background (opaque, transparent, hex)
title Untitled Image name
layer Layer 1 Layer name
target /works Path to POST the data
width 800 Force image width
height 600 Force image height
zoom 0 Start zoom level (0 = zoom to fit, 100 = 100%)
work Work slug to be opened
url Image URL to be opened
mask Mask image URL to be on top
maskmode 0 Mask in saving (0=hide,1=include,2=exclude)
opt Optional data as string

Integrate Sumopaint to your website

Embed with iframe:



Example 1: Save to your API with target parameter

https://sumo.app/paint/en?target=https://www.inni.com/api/example.php

Example.php: <?php if(isset($_POST["imagedata"])) print '<img src="'.$_POST["imagedata"].'" />'; ?>

Example 2: Start with image url

https://sumo.app/paint/en?url=https://www.inni.com/images/summer.jpg

Example 3: Use mask and image size

https://sumo.app/paint/en?width=600&height=600&mask=https://www.inni.com/images/mask.png&target=https://www.inni.com/api/sumo.php

Example 4: Use mask mode for different outputs

https://sumo.app/paint/en?mask=https://www.inni.com/images/mask.png&url=https://www.inni.com/images/summer.jpg&target=https://www.inni.com/api/sumo.php
Mask image (transparent)

Image url (original)

Maskmode = 0 (default)

Export in maskmode = 1

Export in maskmode = 2

Save target data to your server

INNI example (sumo.php)

                    <?php

                            if(!isset($_POST["imagedata"])) exit("imagedata not found");

                            $code = "create-unique-image-code-here";
                            $data = str_replace(' ','+',str_replace('data:image/png;base64,','',$_POST["imagedata"]));
                            $image = imagecreatefromstring(base64_decode($data));
                            imagepng($image,"/var/www/images/sumo/".$code.".png");
                            header("Location: https://www.inni.com/#design/".$code);

                        ?>
                    

PHP example sources

Download example sources from below:

Download PHP example source code