Get Messages and Send Messages to bot using curl

Hello,
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 Kore.ai 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' \
  -H 'auth: YOUR_JWT_ACCESS_TOKEN' \
  -d '{
    "message": "{{user_message}}",
    "botId": "{{bot_id}}",
    "userId": "{{user_id}}" (optional)
  }'
  • {{host}} : Replace this with your Kore.ai environment URL (e.g., https://bots.kore.ai).
  • YOUR_JWT_ACCESS_TOKEN : Replace this with your JWT access token obtained from Kore.ai. You can generate one using their authentication methods.
    Refer to the Kore.ai documentation for details on JWT generation https://developer.kore.ai/tools/jwt/.
  • {{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 Kore.ai 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
Kore.ai 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

Pleasssee Answer To Meee

Hello Hossein,

Apologies for the delay in response.
The shared screenshot was not that helpful for to assist you on this.

Could you please let us know the procedure you are following for the connectivity between bot and PHP ?

Thank you,
Srujan Madderla
Kore.ai Community Team

i just write this code with php .this code curl request is not working