Quickstart

Publishing a surface vessel to Lattice

Try the Lattice SDK by connecting Lattice environment and publishing a surface vessel entity.

Before you begin

Publish a track

To get started with Lattice, consider this scenario: a friendly drone with access to Lattice has picked up a new track that appears to be a surface vessel. To configure this drone to publish a track to Lattice as a new entity, do the following:

1

Retrieve an Authentication Token

Use your Lattice Client ID and Lattice Client Secret to get an access token from the server. This token has a lifetime of 30 minutes.

curl
$export ENVIRONMENT_TOKEN=$(
> curl -s --request POST "https://$LATTICE_ENDPOINT/api/v1/oauth/token" \
> --header "Anduril-Sandbox-Authorization: Bearer $SANDBOXES_TOKEN" \
> --header "Content-Type: application/x-www-form-urlencoded" \
> --data-urlencode "grant_type=client_credentials" \
> --data-urlencode "client_id=$LATTICE_CLIENT_ID" \
> --data-urlencode "client_secret=$LATTICE_CLIENT_SECRET" | \
> jq -r .access_token )
2

Define the entity

Copy the following entity JSON object and save it in a new file named entity.json. Replace the timestamp for expiryTime with a time in the future, and sourceUpdateTime with the current time:

entity.json
1{
2 "entityId": "QUICKSTART_ENTITY_ID",
3 "description": "Quickstart example",
4 "isLive": true,
5 "expiryTime": "<YYYY-MM-DDThh:mm:ssTZD>",
6 "aliases": {
7 "name": "Simulated Surface Vessel"
8 },
9 "milView": {
10 "disposition": "DISPOSITION_FRIENDLY",
11 "environment": "ENVIRONMENT_SURFACE"
12 },
13 "location": {
14 "position": {
15 "latitudeDegrees": 33.69447852698943,
16 "longitudeDegrees": -117.9173785693163,
17 "altitudeHaeMeters": 0
18 }
19 },
20 "ontology": {
21 "template": "TEMPLATE_TRACK",
22 "platformType": "Surface_Vessel",
23 "specificType": "N/A"
24 },
25 "provenance": {
26 "integrationName": "command_line_integration",
27 "dataType": "example_data_type",
28 "sourceUpdateTime": "<YYYY-MM-DDThh:mm:ssTZD>"
29 }
30}
3

Publish the entity to Lattice

From the same folder where you saved entity.json, use curl to publish the entity to Lattice:

curl
$curl --location \
>--request PUT "https://$LATTICE_ENDPOINT/api/v1/entities" \
>--header "content-type: application/json" \
>--header "authorization: Bearer $ENVIRONMENT_TOKEN" \
>--header "anduril-sandbox-authorization: Bearer $SANDBOXES_TOKEN" \
>--include \
>--data "@entity.json"
4

Verify the response

If the request is successful, you get a 200 status response with an empty body: {}.

Find the vessel in Lattice

To verify that your surface vessel was successfully published to Lattice, do the following:

1Open the Lattice UI.
2

Find the vessel in the Entity Explorer. Search by the vessel’s aliases.name to narrow the list:

Shows the Entity Explorer in the Lattice Developer Console.
3

Open the vessel to view its detail page, and confirm its location, name, and other components match the entity you published:

Shows the Simulated Surface Vessel's detail page in the Lattice Developer Console.

What’s next?