Socket Conversation Testing

Sigrid Nicole Ramos <sigrid@captivatechat.com>
Eduardo Villena <ebvjr@captivatechat.com>

  1. Client Action: Connect to WebSocket. Input your WebSocket URL, which should include the API key, then click "Open Socket Connection".

    Ensure your WebSocket URL includes your custom channel API key as a query parameter.
    For Production use wss://channel.wss.captivatechat.ai/dev?apiKey=API_KEY
    For Development use wss://channel-dev.wss.captivatechat.ai/dev?apiKey=API_KEY
                            
  2. If successful, expect to receive a socket_connected event.
  3. Client Action: Request a conversation_id using conversation_start event; userId is required for this.
    {
        "action": "sendMessage",
        "event": {
            "event_type": "conversation_start",
            "event_payload": {
                "userId": "super-unique-user-id",
                "userBasicInfo": {
                    "firstName": "John",
                    "lastName": "Doe",
                    "email": "john@sample.io"
                },
                "userData": {}
            }
        }
    }
                            
  4. If successful, expect to receive a conversation_start_success event that has the conversation_id in the payload.
  5. Client Action: Use the conversation_id to send a user_message.
    {
        "action": "sendMessage",
        "event": {
            "event_type": "user_message",
            "event_payload": {
                "type": "message_create",
                "client_msg_id": "unique-message-id",
                "conversation_id": "6f61b997-6e2c-471e-8481-27a584c5dcdc",
                "content": {
                    "text": "hello"
                }
            }
        }
    }
                            
  6. Expect to receive a bot reply.
  7. Client Action: Use the conversation_id to send metadata.
    {
        "action": "sendMessage",
        "event": {
            "event_type": "metadata",
            "event_payload": {
                "metadata": {
                    "sample_metadata": "oh yeah"
                },
                "client_msg_id": "unique-message-id",
                "conversation_id": "6f61b997-6e2c-471e-8481-27a584c5dcdc"
            }
        }
    }
                            
  8. For now, expect a bot reply, but this depends on the chatbot developer.
  9. Client Action: Use the conversation_id to send an action.
    {
        "action": "sendMessage",
        "event": {
            "event_type": "action",
            "event_payload": {
                "type": "normal",
                "id": "customAction",
                "data": {},
                "conversation_id": "6f61b997-6e2c-471e-8481-27a584c5dcdc"
            }
        }
    }
                            
  10. For now, expect a bot reply, but this depends on the chatbot developer.
  11. Client Action: Test conversation_transcript_request socket event.
    {
        "action": "sendMessage",
        "event": {
            "event_type": "conversation_transcript_request",
            "event_payload": {
                "conversation_id": "6f61b997-6e2c-471e-8481-27a584c5dcdc"
            }
        }
    }
                            

Choose an Action