Bot

flexible template - carousel 전송 오류

윤지원

2023.07.27읽음 401

https://flex-simulator.worksmobile.com/# 의 샘플 중 contact 예시를 postman에서 body-raw-json 으로 그대로 넣어 메시지를 전송했는데 
{
"code": "INVALID_PARAMETER",
"description": "content does not exist."
} 라고 에러가 뜹니다. https://developers.worksmobile.com/kr/docs/bot-send-flex-carousel 에 있는 request example을 그대로 넣어 전송해도 같은 에러가 나는데 content 속성을 어떻게 넣어야하는건가요? 

댓글3

  • 업데이트 된 답글입니다.

    bsw2428

    아래 가이드도 확인하셨을까요?
    https://developers.worksmobile.com/kr/docs/bot-send-flex-bubble

    입력하신 body 내용이 궁금합니다.

    2023.07.27

    0
  • 업데이트 된 답글입니다.

    윤지원 작성자

    body 내용입니다.
    {
     "type": "carousel",
     "contents": [
       {
         "type": "bubble",
         "size": "mega",
         "header": {
           "type": "box",
           "layout": "horizontal",
           "contents": [
             {
               "type": "text",
               "text": "WORKS MOBILE",
               "size": "lg",
               "color": "#00c73c",
               "weight": "bold"
             }
           ],
           "backgroundColor": "#ffffff"
         },
         "body": {
           "type": "box",
           "layout": "vertical",
           "contents": [
             {
               "type": "box",
               "layout": "vertical",
               "contents": [
                 {
                   "type": "image",
                   "url": "https://i.ibb.co/tXyrDKh/11-matthew-operation-quality-manager.png";,
                   "size": "full"
                 }
               ],
               "width": "120px",
               "height": "120px",
               "cornerRadius": "180px",
               "borderWidth": "1px",
               "borderColor": "#22222210",
               "offsetStart": "75px",
               "offsetEnd": "75px"
             },
             {
               "type": "box",
               "layout": "vertical",
               "contents": [
                 {
                   "type": "text",
                   "text": "John Smith",
                   "weight": "bold",
                   "size": "xl",
                   "align": "center"
                 },
                 {
                   "type": "text",
                   "text": "Graphic Designer",
                   "size": "sm",
                   "align": "center"
                 }
               ],
               "margin": "xl"
             },
             {
               "type": "box",
               "layout": "vertical",
               "contents": [
                 {
                   "type": "box",
                   "layout": "baseline",
                   "contents": [
                     {
                       "type": "text",
                       "text": "Department",
                       "size": "sm",
                       "color": "#858f89",
                       "flex": 3,
                       "margin": "md"
                     },
                     {
                       "type": "text",
                       "text": "Product Design 1",
                       "size": "sm",
                       "margin": "md",
                       "flex": 5
                     }
                   ]
                 },
                 {
                   "type": "box",
                   "layout": "baseline",
                   "contents": [
                     {
                       "type": "text",
                       "text": "Phone",
                       "size": "sm",
                       "color": "#858f89",
                       "flex": 3,
                       "margin": "md"
                     },
                     {
                       "type": "text",
                       "text": "000-111-2222",
                       "size": "sm",
                       "margin": "md",
                       "flex": 5
                     }
                   ],
                   "margin": "sm"
                 },
                 {
                   "type": "box",
                   "layout": "baseline",
                   "contents": [
                     {
                       "type": "text",
                       "text": "E-mail",
                       "size": "sm",
                       "color": "#858f89",
                       "flex": 3,
                       "margin": "md"
                     },
                     {
                       "type": "text",
                       "text": "email@works.com",
                       "size": "sm",
                       "margin": "md",
                       "flex": 5
                     }
                   ],
                   "margin": "sm"
                 }
               ],
               "margin": "xxl",
               "width": "260px",
               "alignItems": "center",
               "paddingAll": "6px"
             }
           ]
         },
         "footer": {
           "type": "box",
           "layout": "vertical",
           "contents": [
             {
               "type": "button",
               "action": {
                 "type": "uri",
                 "label": "Send a message",
                 "uri": "https://worksmobile.com"
               },
               "style": "primary"
             },
             {
               "type": "button",
               "action": {
                 "type": "uri",
                 "label": "Call",
                 "uri": "https://worksmobile.com"
               },
               "margin": "md",
               "style": "secondary"
             }
           ]
         }
       },
       {
         "type": "bubble",
         "size": "mega",
         "header": {
           "type": "box",
           "layout": "horizontal",
           "contents": [
             {
               "type": "text",
               "text": "WORKS MOBILE",
               "size": "lg",
               "color": "#00c73c",
               "weight": "bold"
             }
           ],
           "backgroundColor": "#ffffff"
         },
         "body": {
           "type": "box",
           "layout": "vertical",
           "contents": [
             {
               "type": "box",
               "layout": "vertical",
               "contents": [
                 {
                   "type": "image",
                   "url": "https://i.ibb.co/jrD8083/05-emma-business-maketing-manager.png";,
                   "size": "full"
                 }
               ],
               "width": "120px",
               "height": "120px",
               "cornerRadius": "180px",
               "borderColor": "#22222210",
               "borderWidth": "1px",
               "offsetStart": "75px",
               "offsetEnd": "75px"
             },
             {
               "type": "box",
               "layout": "vertical",
               "contents": [
                 {
                   "type": "text",
                   "text": "Sarah Harding",
                   "weight": "bold",
                   "size": "xl",
                   "align": "center"
                 },
                 {
                   "type": "text",
                   "text": "UX Designer",
                   "size": "sm",
                   "align": "center"
                 }
               ],
               "margin": "xl"
             },
             {
               "type": "box",
               "layout": "vertical",
               "contents": [
                 {
                   "type": "box",
                   "layout": "baseline",
                   "contents": [
                     {
                       "type": "text",
                       "text": "Department",
                       "size": "sm",
                       "color": "#858f89",
                       "flex": 3,
                       "margin": "md"
                     },
                     {
                       "type": "text",
                       "text": "Interface Design 1",
                       "size": "sm",
                       "margin": "md",
                       "flex": 5
                     }
                   ]
                 },
                 {
                   "type": "box",
                   "layout": "baseline",
                   "contents": [
                     {
                       "type": "text",
                       "text": "Phone",
                       "size": "sm",
                       "color": "#858f89",
                       "flex": 3,
                       "margin": "md"
                     },
                     {
                       "type": "text",
                       "text": "333-444-5555",
                       "size": "sm",
                       "margin": "md",
                       "flex": 5
                     }
                   ],
                   "margin": "sm"
                 },
                 {
                   "type": "box",
                   "layout": "baseline",
                   "contents": [
                     {
                       "type": "text",
                       "text": "E-mail",
                       "size": "sm",
                       "color": "#858f89",
                       "flex": 3,
                       "margin": "md"
                     },
                     {
                       "type": "text",
                       "text": "email@works.com",
                       "size": "sm",
                       "margin": "md",
                       "flex": 5
                     }
                   ],
                   "margin": "sm"
                 }
               ],
               "margin": "xxl",
               "width": "260px",
               "alignItems": "center",
               "paddingAll": "6px"
             }
           ]
         },
         "footer": {
           "type": "box",
           "layout": "vertical",
           "contents": [
             {
               "type": "button",
               "action": {
                 "type": "uri",
                 "label": "Send a message",
                 "uri": "https://worksmobile.com"
               },
               "style": "primary"
             },
             {
               "type": "button",
               "action": {
                 "type": "uri",
                 "label": "Call",
                 "uri": "https://worksmobile.com"
               },
               "margin": "md",
               "style": "secondary"
             }
           ]
         }
       }
     ]
    }

    2023.07.27

    0
  • 업데이트 된 답글입니다.

    윤지원 작성자

    위 body 내용을 아래 contents 에 넣어야 동작하는 것 확인했습니다.
    {
     "content": {
       "type": "flex",
       "altText": "미리보기 텍스트",
       "contents":

     }
    }

    2023.07.28

    0
이전 글Bot을 통한 Image전송 시 아이폰 네이버웍스에서 이미지 확인 불가 현상
다음 글봇으로 메세지 수정하는 API 존재 여부
목록

궁금한 점을 해결하지 못하셨나요?
지금 바로 NAVER WORKS 사용자들에게 물어보세요!