gentle-traffic-20783
08/25/2025, 3:46 AMgentle-traffic-20783
08/25/2025, 3:47 AMlimited-pencil-78283
08/25/2025, 1:18 PMgentle-traffic-20783
08/25/2025, 1:48 PMgentle-traffic-20783
08/25/2025, 1:50 PMlimited-pencil-78283
08/25/2025, 2:04 PMlimited-pencil-78283
08/25/2025, 2:04 PMgentle-traffic-20783
08/25/2025, 3:09 PMgentle-traffic-20783
08/25/2025, 7:48 PMlimited-pencil-78283
08/26/2025, 4:04 PMconst SPREADSHEET_ID = '<spread sheet id>';
const RANGE = 'Menu!A2:C';
const API_KEY = 'API Key';
const url = `https://sheets.googleapis.com/v4/spreadsheets/${SPREADSHEET_ID}/values/${RANGE}?key=${API_KEY}`;
const res = await fetch(url);
const json = await res.json();
if (!json.values) {
throw new Error('No data found in sheet');
}
const products = json.values.map(([propertyName, price, image]) => ({
propertyName: propertyName?.trim(),
price: price?.trim(),
image: image?.trim(),
link: image?.trim()
}));
await client.createMessage({
userId: event.botId,
conversationId: event.conversationId,
tags: {},
type: 'carousel',
payload: {
type: 'carousel',
items: products.map((product) => ({
type: 'card',
title: product.propertyName,
subtitle: product.price,
imageUrl: product.image,
actions: [
{
label: 'View Product',
value: product.link,
action: 'url'
}
]
}))
}
});limited-pencil-78283
08/26/2025, 4:04 PMlimited-pencil-78283
08/26/2025, 4:04 PMgentle-traffic-20783
09/02/2025, 5:08 AMBearer ${'my personal access token'},
'x-bot-id': 'my bot id',
'Content-Type': 'application/json'
},
body: JSON.stringify(body)
})
if (!res.ok) {
const text = await res.text().catch(() => '')
throw new Error(Runtime API failed ${res.status}: ${text})
}
I have tried multiple ways, and recently i have tried this one but all in vain.
The error I am getting is
Error executing action "inline-card:"Dynamic Carousel Display for Milkshake Menu Options".js" in flow:MenuWorkflow:node:Standard6
[Error, Runtime API failed 400: {"id":"c81685bb102b222cb0fcc0d194ffb268","code":400,"type":"InvalidPayload","message":"request/body must have required property 'tags', request/body/userId must NOT have fewer than 28 characters, request/body/conversationId must NOT have fewer than 28 characters"}
but i don't know where to get userId and conversationId.
One way is to use event.botId and event.conversationId, but not workinglimited-pencil-78283
09/02/2025, 8:17 AMgentle-traffic-20783
09/02/2025, 10:36 AMlimited-pencil-78283
09/04/2025, 6:47 PMconst properties = [
{
propertyName: 'Villa Aurora',
price: '$750,000',
image: 'https://www.roofandfloor.com/project/1658/gallery/Casagrand_Boulevard_1.jpg',
link: 'https://www.roofandfloor.com/bengaluru/project/casagrand-boulevard-in-hennur-road/1658'
},
{
propertyName: 'Oceanview Estate',
price: '$1,200,000',
image: 'https://www.roofandfloor.com/project/2911/gallery/Casagrand_Zaiden_1.jpg',
link: 'https://www.roofandfloor.com/bengaluru/project/casagrand-zaiden-in-talaghattapura/2911'
},
{
propertyName: 'Mountain Retreat',
price: '$620,000',
image: 'https://www.roofandfloor.com/project/2729/gallery/GVS_Habitat_1.jpg',
link: 'https://www.roofandfloor.com/bengaluru/project/gvs-habitat-in-babusa-palya/2729'
},
{
propertyName: 'City Lights Condo',
price: '$480,000',
image: 'https://www.roofandfloor.com/project/2678/gallery/VA_Serenity_1.jpg',
link: 'https://www.roofandfloor.com/bengaluru/project/va-serenity-in-nelamangala/2678'
},
{
propertyName: 'Lakeside Bungalow',
price: '$530,000',
image: 'https://www.roofandfloor.com/project/2676/gallery/VA_Purity_1.jpg',
link: 'https://www.roofandfloor.com/bengaluru/project/va-purity-in-sondekoppa-road/2676'
}
]
// Construct carousel items
const carouselItems = properties.map((product) => {
return {
type: 'card',
title: {
dynamicValue: product.propertyName,
valueType: 'dynamic'
},
imageUrl: {
dynamicValue: `${product.image}`,
valueType: 'dynamic'
},
actions: [
{
action: 'postback',
label: {
dynamicValue: 'Open',
valueType: 'dynamic'
},
value: {
dynamicValue: `${product.link}`,
valueType: 'dynamic'
}
}
]
}
})
bp.dm.replyToEvent(event, {
type: 'carousel',
items: carouselItems
})
https://cdn.discordapp.com/attachments/1409383414041149511/1413233969763320019/image.png?ex=68bb3033&is=68b9deb3&hm=921716e9d94ced33c6141fa92f59b5c0e3f98088dd59ce6f3e7d5b866a60a7c2&
https://cdn.discordapp.com/attachments/1409383414041149511/1413233970413305866/image.png?ex=68bb3033&is=68b9deb3&hm=eb760f1e9f017be59bbef34ca27a83f8d7247356b30815ef74f2918a7e92b607&gentle-traffic-20783
09/04/2025, 6:52 PMgentle-traffic-20783
09/05/2025, 7:30 AMgentle-traffic-20783
09/05/2025, 7:43 AMlimited-pencil-78283
09/06/2025, 6:49 AMlimited-pencil-78283
09/06/2025, 6:51 AM${product.link},
valueType: 'dynamic'
}
}
]
https://cdn.discordapp.com/attachments/1409383414041149511/1413778578302173244/image.png?ex=68bd2b67&is=68bbd9e7&hm=52e8d996bc3fc18d8e8718bd6a6b304269eb95c7566f2f3f97dec1ced071744f&gentle-traffic-20783
09/06/2025, 11:08 AM