PicMonkey's online photo editor API allows you to add best-of-breed photo editing tools to your website without lifting a finger. (You can type a few lines of code with your toes, right?) Your users will be able to unleash their inner genius, have a feeding frenzy on crazy-awesome effects, and save their final edited photo back to your servers, all while singing your praises for providing them with the photo goodness. You can access an API key here: https://www.picmonkey.com/api
The PicMonkey API is pretty easy to use: you just load a URL in a browser window (or iframe). The base URL is always https://www.picmonkey.com/service. In most cases, you can launch an API request with either a GET or a POST. You also must pass your API key in the _apikey parameter. Please contact us at email@example.com to get one.
All of the examples here will use 00112233445566778899aabbccddeeff as the API key. For example: https://www.picmonkey.com/service?_apikey=00112233445566778899aabbccddeeff
In most use cases, you’ll want to have PicMonkey automatically load an image. The key to making this happen is the _import parameter. You can either specify a URL or a POST form field containing the image you wish to open.
Loading a URL
Loading from a POST
<form method="post" action="https://www.picmonkey.com/service/" enctype='multipart/form-data'> <input type="hidden" name="_import" value="image_file"/> <input type="file" name="image_file" size="30"> <input type="submit" value="Upload this image"/> <input type="hidden" name="_apikey" value="00112233445566778899aabbccddeeff"/> </form>
PicMonkey provides two main ways to get the edited image back to your servers. We can send it directly via a POST, or we can send a temporary URL (via GET or POST) that you can use to fetch the image. The POST method is generally the most efficient. The default is the ‘direct POST’ method.
To receive a direct POST of the edited image, pass the following parameters to the API:_export = <the url to POST data to (make sure this is URL encoded!)>_export_agent = “server”_export_method = “POST”
After the post is complete, the browser itself will navigate to the _export url. If you’d like to go to a different URL, pass it along in the _redirect parameter.
To receive a temporary URL, pass these parameters:_export = <the url to POST data to (again, make sure this is URL encoded)>_export_agent = “browser”_export_method = “POST” or “GET”
You may want to ask the user if it’s OK to overwrite an image when saving. This feature is controlled via the _replace and _imageid parameters. The _replace parameter can take four possible values. The combination of those values and the user’s actions control whether or not _imageid is included as a parameter on the export request.
no: _imageid is never passed through. This is the default.
yes: _imageid is always passed through
ask: The user is asked if they would like to replace the image or save a new copy. If they say ‘replace’ _imageid is passed through, otherwise it’s not passed.
confirm: The user is asked if they would like to replace the image. If they say ‘yes’, _imageid is passed through. If they say ‘no’, they are returned to the editor.
There is no requirement that _imageid actually be the ID of anything. For example, you could always pass a constant, and simply use its existence to determine whether or not to replace the image.
_import Specifies the image to load _returntype Desktop software can POST an image to the API and pass _returntype=text to receive a URL that can then be loaded in a browser. _title Pass a title to be used when saving an image to a user's computer. _export URL to use for exporting an image _export_agent Where should the export originate from _export_field Name of the field to contain the exported image _export_method Should the export be via HTTP GET or POST? _imageid The 'id' of the image being edited. See above for more information. _replace Optionally ask the user before overwriting. See above for more information. _out_format The output file format (png or jpg). jpg is the default. _out_quality The output compression quality (1-10). The default is 8. _out_maxwidth Maximum output width in pixels. _out_maxheight Maximum output height in pixels. _close_target URL for a destination when the user selects "close" _redirect URL to redirect the browser to after export. _exclude UI elements to disable. Currently, only the value of ‘in’ is supported. If specified, the upload button will be hidden.