3.3.2-Submit Uploaded File in Chatflow

1. Overview

  • Interface Name: Use the websocket call to start the dialog flow, call the file upload API, and perform the submission operation

  • Version number: v1.0.0

2. Information

  • Request method: POST

  • Request URL: wss://DOMAIN/openapi/v2/ws/dialog/

  • Domain: Refer to "Service address description"

3. Request parameters

Request body field:

Parameter name
Type
Required
Description

cybertron_robot_key

string

Yes

Robot key

cybertron_robot_token

string

Yes

Robot token

username

string

Yes

User account

question

string

Yes

If a user problem is identified, you can open the intent, for example: File Upload

segment_code

string

Yes

Session ID, a round conversation ID, generated by the client

message_source

string

Yes

Source: "WS"

question

string

Yes

If a user problem is identified, you can open the intent, for example: File Upload

segment_code

string

Yes

Session ID, a round conversation ID, generated by the client

message_source

string

Yes

Source: "WS"

type

string

Yes

type, upload as "upload"

upload_payload

object

Yes

Upload Request Parameter Information

upload_flag

int

Yes

Upload processing parameters, submit: 2

dialog_id

string

Yes

Session ID

4. Response field description

Response field description:

Field Name
Type
Description

code

string

"000000" is normal, other exceptions

message

string

Status description

data

object

message body

5. Example

Request packet:

{
    "cybertron_robot_key": "xxx",
    "cybertron_robot_token": "xxx",
    "username": "xxx",
    "question": "",
    "segment_code": "wWkE3bNkL3SzJX9orcO9P2",
    "message_source": "web",
    "type": "upload",
    "upload_payload": {
        "upload_flag": 2
    },
    "dialog_id":"1017340986451495206"
}

Response packet:

{
    "code": "000000",
    "message": "success",
    "dialog_id": 1017344061781661013,
    "type": "flow",
    "index": 0,
    "data": {
        "final": true,
        "id": null,
        "response_create_time": "2025-03-14 15:15",
        "response_create_time_timestamp": "1741936526964",
        "response_update_time": "2025-03-14 15:15",
        "response_update_time_timestamp": "1741936526964",
        "flow_uuid": "2fb61212-e93e-11ef-8b04-e4434b3011a0",
        "history": [
            {
                "timestamp": 1741936497412,
                "time_date": "20250314151457412422",
                "node_id": "start00000000000000000000",
                "robot_user_replying": "",
                "robot_user_asking": "",
                "user_robot_replying": "File upload"
            }
        ],
        "output": {
            "inputs": {},
            "variables": {},
            "entities": {},
            "robot_user_asking": "",
            "user_robot_replying": "File upload",
            "robot_user_replying": ""
        },
        "answer": "",
        "content_type": "text",
        "session_id": "08d3d9fc-00a4-11f0-a78b-4cb04a05ffbd",
        "flow_stage": "flow_running",
        "code": "002011",
        "node_stream": 0,
        "node_answer_finish": "y",
        "node_answer_index": 0,
        "file_upload": {
            "code": "000000",
            "message": "success",
            "data": {}
        },
        "target_node_id": "8710e1d3-0c95-4285-81b7-b043b4a771f6",
        "source_node_id": "8710e1d3-0c95-4285-81b7-b043b4a771f6",
        "cur_node_id": "8710e1d3-0c95-4285-81b7-b043b4a771f6",
        "parent_node_id": "8710e1d3-0c95-4285-81b7-b043b4a771f6"
    },
    "finish": "y",
    "cur_node_id": "8710e1d3-0c95-4285-81b7-b043b4a771f6",
    "node_id": "8710e1d3-0c95-4285-81b7-b043b4a771f6",
    "debug": 0,
    "node_developer": 0,
    "flow_name": "File upload",
    "node_type": "file_upload",
    "node_title": null,
    "node_waiting": false,
    "flow_jump": 0,
    "file_upload": {
        "code": "000000",
        "message": "success",
        "data": {}
    },
    "parent_node_id": "8710e1d3-0c95-4285-81b7-b043b4a771f6",
    "node_waiting_input": 0,
    "node_waiting_jump": 0
}