Skip to content
API Integration for YourGPT Chatbot | Installation Guide

Welcome to the Documentation page for YourGPT Chatbot APIs

Generating Keys

  • Go to your Integration and click on manage API integration
 API Integration
  • Now create one key.

  • Copy your Generated API key

 Copy API Key

How to Create Session

Guide to Creating Sessions

Learn more

Send a Message via API

API to send messages seamlessly

Learn more

API Usage

  • success code : 200, type: RXSUCCESS
  • error code 400, type RXERROR

Create Session API

curl --location 'https://api.yourgpt.ai/chatbot/v1/createSession' \
--header 'Content-Type: application/x-www-form-urlencoded' \
--header 'api-key: pks-3e0a221e3dqweqwef0ecd123qe33a728e1dfa2a0ee01cc4ff8b8c99c21a45cff9' \
--data-urlencode 'widget_uid=84292q0qw1eqw124-4173-af6e-569477ac9013'
Response
response.json
{
"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"
}
}

Send Message API

curl --location 'https://api.yourgpt.ai/chatbot/v1/sendMessage' --header 'Content-Type: application/x-www-form-urlencoded' --header 'api-key: pks-3e0a221e3dqweqwef0ecd123qe33a728e1dfa2a0ee01cc4ff8b8c99c21a45cff9' --data-urlencode 'widget_uid=84292q0qw1eqw124-4173-af6e-569477ac9013' --data-urlencode 'session_uid=3977b1x2d-d1e1-0d5a-a473-a6841bc4c880' --data-urlencode 'message=hey there?'
Response
response.json
{
"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
}
]
}
}