---
title: "Cesium Ion"
section: "Third party keys"
route: /thirdpartykeyscesiumion
account: {accountId}
bruce_api: https://{accountId}.api.nextspace.host
guardian_api: https://guardian.nextspace.host
---
# Cesium Ion

A Cesium Ion access token is saved under the program ID "CesiumIon". It is the key the 3D scene depends on most: terrain, several default base maps and location search all load through Cesium Ion.

In Operator it is the "Cesium Ion" field of the Third Party Keys panel. You can read about the record and its requests in [Third party keys](/thirdpartykeys).

## What it powers

In the web Navigator:

- Cesium World Terrain ("cesiumworldterrain"). Without Cesium Ion, a scene set to it renders flat terrain instead.
- The Bing Maps base maps ("bingmapsaerial", "bingmapsaerialwithlabels" and "bingmapsroads"), which load from Cesium Ion's world imagery.
- The "Cesium address" option of the search box, which uses Cesium Ion's geocoder. It is also the fallback when a "Google address" search fails.
- Cesium Ion tileset Menu Items that do not set their own token.
- Google Photorealistic 3D Tiles ("GooglePhotoTileset" Menu Items), which load through Cesium Ion when the account has its own "CesiumIon" key. Otherwise they need the "GooglePhotogrammetry" key, see Google.

In the Unreal Navigator, Cesium World Terrain and the Bing Maps and Mapbox base maps all load from Cesium Ion.

In the API, tileset generation ("ui.tileset/{tileset_id}/generate") and other processing jobs are given the key with their configuration.

## Cesium Ion proxy

Navigator does not call Cesium Ion directly. It sends Cesium Ion requests to the account's API at "proxy/cesium-ion/", and the API forwards each GET to "https://api.cesium.com/" with the same path and query, replacing any "access_token" query value with the account's key.

## Set the key

Save the Cesium Ion access token under "CesiumIon".

### Set the Cesium Ion key

```http
POST https://{accountId}.api.nextspace.host/programkey
```

**Requires:**

- Account ID: Account ID must be specified in the subdomain of the request url.
- Logged in user auth token: A token for an active user session on the account, sent as "Authorization: Bearer <token>".

| Parameter | In | Required | Description |
| --- | --- | --- | --- |
| `{accountId}` | path | yes | The account id of the account to perform the request on. |

**Example request body**

```json
{
    "ProgramId": "CesiumIon",
    "Key": "your-cesium-ion-access-token"
}
```

**Response**

```typescript
// The response is the saved Program Key record.
```

**Javascript example**

```javascript
const url = "https://{accountId}.api.nextspace.host/programkey";
const method = "post";
const token = "your-token";
const body = {
    "ProgramId": "CesiumIon",
    "Key": "your-cesium-ion-access-token"
};

async function doRequest(type, url, body, token) {
    const headers = {
        "Authorization": `Bearer ${token}`,
        "Content-Type": "application/json"
    };
    const options = {
        method: type,
        headers: headers,
        body: body ? JSON.stringify(body) : null
    };
    const res = await fetch(url, options);
    const json = await res.json();
    return json;
}

doRequest(method, url, body, token).then((res) => {
    console.log(res);
}).catch((err) => {
    console.error(err);
});
```

---

Urls on this page are resolved for account `{accountId}`.
Site index: https://docs.nextspace.host/llms.txt · whole site in one file: https://docs.nextspace.host/llms-full.txt
Human-readable version of this page: https://docs.nextspace.host/thirdpartykeyscesiumion
