---
title: "Download one artifact of a building model through RES"
description: "Streams `model.obj`, `model.glb`, `model.city.json`, `model.dxf`, `model.mtl`, `manifest.json` or `model_package.zip` for a `buildingId` returned by `POST /res_api/3d/building_model`. Sent with `Content-Disposition: attachment`. 404 until the model has been generated. Accepts `?token=` so the URL works from a plain link or a Grasshopper HTTP fetch."
---

> Documentation Index
> Fetch the complete documentation index at: https://docs.aireon.ch/llms.txt
> Use this file to discover all available pages before exploring further.

Path: RES API (public) › Building3D

`GET /res_api/3d/building_model/file/{buildingId}/{file}`

Streams `model.obj`, `model.glb`, `model.city.json`, `model.dxf`, `model.mtl`, `manifest.json` or `model_package.zip` for a `buildingId` returned by `POST /res_api/3d/building_model`. Sent with `Content-Disposition: attachment`. 404 until the model has been generated. Accepts `?token=` so the URL works from a plain link or a Grasshopper HTTP fetch.

## Authentication

Requires one of the following:

- `ResApiToken`, apiKey, in header, header `token`
- `ResApiTokenQuery`, apiKey, in query

## Path parameters

- `buildingId` (`downloadBuildingModelFile.path.buildingId`; string, required)
  - pattern `^[a-f0-9]{64}$`
- `file` (`downloadBuildingModelFile.path.file`; string, required)
  - one of `"model.obj"`, `"model.glb"`, `"model.city.json"`, `"model.dxf"`, `"model.mtl"`, `"manifest.json"`, `"model_package.zip"`

## Query parameters

- `token` (`downloadBuildingModelFile.query.token`; string, optional)

## Code samples

### cURL

```bash
curl --request GET \
  --url 'https://res.aireon.ch/res_api/3d/building_model/file/<buildingId>/model.obj' \
  --header 'token: <token>'
```

### TypeScript

```typescript
const url = 'https://res.aireon.ch/res_api/3d/building_model/file/<buildingId>/model.obj';
const options = {method: 'GET', headers: {token: '<token>'}};

fetch(url, options)
  .then(res => res.json())
  .then(json => console.log(json))
  .catch(err => console.error(err));
```

### Python

```python
import requests

url = "https://res.aireon.ch/res_api/3d/building_model/file/<buildingId>/model.obj"

headers = {"token": "<token>"}

response = requests.get(url, headers=headers)

print(response.text)
```

## Responses

### 200

The artifact bytes (Content-Type as served by the 3D service: text/plain for OBJ, model/gltf-binary for GLB, application/json for CityJSON, application/zip for the package).

#### Example

```text
string
```

### 400

Invalid request.

#### Example

```json
{
  "error": "string",
  "message": "string"
}
```

- `error` (`downloadBuildingModelFile.response.400.error`; string, required): Human-readable error description.
- `message` (`downloadBuildingModelFile.response.400.message`; string, optional): Optional underlying error message.

### 401

Authentication missing or invalid.

#### Example

```json
{
  "error": "string",
  "message": "string"
}
```

- `error` (`downloadBuildingModelFile.response.401.error`; string, required): Human-readable error description.
- `message` (`downloadBuildingModelFile.response.401.message`; string, optional): Optional underlying error message.

### 403

Authenticated but not permitted.

#### Example

```json
{
  "error": "string",
  "message": "string"
}
```

- `error` (`downloadBuildingModelFile.response.403.error`; string, required): Human-readable error description.
- `message` (`downloadBuildingModelFile.response.403.message`; string, optional): Optional underlying error message.

### 404

Resource not found.

#### Example

```json
{
  "error": "string",
  "message": "string"
}
```

- `error` (`downloadBuildingModelFile.response.404.error`; string, required): Human-readable error description.
- `message` (`downloadBuildingModelFile.response.404.message`; string, optional): Optional underlying error message.

### 502

The 3D service is unreachable or answered with an error (its status and body are relayed in `upstream_status` / `upstream`).

#### Example

```json
{
  "error": "string",
  "upstream_status": 0,
  "upstream": null,
  "detail": "string"
}
```

- `error` (`downloadBuildingModelFile.response.502.error`; string, optional)
- `upstream_status` (`downloadBuildingModelFile.response.502.upstream_status`; integer, optional)
- `upstream` (`downloadBuildingModelFile.response.502.upstream`; unknown, optional)
- `detail` (`downloadBuildingModelFile.response.502.detail`; string, optional)

### 504

The 3D service did not answer within the proxy timeout.

#### Example

```json
{
  "error": "string",
  "detail": "string"
}
```

- `error` (`downloadBuildingModelFile.response.504.error`; string, optional)
- `detail` (`downloadBuildingModelFile.response.504.detail`; string, optional)


Source: https://docs.aireon.ch/res/download-building-model-file/index.md
