Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

linebot: APIError 400 The property, 'to', in the request body is invalid (line: -, column: -) #41

Closed
windgo1019 opened this issue Dec 19, 2016 · 6 comments

Comments

@windgo1019
Copy link

I usw win10 and download drone-line-v1.4.0-windows-386.exe
When I get a secret and token
I use this command to start webhook
drone-line-v1.4.0-windows-386.exe --secret secret_key --token token_key webhook
then i use this command to send message

drone-line-v1.4.0-windows-386.exe --secret secret_key --token token_key --to windgo --message "test"
or
drone-line-v1.4.0-windows-386.exe --secret secret_key --token token_key --to @nle4159v --message "test"

then i got a error mesage
"2016/12/19 11:21:57 linebot: APIError 400 The property, 'to', in the request body is invalid (line: -, column: -)"

could you give me a suggest?

@appleboy
Copy link
Owner

appleboy commented Dec 19, 2016

Your user ID is the wrong format. Please follows the following steps:

  1. Setup webhook service.
drone-line-v1.4.0-windows-386.exe --secret secret_key --token token_key webhook
  1. Add bot account to your friend list.

  2. Send message to bot account

You can see the following screen shots to show your personal ID

screen shot 2016-12-19 at 1 40 12 pm

Please Note User ID format.

  1. Send message:
drone-line-v1.4.0-windows-386.exe --secret secret_key --token token_key --to U772346xxxxxxxx --message "test"

screen shot 2016-12-19 at 1 45 37 pm

@appleboy
Copy link
Owner

@windgo1019 resolve your problem?

@windgo1019
Copy link
Author

Thank for your reply!

I find the different point
I run the drone-line-v1.4.0-windows-386.exe then the program just stop in
"Line Webhook Server Listin on 8088 port"
image_20161227_013

so I cant get the User ID to go next step
I try it in 2 PC ,drone-line-v1.4.0-windows-amd64.exe and drone-line-v1.4.0-windows-386.exe ,but i get the same result

below is my run command:
drone-line-v1.4.0-windows-amd64.exe --secret e27bfd26c58c279b24eebea7f23b69b3 --token HkCs4ouXy5x1FPxU5DrbMpLPH5Uz9rV6Ek9D8aHDLktos3SKr//V4pgi+H7ijV1MfBqLdIbhsJBwbQgtogr4aZRWyjv8tBjLi8SRTELG+2NmMu4ZVGOZLOE/3LRXUtolkZSE4kfRojR0XscLybJckAdB04t89/1O/w1cDnyilFU= webhook

@appleboy
Copy link
Owner

You are missing some steps. Please get User ID first.

After running webhook service. You need to run ngrok command as following:

$ ngrok http 8088

Then you will get ngrok URL and put it into Webhook URL field on Line developer admin console.

ref: https://blog.wu-boy.com/2016/11/send-line-notification-using-docker-written-in-golang/

@windgo1019
Copy link
Author

Thank you!
I already message LineBot!

@appleboy
Copy link
Owner

Please close this issue if above solution is working for you.

@appleboy appleboy closed this as completed Jan 4, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants