REST Renaming Attributes

If you have questions or if you want to share your opinion about Aware IM post your message on this forum
Post Reply
PointsWell
Posts: 1457
Joined: Tue Jan 24, 2017 5:51 am
Location: 'Stralya

REST Renaming Attributes

Post by PointsWell »

I am using a REST API which responds with this

Code: Select all

{
    "Meta Data": {
        "1. Information": "Forex Daily Prices (open, high, low, close)",
        "2. From Symbol": "EUR",
        "3. To Symbol": "USD",
        "4. Output Size": "Full size",
        "5. Last Refreshed": "2021-09-07 01:25:00",
        "6. Time Zone": "UTC"
    },
    "Time Series FX (Daily)": {
        "2021-09-07": {
            "1. open": "1.18710",
            "2. high": "1.18840",
            "3. low": "1.18710",
            "4. close": "1.18837"
        },
        "2011-09-06": {
            "1. open": "1.40038",
            "2. high": "1.41307",
            "3. low": "1.40021",
            "4. close": "1.40033"
        }
    }
}
This is a truncated response - the record can be much longer, but is repetitive.

So I have BOs like this:

Response with attributes
MetaData
TimeSeriesFX

Where MetaData is a BO with attributes
Information
FromSymbol
ToSymbol
OutputSize
LastRefreshed
ResponseTimeZone

But I am getting stuck with the Contents of the next object because the label is actually data.

Does anyone have any suggestions as to how to model the TimeSeriesFX section?
Post Reply