example


XREM KEY : * ANS :___XTEXT___ $https://apiurl?q=###KEY###&userid=###LINEUSERID###


https://medium.com/linedevth/%E0%B8%89%E0%B8%B5%E0%B8%81%E0%B8%81%E0%B8%8E%E0%B8%81%E0%B8%B2%E0%B8%A3%E0%B9%81%E0%B8%AA%E0%B8%94%E0%B8%87%E0%B8%9C%E0%B8%A5%E0%B8%82%E0%B9%89%E0%B8%AD%E0%B8%84%E0%B8%A7%E0%B8%B2%E0%B8%A1%E0%B9%81%E0%B8%9A%E0%B8%9A%E0%B9%80%E0%B8%94%E0%B8%B4%E0%B8%A1%E0%B9%86%E0%B9%83%E0%B8%99-line-messaging-api-%E0%B8%94%E0%B9%89%E0%B8%A7%E0%B8%A2-flex-message-4ad4370562f

1---------------------  เมนูรวม

{
  "type": "carousel",
  "contents": [
    {
      "type": "bubble",
      "styles": {
        "footer": {
          "backgroundColor": "#04B45F"
        }
      },
      "header": {
        "type": "box",
        "layout": "horizontal",
        "contents": [
          {
            "type": "box",
            "layout": "baseline",
            "contents": [
              {
                "type": "icon",
                "size": "xxl",
                "url": "https://ssl.gstatic.com/onebox/weather/64/partly_cloudy.png"
              }
            ]
          },
          {
            "type": "box",
            "layout": "vertical",
            "flex": 5,
            "contents": [
              {
                "type": "text",
                "text": "รวมข้อมูลคุณภาพอากาศ",
                "weight": "bold",
                "color": "#0B2161",
                "size": "md",
                "gravity": "top"
              }
            ]
          }
        ]
      },
      "footer": {
        "type": "box",
        "layout": "vertical",
        "spacing": "sm",
        "contents": [
          {
            "type": "button",
            "style": "primary",
            "color": "#0B3B17",
            "action": {
              "type": "message",
              "label": "คุณภาพอากาศคืออะไร",
              "text": "คุณภาพอากาศคือ"
            }
          },
          {
            "type": "button",
            "style": "primary",
            "color": "#0B3B17",
            "action": {
              "type": "uri",
              "label": "pm2.5 คืออะไร",
              "uri": "https://www.riskcomthai.org/document/DPC6/PM2.5.jpg"
            }
          },
          {
            "type": "button",
            "style": "primary",
            "color": "#0B3B17",
            "action": {
              "type": "uri",
              "label": "เกณฑ์คุณภาพอากาศ",
              "uri": "https://modcumram.com/kpi.png"
            }
          },
          {
            "type": "button",
            "style": "primary",
            "color": "#0B3B17",
            "action": {
              "type": "message",
              "label": "การเลือกใช้หน้ากาก",
              "text": "หน้ากาก"
            }
          },
          {
            "type": "button",
            "style": "primary",
            "color": "#0B3B17",
            "action": {
              "type": "uri",
              "label": "ภาพรวมคุณภาพอากาศไทย",
              "uri": "http://air4thai.pcd.go.th/webV2/region.php?region=0"
            }
          },
          {
            "type": "button",
            "style": "primary",
            "color": "#0B3B17",
            "action": {
              "type": "message",
              "label": "pm10 คือ",
              "text": "pm10"
            }
          }
        ]
      }
    },
    {
      "type": "bubble",
      "styles": {
        "footer": {
          "backgroundColor": "#04B45F"
        }
      },
      "header": {
        "type": "box",
        "layout": "horizontal",
        "contents": [
          {
            "type": "box",
            "layout": "baseline",
            "contents": [
              {
                "type": "icon",
                "size": "xxl",
                "url": "https://ssl.gstatic.com/onebox/weather/64/partly_cloudy.png"
              }
            ]
          },
          {
            "type": "box",
            "layout": "vertical",
            "flex": 5,
            "contents": [
              {
                "type": "text",
                "text": "รวมข้อมูลคุณภาพอากาศ",
                "weight": "bold",
                "color": "#0B2161",
                "size": "md",
                "gravity": "top"
              }
            ]
          }
        ]
      },
      "footer": {
        "type": "box",
        "layout": "vertical",
        "spacing": "sm",
        "contents": [
          {
            "type": "button",
            "style": "primary",
            "color": "#0B3B17",
            "action": {
              "type": "uri",
              "label": "ข้อมูลอากาศย้อนหลัง",
              "uri": "http://air4thai.pcd.go.th/webV2/history/"
            }
          },
          {
            "type": "button",
            "style": "primary",
            "color": "#0B3B17",
            "action": {
              "type": "uri",
              "label": "สภาพอากาศรายจังหวัด",
              "uri": "https://www.tmd.go.th/forecast_map.php"
            }
          },
          {
            "type": "button",
            "style": "primary",
            "color": "#0B3B17",
            "action": {
              "type": "uri",
              "label": "พยากรณ์ฝนกรุงเทพ",
              "uri": "https://www.tmd.go.th/programs/uploads/satda/latest.jpg"
            }
          },
          {
            "type": "button",
            "style": "primary",
            "color": "#0B3B17",
            "action": {
              "type": "uri",
              "label": "เรดาห์ฝนทั่วประเทศ",
              "uri": "http://rain.tvis.in.th/rain_predict_android.php?lat=13.753364&lon=100.4954246"
            }
          },
          {
            "type": "button",
            "style": "primary",
            "color": "#0B3B17",
            "action": {
              "type": "message",
              "label": "รายงานแผ่นดินไหว",
              "text": "แผ่นดินไหว"
            }
          },
          {
            "type": "button",
            "style": "primary",
            "color": "#0B3B17",
            "action": {
              "type": "uri",
              "label": "คุณภาพอากาศกรุงเทพ",
              "uri": "line://app/1643084168-DvlNpo91"
            }
          }
        ]
      }
    }
  ]
}



