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

Media type application/problem+json
ProblemDetail
object
detail
required
Any of:
string
status
required
Status
integer
title
required
Title
string
type
Type
string
default: about:blank
Example
{
"detail": "Dataset not found",
"status": 404,
"title": "Not Found",
"type": "about:blank"
}

Unauthorized — missing or invalid credentials

Media type application/problem+json
ProblemDetail
object
detail
required
Any of:
string
status
required
Status
integer
title
required
Title
string
type
Type
string
default: about:blank
Example
{
"detail": "Dataset not found",
"status": 404,
"title": "Not Found",
"type": "about:blank"
}

Forbidden — caller lacks write access

Media type application/problem+json
ProblemDetail
object
detail
required
Any of:
string
status
required
Status
integer
title
required
Title
string
type
Type
string
default: about:blank
Example
{
"detail": "Dataset not found",
"status": 404,
"title": "Not Found",
"type": "about:blank"
}

Not found

Media type application/problem+json
ProblemDetail
object
detail
required
Any of:
string
status
required
Status
integer
title
required
Title
string
type
Type
string
default: about:blank
Example
{
"detail": "Dataset not found",
"status": 404,
"title": "Not Found",
"type": "about:blank"
}

Conflict — resource state prevents the operation

Media type application/problem+json
ProblemDetail
object
detail
required
Any of:
string
status
required
Status
integer
title
required
Title
string
type
Type
string
default: about:blank
Example
{
"detail": "Dataset not found",
"status": 404,
"title": "Not Found",
"type": "about:blank"
}

Validation error

Media type application/problem+json
ProblemDetail
object
detail
required
Any of:
string
status
required
Status
integer
title
required
Title
string
type
Type
string
default: about:blank
Example
{
"detail": "Dataset not found",
"status": 404,
"title": "Not Found",
"type": "about:blank"
}

Too many requests — retry after the advertised interval

Media type application/problem+json
ProblemDetail
object
detail
required
Any of:
string
status
required
Status
integer
title
required
Title
string
type
Type
string
default: about:blank
Example
{
"detail": "Dataset not found",
"status": 404,
"title": "Not Found",
"type": "about:blank"
}
Retry-After
integer

Seconds until the request may be retried

Internal server error

Media type application/problem+json
ProblemDetail
object
detail
required
Any of:
string
status
required
Status
integer
title
required
Title
string
type
Type
string
default: about:blank
Example
{
"detail": "Dataset not found",
"status": 404,
"title": "Not Found",
"type": "about:blank"
}

Service unavailable — the database could not serve the request

Media type application/problem+json
ProblemDetail
object
detail
required
Any of:
string
status
required
Status
integer
title
required
Title
string
type
Type
string
default: about:blank
Example
{
"detail": "Dataset not found",
"status": 404,
"title": "Not Found",
"type": "about:blank"
}