Consumptions API

The voyage’s figure consumptions (in MT) are stored in the Voyage resource in the following attributes:

  • foConsumption (FO)

  • doConsumption (LS FO)

  • dlConsumption (LS MGO)

  • flConsumption (MGO)

The leg’s figure consumptions are stored in the Rob resource.

Rob = remaining on board.

To retrieve information about Rob, you can refer to the EventLog object associated with a PortCall. Each EventLog contains an underlying Event with an EventCode attribute. There are four events created for each port call with the following Event Codes - 'ARR', 'BRT', 'UBRT', and 'DEP', corresponding to 'Arrival', 'Berthed', 'Unberthed', and 'Departure', respectively. For instance, consumption at sea for a Port Call X can be retrieved by identifying the correct EventLog from a list of EventLogs on the PortCall. The correct, in the case of acquiring at-sea consumption, EventLog must have an Event with EventCode = 'ARR'. After the correct EventLog is identified, the respective Rob can be found by:

https://BASE_URL/ws/rest/EventLog/20027578

A similar request would return the following:

{
    "key": 20027578,
    "self": "https://BASE_URL/ws/rest/EventLog/20027578",
    "event": {
        "key": 13575292,
        "self": "https://BASE_URL/ws/rest/Event/13575292",
        "eventCode": "UBRT"
    },
    "robs": [
        {
            "key": 20027642,
            "self": "https://BASE_URL/ws/rest/Rob/20027642",
            "bunkerCategory": {
                "key": 916944,
                "self": "https://BASE_URL/ws/rest/BunkerCategory/916944",
                "bunkerCategoryCode": "FO"
            },
            "robFixed": false,
            "rob": 0.0,
            "consumption": 0.0
        },
        {
            "key": 20027649,
            "self": "https://BASE_URL/ws/rest/Rob/20027649",
            "bunkerCategory": {
                "key": 916947,
                "self": "https://BASE_URL/ws/rest/BunkerCategory/916947",
                "bunkerCategoryCode": "DL"
            },
            "robFixed": false,
            "rob": -4.61125655636663,
            "consumption": 0.0
        },
        {
            "key": 20027651,
            "self": "https://BASE_URL/ws/rest/Rob/20027651",
            "bunkerCategory": {
                "key": 916945,
                "self": "https://BASE_URL/ws/rest/BunkerCategory/916945",
                "bunkerCategoryCode": "FL"
            },
            "robFixed": false,
            "rob": 0.0,
            "consumption": 0.0
        },
        {
            "key": 20027663,
            "self": "https://BASE_URL/ws/rest/Rob/20027663",
            "bunkerCategory": {
                "key": 916946,
                "self": "https://BASE_URL/ws/rest/BunkerCategory/916946",
                "bunkerCategoryCode": "DO"
            },
            "robFixed": false,
            "rob": 0.0,
            "consumption": 0.0
        }
    ]
}

Note! To get the same response, the following header fields must be specified: {"event":{"eventCode":"*"},"robs": {"consumption":"*","robFixed":"*","rob": "*","bunkerCategory":{"bunkerCategoryCode":"*"}}}

To retrieve a list of Robs for a given EventLog, use the "robs" field. The response will always include four Rob objects, each corresponding to a different BunkerCategory. However, if you only need a single rob for a specific bunker category, you can use one of the other attributes instead of "robs".

  • foRob

  • doRob

  • flRob

  • dlRob Header fields: "foRob": {"consumption":"*","robFixed":"*","rob": "*","bunkerCategory":{"bunkerCategoryCode":"*"}}

Rob fields

{
  "eventLog": {},
  "robFixed": true,
  "bunkerCategory": {},
  "rob": -1.7976931348623157e+308,
  "consumption": -1.7976931348623157e+308
}

Attributes breakdown:

  • robFixed - identifies whether the Rob value is fixed or not.

  • rob - illustrates the remaining onboard fuel in MT.

  • consumption - suggests the consumption for the EventLog and the BunkerCategory.

How do we get the total consumption for a Port Call?

To get total consumption for a Port Call, Robs for all EventLogs on the PortCalls must be acquired.

The list of all EventLogs can be referenced directly from a PortCall:

Header fields: {"eventLogs": {"event":{"eventCode":"*"},"robs": {"consumption":"*","robFixed":"*","rob": "*","bunkerCategory":{"bunkerCategoryCode":"*"}}}}

Response:

{
    "key": 20027590,
    "self": "https://BASE_URL/ws/rest/PortCall/20027590",
    "eventLogs": [
        {
            "key": 20027578,
            "self": "https://BASE_URL/ws/rest/EventLog/20027578",
            "event": {
                "key": 13575292,
                "self": "https://BASE_URL/ws/rest/Event/13575292",
                "eventCode": "UBRT"
            },
            "robs": [
                {
                    "key": 20027642,
                    "self": "https://BASE_URL/ws/rest/Rob/20027642",
                    "bunkerCategory": {
                        "key": 916944,
                        "self": "https://BASE_URL/ws/rest/BunkerCategory/916944",
                        "bunkerCategoryCode": "FO"
                    },
                    "robFixed": false,
                    "rob": 0.0,
                    "consumption": 0.0
                },
                {
                    "key": 20027649,
                    "self": "https://BASE_URL/ws/rest/Rob/20027649",
                    "bunkerCategory": {
                        "key": 916947,
                        "self": "https://BASE_URL/ws/rest/BunkerCategory/916947",
                        "bunkerCategoryCode": "DL"
                    },
                    "robFixed": false,
                    "rob": -4.61125655636663,
                    "consumption": 0.0
                },
                {
                    "key": 20027651,
                    "self": "https://BASE_URL/ws/rest/Rob/20027651",
                    "bunkerCategory": {
                        "key": 916945,
                        "self": "https://BASE_URL/ws/rest/BunkerCategory/916945",
                        "bunkerCategoryCode": "FL"
                    },
                    "robFixed": false,
                    "rob": 0.0,
                    "consumption": 0.0
                },
                {
                    "key": 20027663,
                    "self": "https://BASE_URL/ws/rest/Rob/20027663",
                    "bunkerCategory": {
                        "key": 916946,
                        "self": "https://BASE_URL/ws/rest/BunkerCategory/916946",
                        "bunkerCategoryCode": "DO"
                    },
                    "robFixed": false,
                    "rob": 0.0,
                    "consumption": 0.0
                }
            ]
        },
        {
            "key": 20027584,
            "self": "https://BASE_URL/ws/rest/EventLog/20027584",
            "event": {
                "key": 1000051,
                "self": "https://BASE_URL/ws/rest/Event/1000051",
                "eventCode": "BRT"
            },
            "robs": [
                {
...

The output will consist of four EventLog objects, each containing four robs, making a total of sixteen robs (calculated by multiplying the number of event logs by four bunker categories). By adding up all the consumption attributes, you can get the total consumption per leg

It is possible to retrieve all DO consumption by specifying "doRob" instead of "robs" . The same logic is applicable for all fuel categories (ref. foRob, flRob, doRob, dlRob).

Last updated