Welcome to the PopsLenticular developer hub.

You’ll find documentation to help you start working with PopsLenticular as quickly as possible. Let’s jump right in!

General information

The API base URL is https://api.popslenticular.com. All API calls are implemented as HTTP POST. Unless the API call irrecoverably crashes, the HTTP response code is always 200, and the error, if any, is specified via the `result` field in the response (which can be either `ok` or `error`).


Authentication

Each request to the API must contain an API key for authentication, in an `apikey` parameter. API keys can be generated in your dashboard.

Request data

All request data posted to the API must be in JSON objects. The documentation for each API call describes the request data parameters in detail.

Return data

Return data from the API is in JSON objects.

Content-type

​Set the `Content-Type` header to `application/json` on all requests

Calls

The API currently only provides one call, POST /process3dPicture.


/process3dPicture

Send a picture for processing. Parameters must be sent via a JSON object as follow:

{
"apikey": "abcd1324",
"input": {
"url": "https://example.com/picture.png"
},
"output": {
"hook": "https://example.com/resultListener",
"format": "png"
},
"config": {
"ppiPrinter": {
"x": 812.8,
"y": 812.8
},
"lpi": 99.47,
"printSizeCm": {
"w": 10,
"h": 15
}
}
}

Parameters:

- apikey: API key
- input.url: a URL from which we the API can download the source picture. Note that only PNG pictures are currently supported
- output.hook: a URL to which the API will send the asynchronous result (cf below)
- output.format (optional): the desired file format for the output. Possible values: `pdf`, `png`. Default value: `png`
- config.ppiPrinter: the PPI (pixels per inch) of the printing machine, with a value for `x` (horizontal/width) and `y` (vertical/height), which can be different
- config.lpi: the LPI (lenses per inch, aka "pitch") of the lenticular paper
- config.printSizeCm: the width (`w`) and height (`h`) of the output picture, in centimeters. Note that pictures must be properly oriented: the top must point towards the top, not to the left or right (or bottom, to a lesser extent). Unlike flat prints, 3D prints must be printed in the same orientation as the picture will be physically viewed, otherwise the 3D effect won't work. An upside-down picture will have working 3D, but the depth map will likely be degraded.

The route will first return a "fast" OK or error response as follow:

{
"result": "ok"
}

or for instance

{
"result": error"
"error": {
"code": "FILE_NOT_FOUND",
"description": "Couldn't download the file
http://example.com/picture.png"
}
}
}

Then when the processing is done (or failed), the API will send a POST request with a JSON object to the URL specified in `output.hook`, with either an OK reponse and a link to download the result picture, or an error response as follow:

{
"result": "ok",
"data": {
"inputUrl": "https://example.com/picture.png",
"outputUrl": "https://bucket.s3.amazonaws.com/img.png
}
}

or for instance

{
"result": "error",
"data": {
"inputUrl": "https://example.com/picture.png"
},
"error": {
"code": "BAD_INPUT_FILE",
"description": "Couldn't read the provided picture file"
}
}