Overview
The AgentVB Middleware WebSocket API provides a Generic Socket interface for client-side initiation of verification flows and receiving streaming server-side updates.
This API replaces the Socket.IO API, which is deprecated.
The WebSocket server automatically begins sending messages upon successful connection and authentication. You send a single CommandRequestMessage to initiate commands such as GET_VERIFICATION or GET_ECHO.
All messages pushed by the server follow a SimpleWsMessage<T> envelope structure:
{
"topic": "string",
"data": { ... }
}
Connection Details
To establish a connection, use the following WebSocket URL and parameters.
-
Protocol:
wss -
Environment:
wss://us1-m.ocp.ai -
Path:
/agent-vb-mw/ws/agent-vb
Connection Parameters
|
Parameter |
Type |
Required |
Description |
|
|
string |
Yes |
The session token for authorization. |
|
|
string (JWT) |
No |
A JWT token to validate the client's origin. |
Example URL: wss://us1-m.ocp.ai/agent-vb-mw/ws/agent-vb?token=<YOUR_TOKEN>
Operations
Client Commands
You send a JSON message to the server to trigger actions.
CommandRequest
Triggers a verification or echo command.
Payload Schema:
|
Field |
Type |
Required |
Description |
|
|
string |
Yes |
The command to execute. Allowed values: |
|
|
object |
No |
Key-value parameters for the command (e.g., |
Example:
{
"command": "GET_VERIFICATION",
"parameters": {
"users": "user1,user2"
}
}
Server Responses
The server sends the following messages to the client. Each message is wrapped in an envelope containing a topic and data.
Verification Response
Sent after a GET_VERIFICATION command is processed.
-
Topic:
verification -
Data Schema:
|
Field |
Type |
Description |
|
|
string |
The type of result (e.g., "NORMAL"). |
|
|
string |
The user ID verified. |
|
|
string |
The verification result (e.g., "TRUE_HIGH"). |
|
|
number |
The biometric score. |
|
|
number |
Log-likelihood ratio. |
|
|
integer |
Duration of speech in milliseconds. |
|
|
string |
Type of error, if any. |
Status Update
Provides updates on the call status.
-
Topic:
status -
Data Schema: String (Enum)
Allowed Values:
-
CALL_OPENED -
BIO_ACTIVE -
CALL_CLOSED -
ERR_CODE_01throughERR_CODE_06
TTS Detection
Indicates the result of Text-to-Speech detection.
-
Topic:
tts_detection -
Data Schema:
|
Field |
Type |
Description |
|
|
string |
Detection label (e.g., |
|
|
number |
Global posterior score. |
Blocklist Detection
Returns results from blocklist checks.
-
Topic:
blocklist_detection -
Data Schema:
|
Field |
Type |
Description |
|
|
string |
The detection label. |
|
|
string |
Status of the detection. |
|
|
string |
Identified risk level. |
|
|
integer |
ID of the identified fraudster. |
|
|
string |
ID of the blocklist matched. |
|
|
number |
Overall score. |
Enough Speech
Notifies when sufficient speech has been collected.
-
Topic:
enough_speech -
Data Schema:
|
Field |
Type |
Description |
|
|
boolean |
|
Voice Info
Provides analysis on the voice characteristics.
-
Topic:
voice_info -
Data Schema:
|
Field |
Type |
Description |
|
|
object |
Contains |
|
|
object |
Signal analysis results including |
ANI Validation Results
Provides results from ANI (Automatic Number Identification) validation.
-
Topic:
ani_validation_results -
Data Schema:
|
Field |
Type |
Description |
|
|
string |
The calling number being validated. |
|
|
integer |
Trust score or indicator for the ANI. |
Error Response
Sent when an invalid command is received or an error occurs.
-
Topic:
error -
Data Schema:
|
Field |
Type |
Required |
Description |
|
|
string |
Yes |
Description of the error. |
Debug Response
Echoes debug information when GET_ECHO is sent.
-
Topic:
debug -
Data Schema: String (Debug message content).