# Prism Hosted API

#### Prism Hosted API

Welcome to the Prism Hosted API.

[Prism Labs](https://www.prismlabs.tech/) provides mobile 3D body scanning and body composition tracking.\
Use this API to personalize your product with body insights such as body fat and lean mass percentage, body circumference measurements, metabolic age, and body roundness index.\
With a simple 10-second spin in front of a mobile phone, you can personalize your users’ weight loss journeys or workout plans.

Use this API to:

* Create and manage users
* Create and manage body scans
* Access 3D assets
* Fetch body composition metrics and health reports
* Create Future Me predictions
* Access Future Me prediction assets

***

#### Getting started

{% stepper %}
{% step %}

#### Set up an introduction call

Set up an [introduction call](https://www.prismlabs.tech/contact) with us to exchange information, discuss use cases, and talk about pricing.
{% endstep %}

{% step %}

#### Kick off paperwork

Sign the API evaluation agreement, MNDA, and DPA.
{% endstep %}

{% step %}

#### Integration kick-off call

Align on your ideal outcome, learn about Prism integration pathways (native or web), and refine your use case and integration architecture.
{% endstep %}

{% step %}

#### Begin integration

We will provide your sandbox API key.\
During your integration we will assist you with any technical or product questions.
{% endstep %}

{% step %}

#### Integration checkpoints

Review [consent screens](https://www.notion.so/2ce8ef4535c78002bbd9e90adcc2ddb0?pvs=25) to fulfill legal requirements.
{% endstep %}

{% step %}

#### Pre-launch check

After all contracts are fully signed and consent screens are approved, we will provide your production API key and you can switch over to production.
{% endstep %}
{% endstepper %}

***

#### Integration

**API URLs**

{% tabs %}
{% tab title="Production" %}
**Production URL**\
<https://api.hosted.prismlabs.tech>
{% endtab %}

{% tab title="Sandbox" %}
**Sandbox URL**\
<https://sandbox-api.hosted.prismlabs.tech>
{% endtab %}
{% endtabs %}

***

**API Headers**

For all API calls the following headers are required:

```http
content-type: application/json
accept: application/json;v=1
authorization: Bearer {{API_KEY}}
```

Replace {{API\_KEY}} with your Prism API key for the selected environment.

***

**API happy flow**

{% stepper %}
{% step %}

#### Create a user

`POST /users`
{% endstep %}

{% step %}

#### Initiate scan

`POST /scans`
{% endstep %}

{% step %}

#### Get upload URL

`POST /scans/{scanId}/upload-url`
{% endstep %}

{% step %}

#### Upload capture data

`PUT {upload-url}`
{% endstep %}

{% step %}

#### Check scan status

`GET /scans/{scanId}`
{% endstep %}

{% step %}

#### Fetch assets and body metrics for scan

`GET /scans/{scanId}/asset-urls`\
`GET /scans/{scanId}/measurements`\
`GET /scans/{scanId}/bodyfat`\
`GET /scans/{scanId}/health-report`
{% endstep %}

{% step %}

#### (Optional) Initiate Future Me (body shape prediction)

`POST /body-shape-prediction`
{% endstep %}

{% step %}

#### (Optional) Check Future Me status

`GET /body-shape-prediction/{bodyShapePredictionId}`
{% endstep %}

{% step %}

#### (Optional) Fetch assets and metrics for Future Me

`GET /body-shape-prediction/{bodyShapePredictionId}/asset-urls`
{% endstep %}
{% endstepper %}
