Get Messages and Send Messages to bot using curl

I have written a code using PHP that connects to the bot. Now I want the user to send a message to the bot using the curl.
Please give me the curl code.

Please Answer To my question i need send with curl

Hello Hossein,

Thank you for reaching out to Community.
Please try the below curl and do let us know if that works for you.

curl -X POST \
  'https://{{host}}/api/v1.1/rest/message/send' \
  -H 'Content-Type: application/json' \
  -d '{
    "message": "{{user_message}}",
    "botId": "{{bot_id}}",
    "userId": "{{user_id}}" (optional)
  • {{host}} : Replace this with your environment URL (e.g.,
  • YOUR_JWT_ACCESS_TOKEN : Replace this with your JWT access token obtained from You can generate one using their authentication methods.
    Refer to the documentation for details on JWT generation
  • {{user_message}} : Replace this with the actual message the user wants to send to the bot.
  • {{bot_id}} : Replace this with the ID of the specific bot you want to interact with. You can find this ID in the bot settings.
  • {{user_id}} (optional): This is an optional parameter for specifying the user ID. If you have a unique user identifier, include it here. Otherwise, omit it.

Thank you,
Srujan Madderla Community Team

thanks,but i gave this error : HTTP Code: 405
Response: {“errors”:[{“msg”:“Method Not Allowed”,“code”:405}]}

please answer to my question

Please Answer to my message i need this

Hello Hossein,

Could you please share the relevant screenshots ?
we will check and update you.

Thank you,
Srujan Madderla

Please Answer this question