source_id).source_id already exists, it will be updated. Otherwise a new spot is created.
data.attributes
| Name | Required | Type | Info |
|---|---|---|---|
topic_id |
true | INTEGER | The topic id: 37 for CoastSnap |
source_id |
true | TEXT | An external unique identifier. If this endpoint is called with the same source_id again, the existing spot will be updated instead of creating a new one. |
root_id |
INTEGER | The id of the parent spot. Required when creating a spot update. | |
latitude |
true | FLOAT | Latitude of the spot location. e.g. 48.205154 |
longitude |
true | FLOAT | Longitude of the spot location. e.g. 16.358003 |
state |
INTEGER |
The state of the spot: 1 = active 2 = in_progress (required when spot has gallery fields that are not yet fully uploaded) Defaults to 1 (active) if not provided. |
|
privacy_type |
INTEGER |
0 = public 1 = private Defaults to 0 (public). |
|
… |
MIXED | Additional topic-specific fields. See Spot attributes and values for all available fields for this topic. |
curl -X POST "https://www.spotteron.com/api/v2.4/spots/import" \
-H "Authorization: Bearer <TOKEN>" \
-H "Content-Type: application/json" \
-H "Accept: application/vnd.api+json" \
-d '{
"data": {
"type": "spots",
"attributes": {
"topic_id": 37,
"source_id": "my-external-id-001",
"latitude": 48.2093723,
"longitude": 16.356099
}
}
}'
{
"data": {
"id": 123
}
}
state is 2 (in_progress) and gallery fields are pending:
{
"data": {
"id": 123,
"attributes": {
"fld_21_000001": 123456,
"state": 2
}
}
}
The attributes object contains the gallery field names with the assigned gallery ids. Use these gallery ids to upload media via the POST /galleries/{id}/media endpoint.