For a deeper look into our Elektron API, look into:

Overview |  Quickstart |  Documentation |  Downloads |  Tutorials |  Articles

question

Upvotes
Accepted
3 1 1 4

Getting MArketdate from Websocket

Hi,

I can connect websocket Reuters server by javascript code. After connection I can log in the system successfully. Now I want to send a market data request, but i am not sure about the correct request. For rfa.net my configuration is:

Default\appId : 256
Default\position : 10.66.29.115/net
Default\runTimeInSeconds : 0
Default\userName : rdc01
Default\service : IDN_RDF
Default\session : Session1
Default\itemName : TRI.N
Default\itemList : TRY14=;TRY17=

and i can get the market data.

What should be the correct sentence for getting the same data via websocket API? Can anybody write a json request for it?

Thanks.

treprdp-apiwebsocketsrrto
icon clock
10 |1500

Up to 2 attachments (including images) can be used with a maximum of 5.0 MiB each and 10.0 MiB total.

Upvotes
Accepted
11.5k 16 7 10

Hi @sabri demirel

The market price request JSON message is following:

{
  "ID":<int>,
  "Domain" : "MarketPrice"
  "Key":{
    "Name":"TRI.N"
    "Service": "ELEKTRON_DD"
  }
}

Please note that

  • If the JSON message does not contain "Domain" attribute, it will be defaulted to "MarketPrice"
  • The "Service" attribute is an optional parameter. If absent, the ADS will use the service that defined in ADS's *ads*defaultJsonServiceId configuration.

You can find all Elektron WebSocket JSON message structures document in the WebSocket document.

You can also the Try It Now! interactive document that contains Elektron WebSocket API documentation, message specification and an interactive playground which you can connect and consume data from an ADS 3.2 WebSocket connection via a browser-based step by step guide. You can download Try It Now!! interactive guide document from the API download page.

Additionally, you can check out the following resources:

icon clock
10 |1500

Up to 2 attachments (including images) can be used with a maximum of 5.0 MiB each and 10.0 MiB total.

Upvotes
3 1 1 4

Hi @Wasin Waeosri,

Thanks for your quick reply. I send

{
"ID":256,
"Key":{
"Name":"TRI.N"
"Service": "IDN_RDF"
}
}

for request and the response was

{
"ID": 256,
"Type": "Status",
"Key": {
"Service": "IDN_RDF",
"Name": "TRI.N"
},
"State": {
"Stream": "Closed",
"Data": "Suspect",
"Code": "NotEntitled",
"Text": "*Record not service permissioned"
}
}

Additionally how can I send the

itemList : TRY14=;TRY17=

in json.

icon clock
10 |1500

Up to 2 attachments (including images) can be used with a maximum of 5.0 MiB each and 10.0 MiB total.

For testing purpose, pleaes change TRI.N to TRY14= or TRY17= and test again. It looks like you don't have permission to request TRI.N.

Please note that itemList parameter is just Application' configuration. It's not RFA.NET configuration. Our RFA.NET example just get item name from the list and send it one by one.

Upvotes
3 1 1 4

Hi, I changed the Name to TRY14= . New response is

{
"ID": 256,
"Type": "Status",
"Key": {
"Service": "IDN_RDF",
"Name": "TRY14="
},
"State": {
"Stream": "Closed",
"Data": "Suspect",
"Code": "NotEntitled",
"Text": "A21: DACS User Profile denied access to vendor\n"
}
}

It semms a permission problem. I will contact to our account admin. Thanks for your great support.

icon clock
10 |1500

Up to 2 attachments (including images) can be used with a maximum of 5.0 MiB each and 10.0 MiB total.

Upvotes
11.5k 16 7 10

Hi @sabri demirel

  • Did you send the login request message with the same user as the RFA API?
  • Did you connect to the same ADS server as your RFA API application?

To let us verify the issue, could you please give us all JSON messages that you send and receive from ADS?

Regarding the JSON Batch item request message, you can use "Name" as an array as following

{
  "ID":<int>,
  "Domain" : "MarketPrice"
  "Key":{
    "Name":["TRI.N","FB.O"]
    "Service": "ELEKTRON_DD"
  }
}

You can find more detail in the Advance section of the Elektron WebSocket API document.


capture.png (24.5 KiB)
icon clock
10 |1500

Up to 2 attachments (including images) can be used with a maximum of 5.0 MiB each and 10.0 MiB total.

Upvotes
3 1 1 4

Hi,

-Did you send the login request message with the same user as the RFA API?

