Messages
Require users to provide a message before publishing their design.
When a user publishes a design via a publish extension, the extension can require them to provide a message. Canva then includes this message in the upload request.
This tutorial explains how to require users to provide a message when publishing a design.

Step 1: Enable the message field

By default, Canva doesn't prompt users to provide a message. You must enable the feature.
To enable the message field:
  1. 1.
    Navigate to an app via the Developer Portal.
  2. 2.
    From the Extensions page, expand the Publish panel.
  3. 3.
    Enable Require a message.
  4. 4.
    (Optional) Customize the maximum length of the message via the Max message length field.

Step 2: Handle requests with messages

When a user publishes a design, Canva sends a POST request to the following endpoint:
1
<base_url>/publish/resources/upload
Copied!
You can access the user's message in the body of the request, via the message property:
1
app.post("/publish/resources/upload", async (request, response) => {
2
console.log(request.body.message);
3
});
Copied!

Limitations

  • You can't customize the placeholder text of the message field.
  • If the message field is enabled, it must be required. It can't be enabled and optional.

Example

1
const express = require("express");
2
const app = express();
3
4
app.use(express.json());
5
app.use(express.static("public"));
6
7
app.post("/publish/resources/upload", async (request, response) => {
8
// Do something with the message
9
console.log(request.body.message);
10
11
// Respond to the request
12
response.send({
13
type: "SUCCESS",
14
});
15
});
16
17
app.listen(process.env.PORT || 3000);
Copied!
Last modified 1mo ago