You’ll find documentation to help you start working with PopsLenticular as quickly as possible. Let’s jump right in!
The API base URL is https://api.popslenticular.com
. All API calls are implemented as HTTP POST. Unless the API call irrecoverably crashes or the route doesn't exist, 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
).
Each request to the API must contain an API key for authentication, in an apiKey
parameter. API keys can be generated in your dashboard.
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 from the API is in JSON objects.
Set the Content-Type
header to application/json
on all requests
The API currently only provides one call, POST /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" }, "configName": "my-config" }
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`
- configName
: the name of the configuration to be used, as listed in your dashboard
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 response 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" } }