# Data Forwarding

Set up optional custom delivery endpoints to get a POST request any time one of your Spotters generates new data.&#x20;

You can configure and manage your delivery endpoints in the [Spotter Dashboard](https://spotter.sofarocean.com/api). To add a new delivery endpoint, click the menu icon ☰ and select **Sofar API**, then under **Delivery Endpoints**, enter the URL path in the **New Delivery Endpoint** field and click the **Add Endpoint** button. All of your delivery endpoints will be listed there. To remove one, click the corresponding **Remove** button.

Any new data will be included in the JSON body of the POST request. The content and structure will vary based on the Spotter's operating mode and configuration.&#x20;

## Examples

{% tabs %}
{% tab title="Request Body: Waves Mode" %}
{% hint style="info" %}
`frequencyData` is only transmitted in **Waves: Spectrum** mode or **HDR** mode, and `partitionData` is only transmitted in **Waves: Partition** mode or **HDR** mode.
{% endhint %}

{% code expandable="true" %}

```json
{
    "data": {
        "spotterId": "SPOT-0018",
        "spotterName": "Mavericks 2",
        "payloadType": "waves",
        "batteryVoltage": 4.07,
        "batteryPower": -0.41,
        "solarVoltage": 0.0,
        "humidity": 32.8,
        "waves": [
            {
                "significantWaveHeight": 1.14,
                "peakPeriod": 9.3,
                "meanPeriod": 8.3,
                "peakDirection": 302.3,
                "peakDirectionalSpread": 42.11,
                "meanDirection": 286.2,
                "meanDirectionalSpread": 56.16,
                "timestamp": "2017-11-08T07:06:57.000Z",
                "latitude": 34.30115,
                "longitude": -120.6133
            },
            {
                "significantWaveHeight": 1.14,
                "peakPeriod": 10.24,
                "meanPeriod": 8.44,
                "peakDirection": 312.28,
                "peakDirectionalSpread": 37.07,
                "meanDirection": 284.18,
                "meanDirectionalSpread": 57.4,
                "timestamp": "2017-11-08T07:36:57.000Z",
                "latitude": 34.29883,
                "longitude": -120.61127
            }
        ],
        "track": [
            {
                "timestamp": "2017-11-08T07:06:57.000Z",
                "latitude": 34.30115,
                "longitude": -120.6133
            },
            {
                "timestamp": "2017-11-08T07:36:57.000Z",
                "latitude": 34.2988333,
                "longitude": -120.6112667
            }
        ],
        "frequencyData": [
            {
                "frequency": [0.02930,0.03906,0.04883,...],
                "df": [0.00977, 0.00977, 0.00977,...],
                "a1": [-0.097752, -0.095797, -0.054741,...],
                "b1": [-0.054741, 0.021505, 0.073314,...],
                "a2": [0.120235, 0.115347, -0.018573,...],
                "b2": [0.414467, 0.180841, 0.184751,...],
                "varianceDensity": [0.7111054247697032, 0.6186233367451381, 0.6411207778915046,...],
                "direction": [335.6588548979852, 338.1985905136482, 269.8174396209903,...],
                "directionalSpread": [79.181787169671, 74.12281945451112, 67.45630665882223,...],
                "timestamp": "2017-10-12T13:28:40.000Z",
                "latitude": 35.19229,
                "longitude": -120.86748
            }
        ],
        "partitionData": [
            {
                "partitions": [
                    {
                        "startFrequency": 0.025,
                        "endFrequency": 0.078125,
                        "significantWaveHeight": 0.69,
                        "meanPeriod": 15.38,
                        "meanDirection": 240.014,
                        "meanDirectionalSpread": 29.828
                    },
                    {
                        "startFrequency": 0.078125,
                        "endFrequency": 0.8,
                        "significantWaveHeight": 0.97,
                        "meanPeriod": 8.58,
                        "meanDirection": 251.647,
                        "meanDirectionalSpread": 29.645
                    }
                ],
                "location": {
                    "latitude": 35.19229,
                    "longitude": -120.86748,
                    "timestamp": "2017-10-12T13:28:40.000Z"
                }
            }
        ],
        "wind": [
          {
            "speed": 1,
            "direction": 171,
            "location": {
                "latitude": 37.8973,
                "longitude": -122.6868833,
                "timestamp": "2019-08-09T20:14:54.000Z"
              },
              "seasurfaceId": 1
          }
        ],
        "surfaceTemp": [
            {
                "degrees": 14.44,
                "location": {
                    "latitude": 37.7733,
                    "longitude": -122.3861833,
                    "timestamp": "2019-11-05T19:34:31.000Z"
                }
            }
        ],
        ...
    }
}
```

{% endcode %}
{% endtab %}

{% tab title="Request Body: Track Mode" %}
{% hint style="info" %}
The `track` property represents a Spotter's location, ordered by `timestamp` values.
{% endhint %}

{% code expandable="true" %}

```json
{
    "data": {
        "spotterId": "SPOT-0018",
        "spotterName": "Mavericks 2",
        "payloadType": "track",
        "batteryVoltage": 4.13,
        "batteryPower": -0.03,
        "solarVoltage": 7,
        "humidity": 9.6,
        "waves": [],
        "track": [
            {
                "timestamp": "2017-09-27T22:41:27.000Z",
                "latitude": 34.777083,
                "longitude": -120.7396172
            },
            { 
                "timestamp": "2017-09-27T22:44:27.000Z",
                "latitude": 34.7769077,
                "longitude": -120.7390585
            },
            { 
                "timestamp": "2017-09-27T22:47:27.000Z",
                "latitude": 34.776726,
                "longitude": -120.7385352
            },
            { 
                "timestamp": "2017-09-27T22:50:27.000Z",
                "latitude": 34.7765415,
                "longitude": -120.7380058
            },
            { 
                "timestamp": "2017-09-27T22:53:27.000Z",
                "latitude": 34.7763545,
                "longitude": -120.7375838
            }
        ],
        "frequencyData": [],
        "partitionData": [],
        "wind": []
    }
}

```

{% endcode %}
{% endtab %}

{% tab title="Request Body: Smart Mooring" %}
{% hint style="info" %}

* The `sensorPosition` property represents a sensor's physical position in the Smart Mooring relative to the Spotter, with **`1`** being closest to the Spotter.&#x20;
* The `data_type_name` property represents the type of information being sent by a sensor, as ingested by the API.&#x20;
* Timestamps within this data format, while ordered, are not necessarily unique. It is possible for two or more sensors to send different values with identical timestamps (e.g., a temperature sensor and a pressure sensor may both emit data at the same time).
  {% endhint %}

{% code expandable="true" %}

```json
{
    "data": {
        "spotterId": "SPOT-0018",
        "spotterName": "Mavericks 2",
        "payloadType": "sensorData",
        "batteryVoltage": 4.13,
        "batteryPower": -0.03,
        "solarVoltage": 7,
        "humidity": 9.6,
        "sensorData": [
            {
                "latitude": 37.7733833,
                "longitude": -122.38715,
                "timestamp": "2020-12-01T23:46:43.000Z",
                "sensorPosition": 2,
                "units": "μbar",
                "value": 1020490,
                "unit_type": "pressure",
                "data_type_name": "rbrcoda3_meanpressure_21bits"
            },
            {
                "latitude": 37.7733833,
                "longitude": -122.38715,
                "timestamp": "2020-12-01T23:46:43.000Z",
                "sensorPosition": 2,
                "units": "μbar",
                "value": 100,
                "unit_type": "pressure",
                "data_type_name": "rbrcoda3_stdevpressure_15bits"
            },
            {
                "latitude": 37.7733833,
                "longitude": -122.38715,
                "timestamp": "2020-12-01T23:46:43.000Z",
                "sensorPosition": 2,
                "units": "°C",
                "value": 13.426700000000004,
                "unit_type": "temperature",
                "data_type_name": "rbrcoda3_meantemperature_20bits"
            },
            {
                "latitude": 37.7733833,
                "longitude": -122.38715,
                "timestamp": "2020-12-02T00:01:43.000Z",
                "sensorPosition": 2,
                "units": "μbar",
                "value": 1020390,
                "unit_type": "pressure",
                "data_type_name": "rbrcoda3_meanpressure_21bits"
            },
            {
                "latitude": 37.7733833,
                "longitude": -122.38715,
                "timestamp": "2020-12-02T00:01:43.000Z",
                "sensorPosition": 2,
                "units": "μbar",
                "value": 50,
                "unit_type": "pressure",
                "data_type_name": "rbrcoda3_stdevpressure_15bits"
            },
            {
                "latitude": 37.7733833,
                "longitude": -122.38715,
                "timestamp": "2020-12-02T00:01:43.000Z",
                "sensorPosition": 2,
                "units": "°C",
                "value": 15.081299999999999,
                "unit_type": "temperature",
                "data_type_name": "rbrcoda3_meantemperature_20bits"
            }
        ]
    }
}
```

{% endcode %}
{% endtab %}
{% endtabs %}