----------------------

2----------   รายงานสภาพอากาศ

{
  "type": "bubble",
  "styles": {
    "footer": {
      "backgroundColor": "#42b3f4"
    }
  },
  "header": {
    "type": "box",
    "layout": "horizontal",
    "contents": [
      {
        "type": "box",
        "layout": "baseline",
        "contents": [
          {
            "type": "icon",
            "size": "xxl",
            "url": "https://modcumram.com/logo_sapa.png"
          }
        ]
      },
      {
        "type": "box",
        "layout": "vertical",
        "flex": 5,
        "contents": [
          {
            "type": "text",
            "text": "รายงานสภาพอากาศ",
            "weight": "bold",
            "color": "#aaaaaa",
            "size": "lg",
            "gravity": "top"
          },
          {
            "type": "text",
            "text": "คุณภาพอากาศ ค่าฝุ่นละออง",
            "weight": "bold",
            "color": "#aaaaaa",
            "size": "md",
            "gravity": "top"
          }
        ]
      }
    ]
  },
  "hero": {
    "type": "image",
    "url": "https://img.tsood.com/userfiles/image/3-1(10).jpg",
    "size": "full",
    "aspectRatio": "1:1",
    "aspectMode": "cover",
    "action": {
      "type": "uri",
      "uri": "https://www.tmd.go.th/programs/uploads/satda/latest.jpg"
    }
  },
  "body": {
    "type": "box",
    "layout": "vertical",
    "contents": [
      {
        "type": "text",
        "margin": "sm",
        "text": "สภาพอากาศ และปริมาณฝุ่นละออง",
        "weight": "bold",
        "size": "md",
        "wrap": true
      },
      {
        "type": "box",
        "layout": "vertical",
        "margin": "xs",
        "contents": [
          {
            "type": "box",
            "layout": "baseline",
            "spacing": "sm",
            "contents": [
              {
                "type": "text",
                "text": "ที่มาข้อมูล กรมอุตินิยมวิทยา และกรมควบคุมมลพิษ",
                "wrap": true,
                "color": "#666666",
                "size": "sm",
                "flex": 6
              }
            ]
          }
        ]
      }
    ]
  },
  "footer": {
    "type": "box",
    "layout": "vertical",
    "spacing": "sm",
    "contents": [
      {
        "type": "button",
        "style": "link",
        "color": "#FFFFFF",
        "height": "sm",
        "action": {
          "type": "uri",
          "label": "ภาพถ่ายเรดาร์ฝน (กรุงเทพ)",
          "uri": "https://www.tmd.go.th/programs/uploads/satda/latest.jpg"
        }
      },
      {
        "type": "button",
        "style": "link",
        "color": "#FFFFFF",
        "height": "sm",
        "action": {
          "type": "uri",
          "label": "เรดาห์ตรวจอากาศ (ทั่วประเทศ)",
          "uri": "http://rain.tvis.in.th/rain_predict_android.php?lat=13.753364&lon=100.4954246"
        }
      },
      {
        "type": "button",
        "style": "link",
        "color": "#FFFFFF",
        "height": "sm",
        "action": {
          "type": "uri",
          "label": "ปริมาณฝุ่นละออง (แชร์โลเคชั่น)",
          "uri": "line://nv/location"
        }
      }
    ]
  }
}



------------
3----------- ปฏิทินกิจกรรม

