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

Overview |  Quickstart |  Documentation |  Downloads |  Tutorials |  Articles

question

Upvotes
Accepted
68 0 2 6

RtContribute => WebSocket API mapping

Hi,

We are migrating our IDN pages contribution from Excel RtContribute() to your WebSocket API.

Our excel formulas look like:

=RtContribute("TRC", "PAGENAME", 317, 123.456789, "SCOPE:SERVER POS:7 FORMAT:6:4")

This will contribute the value '123.456789' to the page 'PAGENAME' at the row 3 (FID: 317 = ROW80_3) and at the position '7' with format '6:4'.

We want to translate this formula to a WebSocket API message. It would roughly look like this:

{
  
  "Ack": true,
  "ID": 1,
  "Key": {
    "Name": "PAGENAME",
    "Service": "DDS_TRCE"
  },
  "Message": {
    "Fields": {
    "ROW80_3": 123.456789,
    },
    "ID": 0,
    "Type": "Update"
  },
  "PostID": 1,
  "Type": "Post"
}

However we have 2 questions:

  1. How to translate 'POS:7' into the above message?
  2. Is there a way to translate 'FORMAT:6:4' or shall we simply make sure the value in the message has the format we want?

Thank you

#technologywebsocketsrt-contribute
icon clock
10 |1500

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

Upvotes
Accepted
68 0 2 6

Many thanks for the pointer.

It seems partial page updates are supported via websocket API using RMTES encoding https://developers.refinitiv.com/en/article-catalog/article/encoding-and-decoding-non-ascii-text-using-ema-and-rfa-cnet

The syntax of an intra-field positioning sequence is as follows:

<CSI>n<HPA>YourText

Where

  • <CSI> is the Control Sequence Introducer (Hex 1B 5B which is as an ASCII "[")
  • n is an ASCII numeric string representing the cursor offset position relative to the start of the field.
  • <HPA> is the Horizontal Position Adjust character which terminates the intra-field position sequence (Hex 60 which is an ASCII " ` ")

I will give it a try.

icon clock
10 |1500

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

Confirmed working fine. The below json will contribute abc at row 6 column 5 of page MYPAGE

{
    "Ack": true,
    "Key": {
        "Name": "MYPAGE",
        "Service": "DDS_TRCE"
    },
    "Type": "Post",
    "Message": {
        "Type": "Update",
        "ID": 1,
        "Fields": {
            "ROW80_6": "\u001B[5\u0060abc"
        }
    },
    "PostID": 1,
    "ID": 1,
    "Domain": "MarketPrice"
}


Upvotes
24.4k 53 17 14

Hello @nittandev

Thank you for contacting us. To contribute the PAGE data with the WebSocket, the application needs to send the message in the string format that you need.


I hope this helps.

icon clock
10 |1500

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

Upvotes
68 0 2 6

Hi @wasin.w


To contribute the PAGE data with the WebSocket, the application needs to send the message in the string format that you need.

Ok, this answers my 2nd question about the "FORMAT".

How about my first question? How do I specify the position in the page?

icon clock
10 |1500

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

Upvotes
24.4k 53 17 14

Hello @nittandev

I admit that I am not an expert in the PAGE based ric. However, I suggest you try my colleague's answer in this old post.

You may apply for the RDC and contact to the dedicated Real-Time APIs support team to help you with this question. You can submit a support ticket to the Real-Time APIs support team by clicking the "Contact premium support" on the Websocket API page.

Please contact RDC Administrator <rdc.administrator@lseg.com> if you want to apply for RDC.

websocket-support.png


icon clock
10 |1500

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

Write an Answer

Hint: Notify or tag a user in this post by typing @username.

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