Hello team,
I am currently integrating the Upstox Market Data WebSocket API using C++, where WebSocket subscribe and unsubscribe requests are being generated and transmitted in binary format using Protobuf encoding, as per the API specifications.
To ensure correct and standards-compliant message construction, I seek clarification regarding the exact Protobuf definition of the method field used in the WebSocket subscription request. In particular, I would appreciate guidance on the following points:
-
Whether the method field (for example, sub and unsub) is implemented as a Protobuf enum or a string
-
The official enum values or message structure associated with this field
-
The authorized Protobuf schema required to correctly encode this field when generating requests from a C++ application
Access to the official Protobuf schema or enum definition would help ensure that the messages generated by my application strictly conform to the WebSocket server’s expected format and avoid any potential interoperability issues.
Thank you for your time and assistance. I look forward to your response.
Yours sincerely,
Krish
@Dhamsaniya_52172708 I hope you’ve already reviewed the Market data feed documentation. Please refer to the .proto file mentioned in the documentation for the correct schema.
You can generate the C++ Protobuf classes using the following command:
protoc --cpp_out=. MarketDataFeed.proto
If you face any issues while doing this, please let us know—I’ll be happy to help.
Thanks
No, I want the enum class definition for the method field that is used while subscribing to a WebSocket connection.
In the following request payload:
{
“guid”: “13syxu852ztodyqncwt0”,
“method”: “sub”,
“data”: {
“mode”: “full”,
“instrumentKeys”: [“NSE_INDEX|Nifty Bank”]
}
}
I would like to know which enum class corresponds to the method field (for example, subscribe/unsubscribe).
for example something like:
enum Method {
SUBSCRIBE = 0;
UNSUBSCRIBE = 1;
}
I hope now it is clear, or i should explain more.
Hello Team , Any Progress @Anand_Sajankar ?
Hi @Dhamsaniya_52172708 The documentation mentions that the method parameter supports below three values; however, there is no corresponding enum defined in the proto file. Since it is a string field, passing an incorrect value will result in no feed being received.
I hope this answers your question. Thanks.