Skip to content
getgeolens.com

Preview Service Layer

POST
/services/preview/
curl --request POST \
--url https://example.com/api/services/preview/ \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '{ "url": "example", "service_type": "example", "layer_name": "example", "layer_title": "example", "layer_id": 1, "token": "example", "object_id_field": "example" }'

Preview a selected remote layer via ogrinfo and create a pending IngestJob.

Validates the URL against SSRF, builds the GDAL driver source string, runs ogrinfo to extract metadata and sample rows, then creates an IngestJob ready for the existing commit flow.

Media type application/json
ServicePreviewRequest
object
url
required
Url

Normalized service URL from a previous probe response.

string
>= 1 characters <= 2048 characters
service_type
required
Service Type

Service type from the probe response, e.g. ‘WFS 2.0.0’ or ‘ArcGIS FeatureServer’.

string
>= 1 characters <= 100 characters
layer_name
required
Layer Name

Name of the specific layer to preview, from the probe layers list.

string
>= 1 characters <= 500 characters
layer_title
Any of:
string
<= 500 characters
layer_id
Any of:
integer
token
Any of:
string
<= 1000 characters
object_id_field
Any of:
string
<= 200 characters
Example generated
{
"url": "example",
"service_type": "example",
"layer_name": "example",
"layer_title": "example",
"layer_id": 1,
"token": "example",
"object_id_field": "example"
}

Successful Response

Media type application/json
ServicePreviewResponse
object
job_id
required
Job Id

IngestJob ID for the preview. Use this to commit the import.

string format: uuid
source_filename
required
Any of:
string
columns
required
Columns

Detected attribute columns: [{‘name’: str, ‘type’: str}, …].

Array<object>
object
key
additional properties
string
crs
required
Any of:
integer
geometry_type
required
Any of:
string
feature_count
required
Any of:
integer
sample_rows
required
Sample Rows

Up to 5 sample rows for preview display.

Array<object>
object
key
additional properties
any
layer_name
required
Layer Name

Layer name as it appears in the remote service.

string
Example generated
{
"job_id": "2489E9AD-2EE2-8E00-8EC9-32D5F69181C0",
"source_filename": "example",
"columns": [
{
"additionalProperty": "example"
}
],
"crs": 1,
"geometry_type": "example",
"feature_count": 1,
"sample_rows": [
{}
],
"layer_name": "example"
}

Validation Error

Media type application/json
HTTPValidationError
object
detail
Detail
Array<object>
ValidationError
object
loc
required
Location
Array
msg
required
Message
string
type
required
Error Type
string
input
Input
ctx
Context
object
Example generated
{
"detail": [
{
"loc": [
"example"
],
"msg": "example",
"type": "example",
"input": "example",
"ctx": {}
}
]
}