Skip to content
Suomi

Attach a photo to an inspection step

POST
/v1/projects/{projectId}/inspections/{inspectionId}/steps/{stepId}/viewpoints
Code sample: Shell / cURL
curl --request POST \
--url https://api.whatsbuilt.fi/v1/projects/2489E9AD-2EE2-8E00-8EC9-32D5F69181C0/inspections/2489E9AD-2EE2-8E00-8EC9-32D5F69181C0/steps/2489E9AD-2EE2-8E00-8EC9-32D5F69181C0/viewpoints \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '{ "photo_key": "example" }'

Upload it first with uploadFindingPhoto. The photo goes on the step’s finding as a viewpoint. A repeat with the same Idempotency-Key and body returns the first viewpoint with 200.

projectId
required
string format: uuid
inspectionId
required
string format: uuid

The inspection’s id from listInspections

stepId
required
string format: uuid

The template step’s id, step_id on the inspection’s step

idempotency-key
string
/^[\x21-\x7e]{1,255}$/

A repeat with the same key and body returns the first answer instead of writing again. Keys are per integration and project.

Media typeapplication/json

The body of createStepViewpoint.

object
photo_key
required

A key from uploadFindingPhoto, uploaded before this call

string
>= 1 characters <= 1024 characters

Example generated

{
"photo_key": "example"
}

The viewpoint an earlier call with the same Idempotency-Key created

Media typeapplication/json

A live viewpoint.

object
guid
required

The viewpoint.

string format: uuid
project_id
required

The project.

string format: uuid
topic_guid
required

Its topic.

string format: uuid
elements
required

The GlobalIds the viewpoint selects

Array<string>
point
required
One of:

A point on a storey, metres in the model’s coordinates (spec 054 §3.8)

object
x
required

Metres east.

number format: double
y
required

Metres north.

number format: double
z
required

Metres up.

number format: double
components
required

The BCF components as stored

object | null
camera
required

The BCF camera as stored

object | null
has_photo
required

Download it from getViewpointPhoto

boolean
photo_type
required

The photo’s type.

string | null
creation_author
required

Who created it.

string
creation_date
required

When it was created.

string
entered_later
required

True when recorded after the fact.

boolean
recorded_at
required

When it was recorded.

string | null
changed_at
required

The row’s change time.

string
deleted
required
boolean

Example

{
"deleted": false
}

The viewpoint

Media typeapplication/json

A live viewpoint.

object
guid
required

The viewpoint.

string format: uuid
project_id
required

The project.

string format: uuid
topic_guid
required

Its topic.

string format: uuid
elements
required

The GlobalIds the viewpoint selects

Array<string>
point
required
One of:

A point on a storey, metres in the model’s coordinates (spec 054 §3.8)

object
x
required

Metres east.

number format: double
y
required

Metres north.

number format: double
z
required

Metres up.

number format: double
components
required

The BCF components as stored

object | null
camera
required

The BCF camera as stored

object | null
has_photo
required

Download it from getViewpointPhoto

boolean
photo_type
required

The photo’s type.

string | null
creation_author
required

Who created it.

string
creation_date
required

When it was created.

string
entered_later
required

True when recorded after the fact.

boolean
recorded_at
required

When it was recorded.

string | null
changed_at
required

The row’s change time.

string
deleted
required
boolean

Example

{
"deleted": false
}

Invalid body, parameters or Idempotency-Key

Media typeapplication/json

The error body of every /v1 answer of 400 or more.

object
error
required

A sentence for people; it may change

string
code
required

Part of the contract

string
details

What the code names, where it names something

request_id
required

The X-Request-Id of the call

string

Example generated

{
"error": "example",
"code": "example",
"details": "example",
"request_id": "example"
}

Missing, malformed, expired or revoked token

Media typeapplication/json

The error body of every /v1 answer of 400 or more.

object
error
required

A sentence for people; it may change

string
code
required

Part of the contract

string
details

What the code names, where it names something

request_id
required

The X-Request-Id of the call

string

Example generated

{
"error": "example",
"code": "example",
"details": "example",
"request_id": "example"
}

INSUFFICIENT_SCOPE; INSUFFICIENT_PROJECT_ROLE when the project role the scopes give does not cover the write, or the project is not the integration’s; PUBLIC_API_DISABLED when the project’s owning organisation has turned the API off

Media typeapplication/json

The error body of every /v1 answer of 400 or more.

object
error
required

A sentence for people; it may change

string
code
required

Part of the contract

string
details

What the code names, where it names something

request_id
required

The X-Request-Id of the call

string

Example generated

{
"error": "example",
"code": "example",
"details": "example",
"request_id": "example"
}

No such project, inspection, element or step

Media typeapplication/json

The error body of every /v1 answer of 400 or more.

object
error
required

A sentence for people; it may change

string
code
required

Part of the contract

string
details

What the code names, where it names something

request_id
required

The X-Request-Id of the call

string

Example generated

{
"error": "example",
"code": "example",
"details": "example",
"request_id": "example"
}

RESOURCE_DELETED: what this Idempotency-Key created has since been deleted; details.id names it

Media typeapplication/json

The error body of every /v1 answer of 400 or more.

object
error
required

A sentence for people; it may change

string
code
required

Part of the contract

string
details

What the code names, where it names something

request_id
required

The X-Request-Id of the call

string

Example generated

{
"error": "example",
"code": "example",
"details": "example",
"request_id": "example"
}

IDEMPOTENCY_KEY_REUSED: the key was used with another body

Media typeapplication/json

The error body of every /v1 answer of 400 or more.

object
error
required

A sentence for people; it may change

string
code
required

Part of the contract

string
details

What the code names, where it names something

request_id
required

The X-Request-Id of the call

string

Example generated

{
"error": "example",
"code": "example",
"details": "example",
"request_id": "example"
}

RATE_LIMITED; wait for Retry-After seconds

Media typeapplication/json

The error body of every /v1 answer of 400 or more.

object
error
required

A sentence for people; it may change

string
code
required

Part of the contract

string
details

What the code names, where it names something

request_id
required

The X-Request-Id of the call

string

Example generated

{
"error": "example",
"code": "example",
"details": "example",
"request_id": "example"
}