Question Details

Answered
API can not send Carousel

I used "line-bot-sdk-nodejs" to create chat-bot. For template of "confirm" it works OK.

But for template of "Carousel" it not works. (Try for from the sample at https://developers.line.me/en/docs/messaging-api/reference/#carousel)

My Bot send the following data:

    url: 'https://api.line.me/v2/bot/message/reply',
    data: '{"messages":[{"type":"template","altText":"this is a carousel template","template":{"type":"carousel","columns":[{"thumbnailImageUrl":"http://apps.tipjer.com/tj/img/product_cat_x.png","imageBackgroundColor":"#FFFFFF","title":"this is menu","text":"description","defaultAction":{"type":"uri","label":"View detail","uri":"http://example.com/page/123"},"actions":[{"type":"postback","label":"Buy","data":"action=buy&itemid=111"},{"type":"postback","label":"Add to cart","data":"action=add&itemid=111"},{"type":"uri","label":"View detail","uri":"http://example.com/page/111"}]},{"thumbnailImageUrl":"http://apps.tipjer.com/tj/img/product_cat_x.png","imageBackgroundColor":"#000000","title":"this is menu","text":"description","defaultAction":{"type":"uri","label":"View detail","uri":"http://example.com/page/222"},"actions":[{"type":"postback","label":"Buy","data":"action=buy&itemid=222"},{"type":"postback","label":"Add to cart","data":"action=add&itemid=222"},{"type":"uri","label":"View detail","uri":"http://example.com/page/222"}]}],"imageAspectRatio":"rectangle","imageSize":"cover"}}],"replyToken":"2162961c5f4d4023a04a61acb359079f"}' },

But LINE API return

response: { status: 400, statusText: 'Bad Request',

Please help.

0
Profile picture
กฤต/Krit

Answers

3
Profile picture
Michelle Neysa
Posted: 1 years ago

Hi Krit !

From what i see, the problem might be the url of thumbnailImageUrl and the url itself, LINE requires you to use HTTPS for the url, so make sure to add url with HTTPS.

Cheers !

Profile picture
กฤต/Krit
Posted: 1 years ago

Thanks. It's work.

Profile picture
sahid
Posted: 6 months ago

thanks. guys

Are you sure? question.vm