๐Ÿค– Chatbot
๐Ÿ”Œ Integrations
API Integration

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 on manage API integration
  • Now create one key.
 API Integration
  • Copy your Generated API key
 Copy 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
            }
        ]
    }
}