The WebSocket API documentation test environment ignores "ServiceId"

I'm testing against an ADS that has multiple services available to request for market data using the WebSocket API. Logging in, requesting for data, etc, the API defines you can specify the "ServiceId". While I am able to do this programmatically, this capability doesn't seem to work when using the testing interfaces within the Developer Guide. For example, if I were to request for market data such as:

{
"Id": 2,
"ServiceId": 289,
"Key": {
"Name": "TRI.N"
}
}

I can see my request apparently being sent within the Result window, however, when I get a response back, it is stating a different serviceId, the default one.

RECEIVED:
[
{
"Id": 2,
"Type": "Refresh",
"Key": {
"ServiceId": 257,
"Name": "TRI.N"
},
...

]

Best Answer

  • jim.carroll
    Answer ✓

    @nick.zincone.1

    The ServiceId should be in the Key of the request, e.g. try sending this:

    {
    "Id": 2,
    "Key": {
    "Name": "TRI.N",
    "ServiceId",298
    }
    }

Answers

  • Thanks Jim. Yes, I can see where I made my mistake - docs clearly show this field as part of the "Key" stanza.

  • Just a minor typo above; should be

    "ServiceId":298

    Took me a few moments before I realised why the request was not being sent....The joys of cut and paste!