If an editing extension supports remote image processing, it's not always possible for the extension to process the user's image on the server before the request times out. (The current timeout duration is 30 seconds for China and 15 seconds for the rest of the world.)
In these cases, the /editing/image/process
can initiate polling. Canva then repeatedly sends POST
requests to the following endpoint for up to 60 seconds:
<base_url>/editing/image/process/get
The purpose of these requests is to check if the image processing task is complete. Once it is, the remoteProcess
method returns the user's processed image.
When sending this request, Canva replaces <base_url>
with the extension's Base URL. You can configure the Base URL via the Developer Portal.
POST <base_url>/editing/image/process/get
Property | Type | Required | Description |
| string | Yes | A comma-separated list of request signatures. |
| string | Yes | The UNIX timestamp (in seconds) of when Canva sent the request. |
Property | Type | Required | Description |
| string | Yes | The ID of the user. |
| string | Yes | The ID of the user's team. |
| string | Yes | The ID of the processed image. |
{"user": "<user>","brand": "<brand>","id": "<id>"}
The response an extension provides when the image processing task is ongoing and polling should continue.
Property | Type | Required | Description |
|
| Yes | The type of response. |
{"type": "SUCCESS"}
The response an extension provides when the image processing task has finished, the extension can provide the user's processed image, and polling can be stopped.
Property | Type | Required | Description |
|
| Yes | The type of response. |
| object | Yes | The processed image. |
| string | Yes | The file type of the processed image. Enum: |
| string | Yes | The URL of the processed image. |
| integer | Yes | The width of the processed image (in pixels). |
| integer | Yes | The height of the processed image (in pixels). |
| Array<Blob> | No | Any Blobs the client-side code needs to process the user's image. This array is limited to 3 items. |
| string | No | Any metadata the client-side code needs to process the user's image. |
{"resource": {"width": 0,"height": 0,"type": "<type>","url": "<url>"},"type": "SUCCESS"}
Property | Type | Required | Description |
|
| Yes | The type of response. |
| string | Yes | An error code that describes what went wrong. |
{"type": "ERROR","errorCode": "<error_code>"}
An extension must verify the request signature and timestamp of all incoming requests. When an extension can't verify either of these values, it must reject the request with a 401
status code.
Property | Type | Required | Description |
| string | Yes | A unique ID of the Blob. |
| string | Yes | The file type of the Blob. Enum: |
| string | Yes | The URL of the Blob. |
{"id": "<id>","type": "<type>","url": "<url>"}