Skip to content
getgeolens.com

Preview Service Layer

POST
/services/preview/
curl --request POST \
--url https://example.com/services/preview/ \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '{ "layer_id": 1, "layer_name": "example", "layer_title": "example", "object_id_field": "example", "service_type": "example", "token": "example", "url": "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
layer_id
Any of:
integer
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
object_id_field
Any of:
string
<= 200 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
token
Any of:
string
<= 1000 characters
url
required
Url

Normalized service URL from a previous probe response.

string
>= 1 characters <= 2048 characters
Example generated
{
"layer_id": 1,
"layer_name": "example",
"layer_title": "example",
"object_id_field": "example",
"service_type": "example",
"token": "example",
"url": "example"
}

Successful Response

Media type application/json
ServicePreviewResponse
object
columns
required
Columns

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

Array<object>
object
key
additional properties
string
crs
required
Any of:
integer
feature_count
required
Any of:
integer
geometry_type
required
Any of:
string
job_id
required
Job Id

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

string format: uuid
layer_name
required
Layer Name

Layer name as it appears in the remote service.

string
sample_rows
required
Sample Rows

Up to 5 sample rows for preview display.

Array<object>
object
key
additional properties
any
source_filename
required
Any of:
string
Example generated
{
"columns": [
{
"additionalProperty": "example"
}
],
"crs": 1,
"feature_count": 1,
"geometry_type": "example",
"job_id": "2489E9AD-2EE2-8E00-8EC9-32D5F69181C0",
"layer_name": "example",
"sample_rows": [
{}
],
"source_filename": "example"
}

Bad request — invalid payload

ProblemDetail
object
detail
required
Detail
string
status
required
Status
integer
title
required
Title
string
type
Type
string
default: about:blank
Example
{
"type": "about:blank"
}

Unauthorized — missing or invalid credentials

ProblemDetail
object
detail
required
Detail
string
status
required
Status
integer
title
required
Title
string
type
Type
string
default: about:blank
Example
{
"type": "about:blank"
}

Forbidden — caller lacks write access

ProblemDetail
object
detail
required
Detail
string
status
required
Status
integer
title
required
Title
string
type
Type
string
default: about:blank
Example
{
"type": "about:blank"
}

Not found

ProblemDetail
object
detail
required
Detail
string
status
required
Status
integer
title
required
Title
string
type
Type
string
default: about:blank
Example
{
"type": "about:blank"
}

Conflict — resource state prevents the operation

ProblemDetail
object
detail
required
Detail
string
status
required
Status
integer
title
required
Title
string
type
Type
string
default: about:blank
Example
{
"type": "about:blank"
}

Validation error

ProblemDetail
object
detail
required
Detail
string
status
required
Status
integer
title
required
Title
string
type
Type
string
default: about:blank
Example
{
"type": "about:blank"
}

Internal server error

ProblemDetail
object
detail
required
Detail
string
status
required
Status
integer
title
required
Title
string
type
Type
string
default: about:blank
Example
{
"type": "about:blank"
}