Skip to content

What the judge would read for one row under a mapping, and the checks for the whole sheet

POST
/v1/imports/{import_id}/preview
curl --request POST \
--url https://api.supposing.app/v1/imports/2489E9AD-2EE2-8E00-8EC9-32D5F69181C0/preview \
--header 'Content-Type: application/json' \
--data '{ "sheet": "example", "mapping": { "id_field": "example", "title_field": "example", "text_fields": [ "example" ], "metadata_fields": [ "example" ] }, "row": 1, "rows": [ 1 ] }'
import_id
required
Import Id
string format: uuid
Media typeapplication/json
ImportRowPreviewIn
object
sheet
Sheet
Any of:
string
mapping
required
ImportMapping

Which columns become what. The judge reads only text_fields; columns in no list are dropped.

object
id_field
Id Field

Your ID for each row (kept as source_id).

Any of:
string
title_field
Title Field

The title people see. Defaults to id_field.

Any of:
string
text_fields
required
Text Fields

What the judge reads, in order; with more than one, each is under a ‘## ’ heading.

Array<string>
metadata_fields
Metadata Fields

Kept for people, never shown to the judge.

Array<string>
row
Row

Data row, 1 for the first row under the header.

integer
default: 1 >= 1
rows
Rows

More rows to preview at once (up to 50); returned in items.

Array<integer>
<= 50 items

Successful Response

Media typeapplication/json
ImportRowPreview

One row under a mapping (plus any others asked for in rows), and the checks for the whole sheet.

object
row
required
Row
integer
source_id
required
Source Id
Any of:
string
title
required
Title
string
text
required
Text

Exactly the text the judge would read for this row. The title is not in it unless its column is one of the text_fields.

string
words
required
Words
integer
hidden
required
Hidden

The row’s ID, title and metadata: kept for people, never judged.

object
key
additional properties
string
n_rows
required
N Rows
integer
items
required
Items

The rows asked for in rows, in order.

Array<object>
ImportRowText
object
row
required
Row
integer
source_id
required
Source Id
Any of:
string
title
required
Title
string
text
required
Text

Exactly the text the judge would read for this row. The title is not in it unless its column is one of the text_fields.

string
words
required
Words
integer
hidden
required
Hidden

The row’s ID, title and metadata: kept for people, never judged.

object
key
additional properties
string
checks
required
Checks
Array<object>
ImportCheck
object
kind
required
Kind
string
Allowed values: duplicate_ids duplicate_titles personal_hidden empty_text too_long duplicate_texts
tone
required
Tone
string
Allowed values: bad warn good
message
required
Message
string
rows
required
Rows

Data rows it is about, 1 for the first row under the header.

Array<integer>

Example

{
"checks": [
{
"kind": "duplicate_ids",
"tone": "bad"
}
]
}

Client error. Branch on code; show message and hint.

Media typeapplication/json
Error

The body of every non-2xx response.

object
code
required
Code

Stable machine-readable code, e.g. dataset_not_found.

string
message
required
Message
string
hint
Hint

What to do next.

Any of:
string
details
Details

Per-field problems, for invalid_request.

Any of:
Array<object>
ErrorDetail
object
field
required
Field

Dotted path to the field, e.g. ranking.rubric.

string
message
required
Message
string

Example generated

{
"code": "example",
"message": "example",
"hint": "example",
"details": [
{
"field": "example",
"message": "example"
}
]
}

Server error.

Media typeapplication/json
Error

The body of every non-2xx response.

object
code
required
Code

Stable machine-readable code, e.g. dataset_not_found.

string
message
required
Message
string
hint
Hint

What to do next.

Any of:
string
details
Details

Per-field problems, for invalid_request.

Any of:
Array<object>
ErrorDetail
object
field
required
Field

Dotted path to the field, e.g. ranking.rubric.

string
message
required
Message
string

Example generated

{
"code": "example",
"message": "example",
"hint": "example",
"details": [
{
"field": "example",
"message": "example"
}
]
}