{
  "type": "bubble",
  "styles": {
    "footer": {
      "backgroundColor": "#CECEF6"
    }
  },
  "header": {
    "type": "box",
    "layout": "horizontal",
    "contents": [
      {
        "type": "box",
        "layout": "baseline",
        "contents": [
          {
            "type": "icon",
            "size": "xxl",
            "url": "https://modcumram.com/logo_sapa.png"
          }
        ]
      },
      {
        "type": "box",
        "layout": "vertical",
        "flex": 5,
        "contents": [
          {
            "type": "text",
            "text": "ข่าวประชาสัมพันธ์",
            "weight": "bold",
            "color": "#aaaaaa",
            "size": "md",
            "gravity": "top"
          }
        ]
      }
    ]
  },
  "hero": {
    "type": "image",
    "url": "https://modcumram.com/linebot/botdata/Ucdbdd1bc014225b287c2e0951e8ee02b//2019-01-16/2019-01-16-010101.jpg",
    "size": "full",
    "aspectRatio": "16:9",
    "aspectMode": "cover"
  },
  "footer": {
    "type": "box",
    "layout": "vertical",
    "spacing": "sm",
    "contents": [
      {
        "type": "button",
        "style": "primary",
        "color": "#B43104",
        "height": "sm",
        "action": {
          "type": "uri",
          "label": "ปฏิทินกิจกรรม",
          "uri": "line://app/1573243425-YpKv6d6Z"
        }
      },
      {
        "type": "button",
        "style": "primary",
        "color": "#088A08",
        "height": "sm",
        "action": {
          "type": "uri",
          "label": "ข่าวประชาสัมพันธ์",
          "uri": "line://app/1573243425-9r1zGQGw"
        }
      }
    ]
  }
}

-----

4---------  อวยพรวันเกิด

{
  "type": "bubble",
  "styles": {
    "footer": {
      "backgroundColor": "#42b3f4"
    }
  },
  "header": {
    "type": "box",
    "layout": "horizontal",
    "contents": [
      {
        "type": "box",
        "layout": "baseline",
        "contents": [
          {
            "type": "icon",
            "size": "xxl",
            "url": "https://modcumram.com/logo_sapa.png"
          }
        ]
      },
      {
        "type": "box",
        "layout": "vertical",
        "flex": 5,
        "contents": [
          {
            "type": "text",
            "text": "Happy Birthday",
            "weight": "bold",
            "color": "#aaaaaa",
            "size": "lg",
            "gravity": "top"
          },
          {
            "type": "text",
            "text": "ข้าราชการสำนักสารสนเทศ",
            "weight": "bold",
            "color": "#aaaaaa",
            "size": "md",
            "gravity": "top"
          }
        ]
      }
    ]
  },
  "hero": {
    "type": "image",
    "url": "https://modcumram.com/linebot/botdata/Ucdbdd1bc014225b287c2e0951e8ee02b//2019-03-26/2019-03-26-050319.jpg",
    "size": "full",
    "aspectRatio": "1:1",
    "aspectMode": "cover",
    "action": {
      "type": "uri",
      "uri": "https://www.youtube.com/watch?v=5gLp8T4Cev0"
    }
  },
  "body": {
    "type": "box",
    "layout": "vertical",
    "contents": [
      {
        "type": "text",
        "margin": "sm",
        "text": "คุณ Steve Job",
        "weight": "bold",
        "size": "md",
        "wrap": true
      },
      {
        "type": "box",
        "layout": "vertical",
        "margin": "xs",
        "contents": [
          {
            "type": "box",
            "layout": "baseline",
            "spacing": "sm",
            "contents": [
              {
                "type": "text",
                "text": "ขอให้มีความสุขมากๆ ด้วยความรักและห่วงใยจากพี่ๆน้องๆ สำนักสารสนเทศทุกคน",
                "wrap": true,
                "color": "#666666",
                "size": "sm",
                "flex": 6
              }
            ]
          }
        ]
      }
    ]
  },
  "footer": {
    "type": "box",
    "layout": "vertical",
    "spacing": "sm",
    "contents": [
      {
        "type": "button",
        "style": "link",
        "color": "#FFFFFF",
        "height": "sm",
        "action": {
          "type": "uri",
          "label": "ฟังเพลงวันเกิด",
          "uri": "https://www.youtube.com/watch?v=5gLp8T4Cev0"
        }
      }
    ]
  }
}


------------

ความคิดเห็น

โพสต์ยอดนิยมจากบล็อกนี้

แจ้งเตือนเข้าไลน์กลุ่ม ผ่าน Line notify เมื่อมีคน login เข้า server ของเราผ่าน SSH (linux) หรือ remote desktop เข้ามา (windows server)

การประยุกต์ใช้ line notify ในการแจ้งปัญหาการใช้งาน สำหรับ php

การทำ cloud iot ด้วย thingsboard ไว้ใช้เองครับ