-
Notifications
You must be signed in to change notification settings - Fork 244
Description
System Information
- OS: Windows 11
- Go Version [e.g. 1.24.3] 1.25.1
- line-bot-sdk-go version(s) [e.g. 8.13.1] 8.18.0? (github main branch as of 1/13/2026)
Expected Behavior
Display the Brown Cafe flex message.
Current Behavior
Server error:
unexpected status code: 400, {"message":"A message (messages[0]) in the request body is invalid","details":[{"message":"invalid property","property":"/footer/contents/2"}]}
Steps to Reproduce
- git clone https://github.com/line/line-bot-sdk-go.git
- cd line-bot-sdk-go\examples\kitchensink
- go run server.go (after setting the env variables)
- send
flex jsonmessage inside LINE App chat (with the bot)
Logs
2026/01/13 13:15:26 unexpected status code: 400, {"message":"A message (messages[0]) in the request body is invalid","details":[{"message":"invalid property","property":"/footer/contents/2"}]}
Additional Context (Optional)
I copied and pasted the json content into the FLEX MESSAGE SIMULATOR and it appears to be valid. UnmarshalFlexContainer call:
| contents, err := messaging_api.UnmarshalFlexContainer([]byte(jsonString)) |
also completed without error. The error is returned from the following:
line-bot-sdk-go/examples/kitchensink/server.go
Lines 847 to 859 in 63e224e
| if _, err := app.bot.ReplyMessage( | |
| &messaging_api.ReplyMessageRequest{ | |
| ReplyToken: replyToken, | |
| Messages: []messaging_api.MessageInterface{ | |
| &messaging_api.FlexMessage{ | |
| AltText: "Flex message alt text", | |
| Contents: contents, | |
| }, | |
| }, | |
| }, | |
| ); err != nil { | |
| return err | |
| } |
The error message seems to suggest there is an invalid property in /footer/contents/2 which appears to be a spacer according to the JSON string. If the spacer, ie:
line-bot-sdk-go/examples/kitchensink/server.go
Lines 835 to 838 in 63e224e
| { | |
| "type": "spacer", | |
| "size": "sm" | |
| } |