Send Message
Send a message to your chatbot and receive an AI response. You must first create a session using the Create Session API to obtain a session_uid.
Send a message to your chatbot and receive an AI response. You must first create a session using the Create Session API to obtain a session_uid.
Authorization
apiKey
api-key<token>
API key for authentication. Generate your API key from the Integration settings in your YourGPT dashboard.
In: header
Request Body
application/x-www-form-urlencoded
widget_uid*string
Your chatbot's Widget ID
session_uid*string
Session UID obtained from Create Session API
message*string
The message to send to the chatbot
Response Body
application/json
application/json
curl -X POST "https://api.yourgpt.ai/chatbot/v1/sendMessage" \ -H "Content-Type: application/x-www-form-urlencoded" \ -d 'widget_uid=string&session_uid=string&message=string'{
"type": "RXSUCCESS",
"message": "AI reply",
"data": {
"send_by": "assistant",
"origin": "api",
"session_uid": "39772b8d-d1c8-4d5a-a473-a6841bc4c880",
"type": "text",
"message_id": 241043,
"message": "Hello! How can I assist you today?",
"content_type": "picker",
"id": 241043,
"choices": [
{
"icon": "👍",
"text": "I am satisfied",
"value": "like",
"enabled": true
},
{
"icon": "👎",
"text": "I am not satisfied",
"value": "dislike",
"enabled": true
},
{
"icon": "🦸",
"text": "Request a human operator",
"value": "requesthumanoperator",
"enabled": true
}
]
}
}{
"type": "RXERROR",
"message": "string"
}