Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- rest_command:
- linebot_flex_info: #改成你要的名字,呼叫就是rest_command.linebot_flex_info
- url: 'https://api.line.me/v2/bot/message/reply' #reply要有reply token,主動發就改push
- method: POST
- content_type: 'application/json'
- headers:
- Authorization: !secret linebot_token_rest #就是"Bearer xxxx"
- #記得下面任何地方都不能在後面加註解!!
- #架構分解:
- #payload: '{
- # "replyToken": "{{ reply_token }}", #要主動發把這行改為 "to": "group_id or user_id",
- # "messages":[
- # {
- # "type": "flex",
- # "altText": "Flex message",
- # "contents":
- # JSON貼這
- #
- # } //messages結尾
- # ] //messages結尾
- # }'//payload結尾
- payload: '{
- "replyToken": "{{ reply_token }}",
- "messages":
- [
- {
- "type": "flex",
- "altText": "Flex message",
- "contents":
- {
- "type": "bubble",
- "hero": {
- "type": "image",
- "url": "https://developers-resource.landpress.line.me/fx/img/01_1_cafe.png",
- "size": "full",
- "aspectRatio": "20:13",
- "aspectMode": "cover",
- "action": {
- "type": "uri",
- "uri": "https://line.me/"
- }
- },
- "body": {
- "type": "box",
- "layout": "vertical",
- "contents": [
- {
- "type": "text",
- "text": "地震通知",
- "weight": "bold",
- "size": "xl"
- },
- {
- "type": "box",
- "layout": "vertical",
- "margin": "lg",
- "spacing": "sm",
- "contents": [
- {
- "type": "box",
- "layout": "baseline",
- "spacing": "sm",
- "contents": [
- {
- "type": "text",
- "text": "A級地震將在A秒後抵達",
- "wrap": true,
- "color": "#666666",
- "size": "sm",
- "flex": 5
- }
- ]
- }
- ]
- }
- ]
- }
- }
- }
- ]
- }'
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement