Hi,
I would like to set up a rest_command
to use Line Messaging API chat bot (LINE is a messaging app i use) as a notification platform.
According to LINE Messaging API documentation, the webhook should be as below :
curl -v -X POST https://api.line.me/v2/bot/message/push \
-H 'Content-Type:application/json' \
-H 'Authorization: Bearer {channel access token}' \
-d '{
"to": "U4af4980629...",
"messages":[
{
"type":"text",
"text":"Hello, world1"
},
{
"type":"text",
"text":"Hello, world2"
}
]
}'
I’ve created a rest_command in my configuration.yaml but i can’t get it work and always get an error 400. My access token and ID are correct as i can POST using Postman.
rest_command:
line_test:
url: 'https://api.line.me/v2/bot/message/push'
method: POST
headers:
Authorization: Bearer {xxxxxxx}
Content-Type: application/json
payload: '{"to": "lineidxxxx", "messages": [{"type": "text","text": "Hello, world1"}]}'
content_type: 'application/json; charset=utf-8'
Any idea what might be wrong in my formatting ?
Edit : sorry i find the solution = Hass reboot was needed …