# Overview

## Overview

Position reports update a port call's sailing, arrival, in port, and departure status. Most fields in the PositionReport object will only provide information, while a few affect the port call's results.

The following fields will affect the port call's results:

* eventLogs
  * An [**EventLog**](https://dataloy-systems.stoplight.io/docs/dataloyModel/branches/API%2F8.12/model/schemas/event-log) captures port events along with their dates and times. The port events include ARRIVAL, BERTHED, UNBERTHED, and DEPARTURE. To record the arrival date of a port call, an event log entry should include the ARRIVAL event along with the corresponding date.

  * A [**PositionReportBunker**](https://dataloy-systems.stoplight.io/docs/dataloyModel/branches/API%2F8.12/model/schemas/position-report-bunker) records the remaining bunkers on board for a specific bunker category

Fields impacting the port call's results will have **Major Change Factor** marked as yes, along with a description, on the [details](#details).

PositionReport can be one of these types:

* Noon Report
  * logs the ship's status at sea, updating the estimated arrival date and ROB info
* Arrival Report
  * logs when the ship arrives in the port, fixing the arrival date and ROB info
* Berth Report
  * logs when the ship has berthed in the port, fixing the berthed date and ROB info
* Unberth Report
  * logs when the ship has unberthed in the port, fixing the unberthed date and ROB info
* In Port Report
  * logs supplementary information such as hours in service, weather, wind direction and average wind direction when the ship is docked.&#x20;
* Departure Report
  * logs when the ship leaves the port, fixing the departure date and ROB info

In order to include a [Remark](https://dataloy-systems.stoplight.io/docs/dataloyModel/branches/API%2F8.12/model/schemas/remark) on the position report, a separate API request must be made after the report is created. See [here](#arrival-report-with-remark) for an example.

## Details

### Noon Report&#x20;

<table data-full-width="true"><thead><tr><th>Field Name</th><th width="215">Json Attribute</th><th width="161">Description</th><th>Mandatory</th><th>Major Change Factor</th><th width="209">Data type</th><th>Notes</th></tr></thead><tbody><tr><td>Report Type</td><td><code>vesselReportType</code></td><td>Determines the type of vessel report</td><td>yes</td><td></td><td>String</td><td>"NOON"</td></tr><tr><td>Noon Report Date</td><td><code>reportDateLocal</code></td><td>Date and time of creation of the report</td><td>yes</td><td></td><td>String</td><td>should be in this format:<br>"YYYY-MM-DDTHH:mm:ss"</td></tr><tr><td>Port Call</td><td><code>portCall</code></td><td>Port to update</td><td>yes</td><td></td><td>Long</td><td>key of the port call</td></tr><tr><td>Latitude</td><td><code>latitude</code></td><td>Current position</td><td>yes</td><td></td><td>Double</td><td></td></tr><tr><td>Longitude</td><td><code>longitude</code></td><td>Current position</td><td>yes</td><td></td><td>Double</td><td></td></tr><tr><td>Estimated Time of Arrival</td><td><code>eventLogs</code></td><td>Date and time of estimated time of arrival</td><td>yes</td><td>yes, updates PortCall's arrival date</td><td><a href="https://dataloy-systems.stoplight.io/docs/dataloyModel/branches/API%2F8.12/model/schemas/event-log">EventLog</a></td><td><p>should be the key of the port call's arrival event log</p><p><br>date should be in this format:<br>"YYYY-MM-DDTHH:mm:ss"</p></td></tr><tr><td>Remaining bunkers on board</td><td><code>"positionReportBunkers": [{"bunkerCategory": "FO", "rob":100}]</code></td><td>Remaining bunkers on board at the time of reporting for the given bunker category</td><td></td><td>yes, updates PortCall's arrival rob</td><td><a href="https://dataloy-systems.stoplight.io/docs/dataloyModel/branches/API%2F8.12/model/schemas/position-report-bunker">PositionReportBunker</a></td><td>one PositionReportBunker object for each bunker category</td></tr><tr><td>Wind Direction</td><td><code>windDirection</code></td><td>Determines current wind direction</td><td></td><td></td><td><a href="https://dataloy-systems.stoplight.io/docs/dataloyModel/branches/API%2F8.12/model/schemas/direction">Direction</a></td><td><a href="/pages/7WNtVUI6a9kCz1auFJDq#direction-data">Click here for more details</a></td></tr><tr><td>Average Wind Force</td><td><code>averageWindForce</code></td><td>General wind conditions</td><td></td><td></td><td>Double</td><td></td></tr><tr><td>Sea Direction</td><td><code>seaDirection</code></td><td>Current sea direction</td><td></td><td></td><td><a href="https://dataloy-systems.stoplight.io/docs/dataloyModel/branches/API%2F8.12/model/schemas/direction">Direction</a></td><td><a href="/pages/7WNtVUI6a9kCz1auFJDq#direction-data">Click here for more details</a></td></tr><tr><td>Average Sea State</td><td><code>averageSeaState</code></td><td>General sea conditions</td><td></td><td></td><td>Double</td><td></td></tr><tr><td>Weather</td><td><code>weather</code></td><td>Determines current weather</td><td></td><td></td><td><a href="https://dataloy-systems.stoplight.io/docs/dataloyModel/branches/API%2F8.12/model/schemas/weather">Weather</a></td><td><a href="/pages/7WNtVUI6a9kCz1auFJDq#weather-data">Click here for more details</a></td></tr><tr><td>Distance Sailed</td><td><code>distanceSailed</code></td><td>Distance sailed</td><td></td><td></td><td>Double</td><td></td></tr><tr><td>Hours in Service</td><td><code>hoursInService</code></td><td>Number of hours in operation</td><td></td><td></td><td>Double</td><td></td></tr><tr><td>Main Engine RPM</td><td><code>rpmFromLastPort</code></td><td>RPM recorded from previous port</td><td></td><td></td><td>Double</td><td></td></tr></tbody></table>

### Noon report example

<details>

<summary>Noon Report sailing to a port</summary>

1. Assuming the voyage key, and port call sequence are known, get the PortCall key with this query and headers:

```http
GET /ws/rest/PortCall?filter=voyage.key(EQ)123456&portCallSequence(EQ)2=null HTTP/1.1
Host: BASEURL
fields: {"eventLogs": {"event": {"eventCode":"*"}, "robs": {"bunkerCategory": {"bunkerCategoryCode":"*"}, "rob": "*"}}}
Authorization: Bearer ....
```

An example of the response could be found [here](#portcall-query-with-eventlogs-fields-response)

2. Generate a Noon Report for the vessel that has sailed 3150 nm to the queried PortCall, with South/West wind direction and partly cloudy weather.  Arrival LS MGO robs are also updated to 250

```http
POST /ws/rest/PositionReport HTTP/1.1
Host: BASEURL
Content-Type: application/json
Authorization: Bearer ....
```

{% code overflow="wrap" %}

```json
{
    "vesselReportType": "NOON",
    "reportDateLocal": "2024-08-01T19:00:00",
    "portCall": 123456, //key from the response of the PortCall query
    "latitude": 60.2139,
    "longitude": 4.5300,
    "eventLogs": [
        {
            "key": 123456, //arrival event log key
            "eventLogDate": "2024-08-02T02:36:00"
        }
    ],
    "positionReportBunkers": [
        {
            "bunkerCategory": 123456, //bunker category key
            "rob": 555
         
        },
        {
            "bunkerCategory": 654321, //bunker category key
            "rob": 7777
        
        }
    ],
    "windDirection": 911643,
    "weather": 950928,
    "distanceSailed": 3150.00
}
```

{% endcode %}

</details>

### Arrival Report

<table data-full-width="true"><thead><tr><th>Field Name</th><th width="198">Json Attribute</th><th>Description</th><th>Mandatory</th><th>Major Change Factor</th><th>Data Type</th><th>Notes</th></tr></thead><tbody><tr><td>Vessel Report Type</td><td><code>vesselReportType</code></td><td>Determines the type of vessel report</td><td>yes</td><td></td><td>String</td><td>"ARR"</td></tr><tr><td>Port Call</td><td><code>portCall</code></td><td>Port to update</td><td>yes</td><td></td><td>Long</td><td>key of the port call</td></tr><tr><td>Arrival Date</td><td><code>eventLogs</code></td><td>Date and time of arrival on port</td><td>yes</td><td>yes, updates and fixes PortCall's arrival date</td><td><a href="https://dataloy-systems.stoplight.io/docs/dataloyModel/branches/API%2F8.12/model/schemas/event-log">EventLog</a></td><td><p>should be the key of the port call's arrival event log</p><p><br>date should be in this format:<br>"YYYY-MM-DDTHH:mm:ss"</p></td></tr><tr><td>Arrival Report Date</td><td><code>reportDateLocal</code></td><td>Date and time of creation of the report</td><td></td><td></td><td>String</td><td>should be in this format:<br>"YYYY-MM-DDTHH:mm:ss"</td></tr><tr><td>Actual Distance Sailed Since Departure</td><td><code>distanceSailed</code></td><td>Distance in nm sailed from previous port</td><td></td><td>yes, updates the PortCall's actual distance sailed</td><td>Double</td><td></td></tr><tr><td>Remaining bunkers on board</td><td><code>"positionReportBunkers": [{"bunkerCategory": "FO", "rob":98}]</code></td><td>Remaining bunkers at the time of arrival for the given bunker category</td><td></td><td>yes, updates and fixes PortCall's arrival ROB</td><td><a href="https://dataloy-systems.stoplight.io/docs/dataloyModel/branches/API%2F8.12/model/schemas/position-report-bunker">PositionReportBunker</a></td><td>one PositionReportBunker object for each bunker category</td></tr><tr><td>Hours Stoppage</td><td><code>hoursStoppages</code></td><td>Number of hours in stoppage of operation</td><td></td><td></td><td>Double</td><td></td></tr><tr><td>Hours In Service</td><td><code>hoursInService</code></td><td>Number of hours in operation</td><td></td><td></td><td>Double</td><td></td></tr><tr><td>Speed Made Good</td><td><code>speedMadeGood</code></td><td>Net speed when sailing to the port</td><td></td><td></td><td>Double</td><td></td></tr><tr><td>Draft Aft</td><td><code>draftAft</code></td><td>Vessel's draft aft</td><td></td><td></td><td>Double</td><td></td></tr><tr><td>Draft Forward</td><td><code>draftForward</code></td><td>Vessel's draft forward</td><td></td><td></td><td>Double</td><td></td></tr></tbody></table>

### Arrival report example

<details>

<summary>Arrival report on port call</summary>

1. Assuming the voyage key, and port call sequence are known, get the PortCall key with this query:

```http
GET /ws/rest/PortCall?filter=voyage.key(EQ)123456&portCallSequence(EQ)2=null HTTP/1.1
Host: BASEURL
fields: {"eventLogs": {"event": {"eventCode":"*"}, "robs": {"bunkerCategory": {"bunkerCategoryCode":"*"}, "rob": "*"}}}
Authorization: Bearer ....
```

Example of the response can be found [here](#portcall-query-with-eventlogs-fields-response)

2. Generate a report for arrival at 2nd August 2024 03:00 with arrival FO ROB at 225.85 mt and arrival LS MGO ROB at 235 mt

```http
POST /ws/rest/PositionReport HTTP/1.1
Host: BASEURL
Content-Type: application/json
Authorization: Bearer ....
```

```json
{
    "vesselReportType": "ARR",
    "reportDateLocal": "2024-08-01T19:00:00",
    "portCall": 123456, //key from the response of the PortCall query
    "latitude": 60.2139,
    "longitude": 4.5300,
    "eventLogs": [
        {
           "key": 123456, //arrival event log key
            "eventLogDate": "2024-08-02T03:00:00"
        }
    ],
    "positionReportBunkers": [
        {
            "bunkerCategory": 123456, //bunker category key
            "rob": 235
         
        },
        {
            "bunkerCategory": 654321, //bunker category key
            "rob": 225.85
        
        }
    ]
}
```

</details>

### Berth Report

<table data-full-width="true"><thead><tr><th width="162.251708984375">Field Name</th><th width="214">Json Attribute</th><th>Description</th><th>Mandatory</th><th>Major Change Factor</th><th>Data Type</th><th>Notes</th></tr></thead><tbody><tr><td>Vessel Report Type</td><td><code>vesselReportType</code></td><td>Determines the type of vessel report</td><td>yes</td><td></td><td>String</td><td>"BRT"</td></tr><tr><td>Port Call</td><td><code>portCall</code></td><td>Port to update</td><td>yes</td><td></td><td>Long</td><td>key of the port call</td></tr><tr><td>Berth date</td><td><code>eventLogs</code></td><td>Date and time of berthing on port</td><td>yes</td><td>yes, updates and fixes PortCall's berthed date</td><td><a href="https://dataloy-systems.stoplight.io/docs/dataloyModel/branches/API%2F8.12/model/schemas/event-log">EventLog</a></td><td><p>should be the key of the port call's berth event log</p><p><br>date should be in this format:<br>"YYYY-MM-DDTHH:mm:ss"</p></td></tr><tr><td>Berth Report Date</td><td><code>reportDateLocal</code></td><td>Date and time of creation of the report</td><td></td><td></td><td>String</td><td>should be in this format:<br>"YYYY-MM-DDTHH:mm:ss"</td></tr><tr><td>Remaining bunkers on board</td><td><code>"positionReportBunkers": [{"bunkerCategory": "FO", "rob":95}]</code></td><td>Remaining bunkers at the time of berthing for the given bunker category</td><td></td><td>yes, updates and fixes PortCall's berthing ROB</td><td><a href="https://dataloy-systems.stoplight.io/docs/dataloyModel/branches/API%2F8.12/model/schemas/position-report-bunker">PositionReportBunker</a></td><td>one PositionReportBunker object for each bunker category</td></tr></tbody></table>

### Berth report example

<details>

<summary>Berth report on a port call</summary>

1. Assuming the voyage key, and port call sequence are known, get the PortCall key with this query:

```http
GET /ws/rest/PortCall?filter=voyage.key(EQ)123456&portCallSequence(EQ)2=null HTTP/1.1
Host: BASEURL
fields: {"eventLogs": {"event": {"eventCode":"*"}, "robs": {"bunkerCategory": {"bunkerCategoryCode":"*"}, "rob": "*"}}}
Authorization: Bearer ....
```

2. Generate a report that has berthed 3rd August 2024 08:00 with berth FO rob at 225 mt and DL rob at 220 mt

```http
POST /ws/rest/PositionReport HTTP/1.1
Host: BASEURL
Content-Type: application/json
Authorization: Bearer ....
```

```json
{
    "vesselReportType": "BRT",
    "reportDateLocal": "2024-08-03T10:36:00",
    "portCall": 123456, //key from the response of the PortCall query
    "eventLogs": [
        {
            "key": 123456, //berth event log key
            "eventLogDate": "2024-08-03T10:36:00"
        }
    ],
    "positionReportBunkers": [
        {
            "bunkerCategory": 123456, //bunker category key
            "rob": 220
         
        },
        {
            "bunkerCategory": 654321, //bunker category key
            "rob": 225
        
        }
    ]
}
```

</details>

### Unberth Report

<table data-full-width="true"><thead><tr><th>Field Name</th><th width="207">Json Attribute</th><th>Description</th><th>Mandatory</th><th>Major Change Factor</th><th>Data Type</th><th>Notes</th></tr></thead><tbody><tr><td>Vessel Report Type</td><td><code>vesselReportType</code></td><td>Determines the type of vessel report</td><td>yes</td><td></td><td>String</td><td>"UBRT"</td></tr><tr><td>Port Call</td><td><code>portCall</code></td><td>Port to update</td><td>yes</td><td></td><td>Long</td><td>key of the port call</td></tr><tr><td>Unberth date</td><td><code>eventLogs</code></td><td>Date and time of berthing on port</td><td>yes</td><td>yes, updates and fixes PortCall's berthed date</td><td><a href="https://dataloy-systems.stoplight.io/docs/dataloyModel/branches/API%2F8.12/model/schemas/event-log">EventLog</a></td><td><p>should be the key of the port call's unberth event log</p><p><br>date should be in this format: "YYYY-MM-DDTHH:mm:ss"</p></td></tr><tr><td>Unberth Report Date</td><td><code>reportDateLocal</code></td><td>Date and time of creation of the report</td><td></td><td></td><td>String</td><td>should be in this format:<br>"YYYY-MM-DDTHH:mm:ss"</td></tr><tr><td>Remaining bunkers on board</td><td><code>"positionReportBunkers": [{"bunkerCategory": "FO", "rob":95}]</code></td><td>Remaining bunkers at the time of unberthing for the given bunker category</td><td></td><td>yes, updates and fixes PortCall's unberthing ROB</td><td><a href="https://dataloy-systems.stoplight.io/docs/dataloyModel/branches/API%2F8.12/model/schemas/position-report-bunker">PositionReportBunker</a></td><td>one PositionReportBunker object for each bunker category</td></tr></tbody></table>

### Unberth report example

<details>

<summary>Unberth report on a port call</summary>

1. Assuming the voyage key, and port call sequence are known, get the PortCall key with this query:

```http
GET /ws/rest/PortCall?filter=voyage.key(EQ)123456&portCallSequence(EQ)2=null HTTP/1.1
Host: BASEURL
fields: {"eventLogs": {"event": {"eventCode":"*"}, "robs": {"bunkerCategory": {"bunkerCategoryCode":"*"}, "rob": "*"}}}
Authorization: Bearer ....
```

Example response can be found [here](#portcall-query-with-eventlogs-fields-response)

2. Generate a report that has unberthed 5th August 2024 08:00, FO unberth ROB at 225 mt, DL unberth at 218.5 mt

```http
POST /ws/rest/PositionReport HTTP/1.1
Host: BASEURL
Content-Type: application/json
Authorization: Bearer ....
```

```json
{
    "vesselReportType": "UBRT",
    "reportDateLocal": "2024-08-05T08:00:00",
    "portCall": 123456, //key from the response of the PortCall query
    "eventLogs": [
        {
            "key": 123456, //unberth event log key
            "eventLogDate": "2024-08-05T08:00:00"
        }
    ],
    "positionReportBunkers": [
        {
            "bunkerCategory": 123456, //bunker category key
            "rob": 218.5
         
        },
        {
            "bunkerCategory": 654321, //bunker category key
            "rob": 225
        
        }
    ]
}
```

</details>

### In Port Report

<table data-full-width="true"><thead><tr><th>Field Name</th><th width="198">Json Attribute</th><th>Description</th><th>Mandatory</th><th>Major Change Factor</th><th>Data Type</th><th>Notes</th></tr></thead><tbody><tr><td>Vessel Report Type</td><td><code>vesselReportType</code></td><td>Determines the type of vessel report</td><td>yes</td><td></td><td>String</td><td>"PORT"</td></tr><tr><td>Port Call</td><td><code>portCall</code></td><td>Port to update</td><td>yes</td><td></td><td>Long</td><td>key of the port call</td></tr><tr><td>In Port Report Date</td><td><code>reportDateLocal</code></td><td>Date and time of creation of the report</td><td></td><td></td><td>String</td><td>should be in this format:<br>"YYYY-MM-DDTHH:mm:ss"</td></tr><tr><td>Hours In Service</td><td><code>hoursInService</code></td><td>Number of hours in operation</td><td></td><td></td><td>Double</td><td></td></tr><tr><td>Weather</td><td><code>weather</code></td><td>Current weather</td><td></td><td></td><td><a href="https://dataloy-systems.stoplight.io/docs/dataloyModel/branches/API%2F8.12/model/schemas/weather">Weather</a></td><td><a href="/pages/7WNtVUI6a9kCz1auFJDq#weather-data">Click here for more details</a></td></tr><tr><td>Wind Direction</td><td><code>windDirection</code></td><td>Current wind direction</td><td></td><td></td><td><a href="https://dataloy-systems.stoplight.io/docs/dataloyModel/branches/API%2F8.12/model/schemas/direction">Direction</a></td><td><a href="/pages/7WNtVUI6a9kCz1auFJDq#direction-data">Click here for more details</a></td></tr><tr><td>Average Wind Force</td><td><code>averageWindForce</code></td><td>General wind conditions</td><td></td><td></td><td>Double</td><td></td></tr></tbody></table>

### In port report example

<details>

<summary>In port report on a port call</summary>

1. Assuming the voyage key, and port call sequence are known, get the PortCall key with this query:

```http
GET /ws/rest/PortCall?filter=voyage.key(EQ)123456&portCallSequence(EQ)2=null HTTP/1.1
Host: BASEURL
fields: {"eventLogs": {"event": {"eventCode":"*"}, "robs": {"bunkerCategory": {"bunkerCategoryCode":"*"}, "rob": "*"}}}
Authorization: Bearer ....
```

2. Generate a report to log sunny weather, East wind direction, hours in service, average wind force status in port

```http
POST /ws/rest/PositionReport HTTP/1.1
Host: BASEURL
Content-Type: application/json
Authorization: Bearer ....
```

```json
{
    "vesselReportType": "PORT",
    "reportDateLocal": "2024-08-03T18:00:00",
    "portCall": 123456, //key from the response of the PortCall request
    "hoursInService": 225.85,
    "weather": 950927,
    "windDirection": 911638,
    "averageWindForce": 1
}
```

</details>

### Departure Report

<table data-full-width="true"><thead><tr><th>Field Name</th><th width="199">Json Attribute</th><th>Description</th><th>Mandatory</th><th>Major Change Factor</th><th>Data Type</th><th>Notes</th></tr></thead><tbody><tr><td>Vessel Report Type</td><td><code>vesselReportType</code></td><td>Determines the type of vessel report</td><td>yes</td><td></td><td>String</td><td>"DEP"</td></tr><tr><td>Port Call</td><td><code>portCall</code></td><td>Port to update</td><td>yes</td><td></td><td>Long</td><td>key of the port call</td></tr><tr><td>Departure date</td><td><code>eventLogs</code></td><td>Date and time of departure from port</td><td>yes</td><td>yes, updates and fixes PortCall's departure date</td><td><a href="https://dataloy-systems.stoplight.io/docs/dataloyModel/branches/API%2F8.12/model/schemas/event-log">EventLog</a></td><td><p>should be the key of the port call's departure event log</p><p><br>date should be in this format: "YYYY-MM-DDTHH:mm:ss"</p></td></tr><tr><td>Departure Report Date</td><td><code>reportDateLocal</code></td><td>Date and time of creation of the report</td><td></td><td></td><td>String</td><td>should be in this format: "YYYY-MM-DDTHH:mm:ss"</td></tr><tr><td>Remaining bunkers on board</td><td><code>"positionReportBunkers": [{"bunkerCategory": "FO", "rob":90}]</code></td><td>Remaining bunkers at the time of departure for the given bunker category</td><td></td><td>yes, updates and fixes PortCall's departure ROB</td><td><a href="https://dataloy-systems.stoplight.io/docs/dataloyModel/branches/API%2F8.12/model/schemas/position-report-bunker">PositionReportBunker</a></td><td>one PositionReportBunker object for each bunker category</td></tr><tr><td>Distance to next port</td><td><code>distanceToNextPort</code></td><td>Distance in nm to next port</td><td></td><td></td><td>Double</td><td></td></tr><tr><td>Draft Aft</td><td><code>draftAft</code></td><td>Vessel's draft aft</td><td></td><td></td><td>Double</td><td></td></tr><tr><td>Draft Forward</td><td><code>draftForward</code></td><td>Vessel's draft forward</td><td></td><td></td><td>Double</td><td></td></tr></tbody></table>

### Departure Report example

<details>

<summary>Departure report on a port call</summary>

1. Assuming the voyage key, and port call sequence are known, get the PortCall key with this query:

```http
GET /ws/rest/PortCall?filter=voyage.key(EQ)123456&portCallSequence(EQ)2=null HTTP/1.1
Host: BASEURL
fields: {"eventLogs": {"event": {"eventCode":"*"}, "robs": {"bunkerCategory": {"bunkerCategoryCode":"*"}, "rob": "*"}}}
Authorization: Bearer ....
```

Example of the response can be found [here](#portcall-query-with-eventlogs-fields-response)

2. Generate a report that has fixes the departure date to  5th August 2024 08:30, departure FO rob at 225 mt and departure DL rob at 215 mt

```http
POST /ws/rest/PositionReport HTTP/1.1
Host: BASEURL
Content-Type: application/json
Authorization: Bearer ....
```

```json
{
    "vesselReportType": "DEP",
    "reportDateLocal": "2024-08-05T08:30:00",
    "portCall": 123456, //key from the response of the PortCall query
    "eventLogs": [
        {
            "key": 123456, //departure event log key
            "eventLogDate": "2024-08-05T08:30:00"
        }
    ],
    "positionReportBunkers": [
        {
            "bunkerCategory": 123456, //bunker category key
            "rob": 218.5
         
        },
        {
            "bunkerCategory": 654321, //bunker category key
            "rob": 225
        }
      ]
}
```

</details>

### More examples

<details>

<summary>PortCall query with "eventLogs" fields  response</summary>

```json
[
    {
        "key": 6130402,
        "eventLogs": [
            {
                "key": 6130391,
                "event": {
                    "key": 1000051,
                    "eventCode": "BRT"
                },
                "robs": [
                    {
                        "key": 6130447,
                        "rob": 0.0,
                        "bunkerCategory": {
                            "key": 916946,
                            "bunkerCategoryCode": "DO"
                        }
                    },
                    {
                        "key": 6130450,
                        "rob": 0.0,
                        "bunkerCategory": {
                            "key": 916944,
                            "bunkerCategoryCode": "FO"
                        }
                    },
                    {
                        "key": 6130462,
                        "rob": 0.0,
                        "bunkerCategory": {
                            "key": 916945,
                            "bunkerCategoryCode": "FL"
                        }
                    },
                    {
                        "key": 6130464,
                        "rob": 249.75,
                        "bunkerCategory": {
                            "key": 916947,
                            "bunkerCategoryCode": "DL"
                        }
                    }
                ]
            },
            {
                "key": 6130396,
                "event": {
                    "key": 6088041,
                    "eventCode": "UBRT"
                },
                "robs": [
                    {
                        "key": 6130444,
                        "rob": 249.75,
                        "bunkerCategory": {
                            "key": 916947,
                            "bunkerCategoryCode": "DL"
                        }
                    },
                    {
                        "key": 6130452,
                        "rob": 0.0,
                        "bunkerCategory": {
                            "key": 916945,
                            "bunkerCategoryCode": "FL"
                        }
                    },
                    {
                        "key": 6130459,
                        "rob": 0.0,
                        "bunkerCategory": {
                            "key": 916946,
                            "bunkerCategoryCode": "DO"
                        }
                    },
                    {
                        "key": 6130470,
                        "rob": 0.0,
                        "bunkerCategory": {
                            "key": 916944,
                            "bunkerCategoryCode": "FO"
                        }
                    }
                ]
            },
            {
                "key": 6130392,
                "event": {
                    "key": 1000052,
                    "eventCode": "DEP"
                },
                "robs": [
                    {
                        "key": 6130440,
                        "rob": 0.0,
                        "bunkerCategory": {
                            "key": 916944,
                            "bunkerCategoryCode": "FO"
                        }
                    },
                    {
                        "key": 6130448,
                        "rob": 0.0,
                        "bunkerCategory": {
                            "key": 916945,
                            "bunkerCategoryCode": "FL"
                        }
                    },
                    {
                        "key": 6130454,
                        "rob": 249.75,
                        "bunkerCategory": {
                            "key": 916947,
                            "bunkerCategoryCode": "DL"
                        }
                    },
                    {
                        "key": 6130458,
                        "rob": 0.0,
                        "bunkerCategory": {
                            "key": 916946,
                            "bunkerCategoryCode": "DO"
                        }
                    }
                ]
            },
            {
                "key": 6130395,
                "event": {
                    "key": 1000050,
                    "eventCode": "ARR"
                },
                "robs": [
                    {
                        "key": 6130451,
                        "rob": 0.0,
                        "bunkerCategory": {
                            "key": 916945,
                            "bunkerCategoryCode": "FL"
                        }
                    },
                    {
                        "key": 6130460,
                        "rob": 250.0,
                        "bunkerCategory": {
                            "key": 916947,
                            "bunkerCategoryCode": "DL"
                        }
                    },
                    {
                        "key": 6130467,
                        "rob": 0.0,
                        "bunkerCategory": {
                            "key": 916946,
                            "bunkerCategoryCode": "DO"
                        }
                    },
                    {
                        "key": 6130469,
                        "rob": 0.0,
                        "bunkerCategory": {
                            "key": 916944,
                            "bunkerCategoryCode": "FO"
                        }
                    }
                ]
            }
        ]
    },
    {
        "key": 6130400,
        "eventLogs": [
            {
                "key": 6130394,
                "event": {
                    "key": 1000051,
                    "eventCode": "BRT"
                },
                "robs": [
                    {
                        "key": 6130441,
                        "rob": 230.53559444257462,
                        "bunkerCategory": {
                            "key": 916947,
                            "bunkerCategoryCode": "DL"
                        }
                    },
                    {
                        "key": 6130457,
                        "rob": 0.0,
                        "bunkerCategory": {
                            "key": 916945,
                            "bunkerCategoryCode": "FL"
                        }
                    },
                    {
                        "key": 6130461,
                        "rob": 0.0,
                        "bunkerCategory": {
                            "key": 916946,
                            "bunkerCategoryCode": "DO"
                        }
                    },
                    {
                        "key": 6130468,
                        "rob": 0.0,
                        "bunkerCategory": {
                            "key": 916944,
                            "bunkerCategoryCode": "FO"
                        }
                    }
                ]
            },
            {
                "key": 6130398,
                "event": {
                    "key": 1000050,
                    "eventCode": "ARR"
                },
                "robs": [
                    {
                        "key": 6130445,
                        "rob": 0.0,
                        "bunkerCategory": {
                            "key": 916945,
                            "bunkerCategoryCode": "FL"
                        }
                    },
                    {
                        "key": 6130456,
                        "rob": 0.0,
                        "bunkerCategory": {
                            "key": 916944,
                            "bunkerCategoryCode": "FO"
                        }
                    },
                    {
                        "key": 6130463,
                        "rob": 230.78559444257462,
                        "bunkerCategory": {
                            "key": 916947,
                            "bunkerCategoryCode": "DL"
                        }
                    },
                    {
                        "key": 6130471,
                        "rob": 0.0,
                        "bunkerCategory": {
                            "key": 916946,
                            "bunkerCategoryCode": "DO"
                        }
                    }
                ]
            },
            {
                "key": 6130393,
                "event": {
                    "key": 6088041,
                    "eventCode": "UBRT"
                },
                "robs": [
                    {
                        "key": 6130442,
                        "rob": 0.0,
                        "bunkerCategory": {
                            "key": 916945,
                            "bunkerCategoryCode": "FL"
                        }
                    },
                    {
                        "key": 6130443,
                        "rob": 0.0,
                        "bunkerCategory": {
                            "key": 916944,
                            "bunkerCategoryCode": "FO"
                        }
                    },
                    {
                        "key": 6130453,
                        "rob": 230.53559444257462,
                        "bunkerCategory": {
                            "key": 916947,
                            "bunkerCategoryCode": "DL"
                        }
                    },
                    {
                        "key": 6130466,
                        "rob": 0.0,
                        "bunkerCategory": {
                            "key": 916946,
                            "bunkerCategoryCode": "DO"
                        }
                    }
                ]
            },
            {
                "key": 6130397,
                "event": {
                    "key": 1000052,
                    "eventCode": "DEP"
                },
                "robs": [
                    {
                        "key": 6130446,
                        "rob": 0.0,
                        "bunkerCategory": {
                            "key": 916945,
                            "bunkerCategoryCode": "FL"
                        }
                    },
                    {
                        "key": 6130449,
                        "rob": 0.0,
                        "bunkerCategory": {
                            "key": 916944,
                            "bunkerCategoryCode": "FO"
                        }
                    },
                    {
                        "key": 6130455,
                        "rob": 0.0,
                        "bunkerCategory": {
                            "key": 916946,
                            "bunkerCategoryCode": "DO"
                        }
                    },
                    {
                        "key": 6130465,
                        "rob": 230.53559444257462,
                        "bunkerCategory": {
                            "key": 916947,
                            "bunkerCategoryCode": "DL"
                        }
                    }
                ]
            }
        ]
    }
]
```

</details>

<details>

<summary>Arrival report with Remark</summary>

1. Send first this request

Example: Arrival vessel report to register arrival date at 8th August 2024 02:58, with remaining 98 MT of FO on board

```http
POST /ws/rest/PositionReport HTTP/1.1
Host: BASEURL
Content-Type: application/json
Authorization: Bearer ....
```

```json
{
    "vesselReportType": "ARR",
    "reportDateLocal": "2024-08-02T02:58:00",
    "portCall": 6130402, //key from the response of the PortCall request
    "eventLogs": [
        {
            "key": 6130395, //key of the arrival event log from the response of the PortCall request
            "eventLogDate": "2024-08-02T02:58:00"
        }],
      "positionReportBunkers": [
        {
            "bunkerCategory": "FO", 
            "rob": 98
        }]
}
```

2. The response of the query above returns the PositionReport key. Generate a Remark on the arrival position report that says "Arrival on the port remark":

```
POST /ws/rest/Remark HTTP/1.1
```

```
{
    source: 5535223, //key from the response of PositionReport request
    "remark": "Arrival on the port remark"
}
```

</details>

<details>

<summary>Arrival report where port call key and voyage key are not known, using voyage.referenceNo and port name</summary>

1. Fetch the port call key

{% code fullWidth="true" %}

```
GET /ws/rest/PortCall?filter=voyage.voyageHeader.referenceNo(LKIC)TST001&port.portName(LKIC)Bergen case insensitive HTTP/1.1
Authorization: Bearer ....
```

{% endcode %}

2. Generate arrival report

```http
POST /ws/rest/PositionReport HTTP/1.1
Host: BASEURL
Content-Type: application/json
Authorization: Bearer ....
```

```json
{
    "vesselReportType": "ARR",
    "reportDateLocal": "2024-08-02T02:58:00",
    "portCall": 6130402, //key from the response of the PortCall request
    "eventLogs": [
        {
            "key": 6130395, //key of the arrival event log from the response of the PortCall request
            "eventLogDate": "2024-08-02T02:58:00"
        }],
      "positionReportBunkers": [
        {
            "bunkerCategory": "FO", 
            "rob": 98
        }]
}
```

</details>


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://api.dataloy.com/api-release-8.12/user-guides/vessel-report/overview.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
