Skip to content

400 Bad Request when sending a text #1247

@pedroSoaresll

Description

@pedroSoaresll

Welcome!

  • Yes, I have searched for similar issues on GitHub and found none.

What did you do?

I request it to send a text to my number to test the functionality.

# URL
{{baseUrl}}/message/sendText/{{instance}}
# Body Request

{
    "number": "{{remoteJid}}",
    "text": "hey hey hou"
    // options
    // "delay": 1200,
    // "quoted": {
    //     // payload message or key.id only for get message in database
    //     "key": {
    //         "id": " MESSAGE_ID"
    //     },
    //     "message": {
    //         "conversation": "CONTENT_MESSAGE"
    //     }
    // },
    // "linkPreview": true
    // "mentionsEveryOne": false,
    // "mentioned": [
    //     "{{remoteJid}}"
    // ]
}

What did you expect?

The text was successfully sent, but the response is always a 400 Bad Request followed by this error:

{
    "status": 400,
    "error": "Bad Request",
    "response": {
        "message": [
            "PrismaClientKnownRequestError: \nInvalid `this.prismaRepository.message.create()` invocation in\n/evolution/dist/src/api/services/channels/whatsapp.baileys.service.js:1545:57\n\n  1542     }\n  1543 }\n  1544 if (this.configService.get('DATABASE').SAVE_DATA.NEW_MESSAGE)\n→ 1545     yield this.prismaRepository.message.create(\nThe column `Message.typebotSessionId` does not exist in the current database."
        ]
    }
}

What did you observe instead of what you expected?

I did navigate in the Prisma schemas trying to find the field the error is pointing: typebotSessionId, specially the type Message schema, but no schema make usage of that, so why is this trying to access this field?

Screenshots/Videos

Image

Which version of the API are you using?

I am using the docker image at the version v2.2.3, but the same thing occurs at the version v2.1.1 which is recommended in the documentation.

What is your environment?

Linux

Other environment specifications

I am using Evolution API inside a docker container published in an AWS ECS using Fargate.

If applicable, paste the log output

I extracted exactly the logs after executing the send text API here:

log-events-viewer-result.csv

Additional Notes

I guess it is not a critical bug because it is working, but it makes us apply extra code validation to start considering 400 HTTP status code as a request that succeeds 😆

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions