Upsert area
const url = 'https://portal.staging.arago-tech.com/geo/areas';const options = { method: 'PUT', headers: {Authorization: '<Authorization>', 'Content-Type': 'application/json'}, body: '{"id":"63e2d42a27ad5f2b345ca123","tags":["tag1","tag2"],"name":"Area 1","geo_json":{"coordinates":[[[30,10],[40,40],[20,40],[10,20],[30,10]]],"type":"Polygon"}}'};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}curl --request PUT \ --url https://portal.staging.arago-tech.com/geo/areas \ --header 'Authorization: <Authorization>' \ --header 'Content-Type: application/json' \ --data '{ "id": "63e2d42a27ad5f2b345ca123", "tags": [ "tag1", "tag2" ], "name": "Area 1", "geo_json": { "coordinates": [ [ [ 30, 10 ], [ 40, 40 ], [ 20, 40 ], [ 10, 20 ], [ 30, 10 ] ] ], "type": "Polygon" } }'Creates or updates a geo area
Authorizations
Section titled “Authorizations”Request Body
Section titled “Request Body”The request to upsert an area
The request to upsert an area
object
The area unique identifier. If not provided, a new area will be created.
Example
63e2d42a27ad5f2b345ca123The tags associated with the area (max 10 items, each tag must be between 3 and 255 characters). Each tag must not contain only whitespace (NOT_BLANK). Tags are not trimmed.
Example
[ "tag1", "tag2"]The name of the area. Must not contain only whitespace (NOT_BLANK). Length is checked before surrounding whitespace is trimmed on write; the response returns the stored name.
Example
Area 1The GeoJSON representation of the area. The total area must be at least the size of an S2 cell at level 10 (approximately 48 km² minimum).
object
The GeoJSON object type
Example
FeatureCollectionThe list of GeoJSON features
A GeoJSON feature object
object
The GeoJSON feature type
Example
FeatureThe properties of the GeoJSON feature
object
Example
{ "name": "Area 1"}The bounding box of the GeoJSON feature
Example
[ 100, 0, 105, 1]The geometry of the GeoJSON feature. Accepts Polygon or MultiPolygon types.
object
Example
{ "coordinates": [ [ [ 30, 10 ], [ 40, 40 ], [ 20, 40 ], [ 10, 20 ], [ 30, 10 ] ] ], "type": "Polygon"}The bounding box of the GeoJSON object
Example
[ 100, 0, 105, 1]Example
{ "coordinates": [ [ [ 30, 10 ], [ 40, 40 ], [ 20, 40 ], [ 10, 20 ], [ 30, 10 ] ] ], "type": "Polygon"}Responses
Section titled “ Responses ”A successful response.
object
object
The area unique identifier. If not provided, a new area will be created.
The name of the area
The tags associated with the area
The unique identifiers of the geometries associated with the area
The date and time when the area was created
The date and time when the area was last updated
Example
{ "area": { "id": "63e2d42a27ad5f2b345ca123", "name": "Area 1", "tags": [ "tag1", "tag2" ], "geometry_ids": [ "63e2d42a27ad5f2b345ca123", "63e2d42a27ad5f2b345ca124" ], "created_at": "2021-01-01T00:00:00Z", "updated_at": "2021-01-01T00:00:00Z" }}Bad request
object
Example
{ "error": { "code": "BAD_REQUEST", "details": [ { "code": "MAX_ITEMS", "field": "line_items", "message": "value must contain no more than 3000 item(s)", "params": { "max": "3000" } } ], "message": "Bad request" }}Unauthorized
object
Example
{ "error": { "code": "UNAUTHORIZED", "message": "Unauthorized" }}Internal server error
object
Example
{ "error": { "code": "INTERNAL_ERROR", "message": "Internal server error" }}default
Section titled “default”An unexpected error response.
object
object
Examplegenerated
{ "code": 1, "message": "example", "details": [ { "@type": "example" } ]}