Create Session
Create a new chatbot session. You must create a session before sending messages. The session_uid returned from this endpoint is required for the Send Message API.
Create a new chatbot session. You must create a session before sending messages. The session_uid returned from this endpoint is required for the Send Message API.
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. Example: 84292q0qw1eqw124-4173-af6e-569477ac9013
Response Body
application/json
application/json
curl -X POST "https://api.yourgpt.ai/chatbot/v1/createSession" \ -H "Content-Type: application/x-www-form-urlencoded" \ -d 'widget_uid=string'{
"type": "RXSUCCESS",
"message": "Chatbot session created successfully",
"data": {
"id": 1910677,
"session_uid": "17226012685401506",
"chat_mode": "1",
"project_id": 197,
"integration_id": 17,
"state": "pending",
"segment": "chat",
"status": "open",
"device_type": null,
"platform": null,
"ip": null,
"country": "IN",
"visitor_id": null,
"is_emulator": false,
"data": {},
"contact_id": null,
"updatedAt": "2024-08-02T12:21:08.540Z",
"createdAt": "2024-08-02T12:21:08.540Z"
}
}{
"type": "RXERROR",
"message": "string"
}