Yes. I send the login message.

  • Did you connect to the same ADS server as your RFA API application?
  • Yes, I can connect same server from my RFA application.

    I attached all the requests an responses:

    SENT:
    {
    "ID": 1,
    "Domain": "Login",
    "Key": {
    "Name": "rdc01",
    "Elements": {
    "ApplicationId": "256",
    "Position": "127.0.0.1"
    }
    }
    }
    RECEIVED:
    [
    {
    "ID": 1,
    "Type": "Refresh",
    "Domain": "Login",
    "Key": {
    "Name": "rdc01",
    "Elements": {
    "AllowSuspectData": 1,
    "ApplicationId": "256",
    "ApplicationName": "ADS",
    "Position": "127.0.0.1",
    "ProvidePermissionExpressions": 1,
    "ProvidePermissionProfile": 0,
    "SingleOpen": 1,
    "SupportEnhancedSymbolList": 1,
    "SupportOMMPost": 1,
    "SupportPauseResume": 0,
    "SupportStandby": 0,
    "SupportBatchRequests": 7,
    "SupportViewRequests": 0,
    "SupportOptimizedPauseResume": 0
    }
    },
    "State": {
    "Stream": "Open",
    "Data": "Ok",
    "Text": "Login accepted by host KLREUMLP01."
    },
    "Elements": {
    "PingTimeout": 30,
    "MaxMsgSize": 61430
    }
    }
    ]
    RECEIVED:
    [
    {
    "Type": "Ping"
    }
    ]
    SENT:
    {
    "Type": "Pong"
    }
    RECEIVED:
    [
    {
    "Type": "Ping"
    }
    ]
    SENT:
    {
    "Type": "Pong"
    }
    RECEIVED:
    [
    {
    "Type": "Ping"
    }
    ]
    SENT:
    {
    "Type": "Pong"
    }
    SENT:
    {
    "ID": 2,
    "Key": {
    "Name": [
    "TRY14=",
    "TRY17="
    ]
    }
    }
    RECEIVED:
    [
    {
    "ID": 3,
    "Type": "Status",
    "Key": {
    "Service": 356,
    "Name": "TRY14="
    },
    "State": {
    "Stream": "Closed",
    "Data": "Suspect",
    "Code": "SourceUnknown",
    "Text": "A18: Unknown service."
    }
    },
    {
    "ID": 4,
    "Type": "Status",
    "Key": {
    "Service": 356,
    "Name": "TRY17="
    },
    "State": {
    "Stream": "Closed",
    "Data": "Suspect",
    "Code": "SourceUnknown",
    "Text": "A18: Unknown service."
    }
    },
    {
    "ID": 2,
    "Type": "Status",
    "State": {
    "Stream": "Closed",
    "Data": "Ok",
    "Text": "Processed 2 total items from Batch Request. 2 Ok."
    }
    }
    ]
    RECEIVED:
    [
    {
    "Type": "Ping"
    }
    ]
    SENT:
    {
    "Type": "Pong"
    }
    RECEIVED:
    [
    {
    "Type": "Ping"
    }
    ]
    SENT:
    {
    "Type": "Pong"
    }
    RECEIVED:
    [
    {
    "Type": "Ping"
    }
    ]
    SENT:
    {
    "Type": "Pong"
    }
    RECEIVED:
    [
    {
    "Type": "Ping"
    }
    ]
    SENT:
    {
    "Type": "Pong"
    }
    RECEIVED:
    [
    {
    "Type": "Ping"
    }
    ]
    SENT:
    {
    "Type": "Pong"
    }
    RECEIVED:
    [
    {
    "Type": "Ping"
    }
    ]
    SENT:
    {
    "Type": "Pong"
    }
    RECEIVED:
    [
    {
    "Type": "Ping"
    }
    ]
    SENT:
    {
    "Type": "Pong"
    }
    RECEIVED:
    [
    {
    "Type": "Ping"
    }
    ]
    SENT:
    {
    "Type": "Pong"
    }
    RECEIVED:
    [
    {
    "Type": "Ping"
    }
    ]
    SENT:
    {
    "Type": "Pong"
    }
    RECEIVED:
    [
    {
    "Type": "Ping"
    }
    ]
    SENT:
    {
    "Type": "Pong"
    }
    RECEIVED:
    [
    {
    "Type": "Ping"
    }
    ]
    SENT:
    {
    "Type": "Pong"
    }

icon clock
10 |1500

Up to 2 attachments (including images) can be used with a maximum of 5.0 MiB each and 10.0 MiB total.

Upvotes
11.5k 16 7 10

Hi @sabri demirel

I found that your Batch request message does not contain the Service attribute, so the ADS will use the Service that specified in ADS *ads*defaultJsonServiceId configurations parameter instead.

The Status "Text": "A18: Unknown service." means the the Service ID value in ads*defaultJsonServiceId configuration is not the correct Service ID. I can replicate the same message by setting my ads*defaultJsonServiceId configuration to be the wrong Service ID.

I suggest you check if ads*defaultJsonServiceId parameter is configured to the correct Service ID or not.

Additionally, the "Record not service permissioned" and "A21: DACS User Profile denied access to vendor\n" messages means your user does not have a permission to subscribe that RICs. I suggest you contact your account administrator.

icon clock
10 |1500

Up to 2 attachments (including images) can be used with a maximum of 5.0 MiB each and 10.0 MiB total.

Upvotes
1 1 1 3

Hi @Wasin Waeosri,

We're teammates with Sabri.

In your last post you've said;

"I suggest you check if ads*defaultJsonServiceId parameter is configured to the correct Service ID or not."

Actually we don't have a service Id parameter and we couldn't find where the service ID is configured in the sample project. All the examples are just like above and there is no service ID parameter.

{
"ID": 2,
"Key": {
"Name": [
"TRY14=",
"TRY17="
]
}

Do we need to contact someone to get a service ID parameter? How we'll get this information?

Thank you.

icon clock
10 |1500

Up to 2 attachments (including images) can be used with a maximum of 5.0 MiB each and 10.0 MiB total.

Click below to post an Idea Post Idea