API
Documentation

Requesting a render via API

This guide explains how to request a render via the API.

Authorisation

To request a render, you must be authenticated with an API token. You can view a guide on how to create one by visiting the Creating API Tokens page.

Authorisation is done by including the 'Authorization' header with the token in the request. The header should be in the format 'Bearer <token>'.

POSTCreate Render Request

https://imagefactory.io/api/request-render

Note: You will need to set the request Accept header to be 'application/json'

Request Body

The request body should be a JSON object

{
    "input_{x}": "<Input {x} Content>",
    "theme_id": <Theme ID>,
    "key": "",
}

Note: input_{x} would be replaced with input_1, input_2, input_3 ... input_30. If the theme expects an image input, add the full URL including https:// to the properties value. You would use the key to add your own unique reference so that you know where that render result belongs to.

As soon as you make the request, you will get this response:

{
    "success": true,
    "uuid": "944f4320-161a-454e-9539-e896d4d6cbe8",
    "webhook_url": "https://yourwebhook.com/webhook/imagefactory"
}

Where `uuid` is the unique id of the request, and the `webhook_url` is the url where the results will be sent to. Use this `uuid` to track what webhook response is for which original request.

Once the image has been generated, the webhook url will be sent the following in json format:

{
    "uuid":"944f4320-161a-454e-9539-e896d4d6cbe8",
    "public_url":"https:\/\/imagefactory.io\/storage\/oFjobEqkKMY2CHwN2DnnrJsonXzniww727wwdwvU.jpg”
}

Where uuid identifies the original request, and public_url is where the asset is stored. You can take that and download the image as required