0

I try to create app to send message to line user by using Line Message API but always return bad request.

this curl i use to run on postman

curl -X POST \
-H 'Content-Type:application/json' \
-H 'Authorization: Bearer <channel access token>' \
-d '{
 "to": "Ucf633f17c6198XXXXXXXXXXXXXXXXX",
 "messages":[
      {
           "type":"text",
           "text":"Hello, user"
      }
  ]
}' https://api.line.me/v2/bot/message/push

Who have the same problem ? Please share.

user3001046
  • 235
  • 1
  • 10
  • 28

1 Answers1

0

I had 'bad request' returning all day long, tried changing other values, where the LINE Api gave me detailed feedback on what went wrong. But it doesn't tell you that the user ID is not the one valid for your dev account. So Please confirm that the userID (which you put into "to":"UserID") is the one that you find as "Your user ID" in your LINE developer account, under provider/basic settings for this specific messaging bot that you are creating. It is different from the user ID that LINE assigns your phone client application, even though you are probably running the dev account with the phone user ID.