API Integration for YourGPT Chatbot
๐ก
Connect Your Chatbot Anywhere with Chatbot API
Welcome to the Documentation page for YourGPT Chatbot APIs
Generating Keys
- Go to your
Integration
and click onmanage API integration
- Now create one key.
- Copy your
Generated API key
๐
The widget_uid is your chatbot's Widget ID. For example: a12bc345-d678-90ef-gh12-ijklmno345pq.
API Usage
success code : 200, type: RXSUCCESS
error code 400, type RXERROR
Create Session API
curl
Response
Response
{
"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"
}
}
๐
To use the send message API, you must first establish a session. Obtain a session UID by executing the Create Session API.
Send Message API
curl
Response
Response
{
"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
}
]
}
}