POST /content/resources/find
When a user interacts with a content extension, Canva sends POST
requests to the following endpoint:
<base_url>/content/resources/find
Specifically, Canva sends this request when a user:
- Opens an extension.
- Opens a container.
- Paginates through resources.
- Searches for content.
The purpose of this request is to retrieve content that Canva can display in the side panel of the editor, such as images, embeds, or containers.
The types
property in the request body determines the type of resources the extension can provide in the response. For example, when value of the types
includes "IMAGE"
, the endpoint can respond with image resources.
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. - To configure the type of resources that Canva expects the extension to provide, change the extension's Content type via the Developer Portal.
- Extensions should meet the UX guidelines.
Request
Endpoint
POST <base_url>/content/resources/find
Headers
Body
Properties
Example
{"limit": 100,"user": "<user>","brand": "<brand>","label": "<label>","locale": "<locale>","types": "<types>"}
Responses
200 - Success (containers)
The response an extension must provide when the types
property in the request body includes "CONTAINER"
.
Properties
Example
{"resources": [],"type": "SUCCESS"}
200 - Success (embeds)
The response an extension must provide when the types
property in the request body includes "EMBED"
.
Properties
Example
{"resources": [],"type": "SUCCESS"}
200 - Success (images)
The response an extension must provide when the types
property in the request body includes "IMAGE"
.
Properties
Example
{"resources": [],"type": "SUCCESS"}
200 - Success (videos)
The response an extension must provide when the types
property in the request body includes "VIDEO"
.
Properties
Example
{"resources": [],"type": "SUCCESS"}
200 - Error
The response an extension provides when it can't provide the requested resources.
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
Container
Represents a container (folder) that Canva renders in the side panel. When a user selects a container, Canva sends a request for resources that belong to the container.
Properties
Example
{"id": "<id>","name": "<name>","type": "CONTAINER"}
Embed
Represents embeddable media that Canva renders in the side panel, such as a YouTube video or Instagram photo. When a user selects an embed, Canva adds it to their design.
Properties
Example
{"id": "<id>","name": "<name>","type": "EMBED","url": "<url>","thumbnail": {"url": "<url>"}}
Image
Represents an image file that Canva renders in the side panel, such as a PNG or SVG.
Properties
Example
{"id": "<id>","name": "<name>","type": "IMAGE","url": "<url>","contentType": "<content_type>","thumbnail": {"url": "<url>"}}
Video
Represents a video file that Canva renders in the side panel, such as an MP4 or MOV file.
Properties
Example
{"width": 0,"height": 0,"durationMs": 0,"id": "<id>","name": "<name>","type": "VIDEO","url": "<url>","contentType": "<content_type>","thumbnail": {"url": "<url>"}}
Thumbnail
A thumbnail image.
Properties
Example
{"url": "<url>"}