Q&A

LINE push message API 400 bad request

Im using the message api to send a push message.i provided the required headers and data to send, but whenever i sent the message i get a 400 bad request as response. Please help my project depend on this API.

{
    "err": {
        "statusCode": 400,
        "statusMessage": "Bad Request",
        "originalError": {
            "message": "Request failed with status code 400",
            "name": "Error",
            "stack": "Error: Request failed with status code 400\n    at createError (C:\\Users\\RENJITH\\Desktop\\line\\node_modules\\axios\\lib\\core\\createError.js:16:15)\n    at settle (C:\\Users\\RENJITH\\Desktop\\line\\node_modules\\axios\\lib\\core\\settle.js:17:12)\n    at IncomingMessage.handleStreamEnd (C:\\Users\\RENJITH\\Desktop\\line\\node_modules\\axios\\lib\\adapters\\http.js:269:11)\n    at IncomingMessage.emit (events.js:412:35)\n    at endReadableNT (internal/streams/readable.js:1333:12)\n    at processTicksAndRejections (internal/process/task_queues.js:82:21)",
            "config": {
                "url": "https://api.line.me/v2/bot/message/push",
                "method": "post",
                "data": "{\"messages\":[{\"type\":\"text\",\"text\":\"Hello World!\"}],\"to\":\"Ue703d110fb7d9359819354c42a9d32a6\",\"notificationDisabled\":false}",
                "headers": {
                    "Accept": "application/json, text/plain, */*",
                    "Content-Type": "application/json",
                    "Authorization": "Bearer 0HNmzK/nlxWt1cQSx/z8xeRgdB04t89/1O/w1cDnyilFU=",
                    "User-Agent": "@line/bot-sdk/7.5.0",
                    "Content-Length": 122
                },
                "transformRequest": [
                    null
                ],
                "transformResponse": [
                    null
                ],
                "timeout": 0,
                "xsrfCookieName": "XSRF-TOKEN",
                "xsrfHeaderName": "X-XSRF-TOKEN",
                "maxContentLength": -1,
                "maxBodyLength": -1,
                "transitional": {
                    "silentJSONParsing": true,
                    "forcedJSONParsing": true,
                    "clarifyTimeoutError": false
                }
            }
        }
    }
}
  • 0
  • 1
  • 313
  • twitter facebook

Please explain your received error messages. No one can understand your situation via your unclear description.

  • 0
Are you sure? question.vm