POST /publish/resources/find
If a publish extension uses the Flat list or Nested list layout, Canva sends POST
requests to the following endpoint:
<base_url>/publish/resources/find
Specifically, Canva sends these requests when a user:
- Opens an extension that uses the Flat list or Nested list layout.
- Opens a container in an extension that uses the Nested list layout.
The purpose of these requests is to retrieve a list of resources from the extension and then render those resources in the Publish menu as files or folders.
When a resource is rendered as a folder, a user can select it and publish their design to a specific location on the destination platform (such as a specific folder in Dropbox).
When a resource is rendered as a file, a user can't interact with it.
Notes
- Extensions must respond to this request within 8 seconds.
- When sending this request, Canva replaces
<base_url>
with the extension's Base URL. You can configure the Base URL via the Developer Portal. - The API refers to files as
"IMAGE"
resources and folders as"CONTAINER"
resources. - Extensions should meet the UX guidelines.
Request
Endpoint
POST <base_url>/publish/resources/find
Headers
Body
Properties
Example
{"limit": 100,"preferredThumbnailHeight": 500,"preferredThumbnailWidth": 500,"user": "<user>","brand": "<brand>","label": "<label>","designId": "<design_id>"}
Responses
200 - Success
The response an extension provides when it can return a list of resources to render in the Publish menu.
Properties
Example
{"resources": [],"type": "SUCCESS"}
200 - Error
Properties
Example
{"type": "ERROR","errorCode": "<error_code>"}
401 - Invalid request signature or timestamp
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.
Schemas
Resource
Properties
Example
{"isOwner": true,"readOnly": true,"id": "<id>","name": "<name>","type": "<type>"}
Thumbnail
A thumbnail image.
Properties
Example
{"url": "<url>"}