Getting from scan to insights
This section explains how to sequence the API calls in order to get your first 3d scan completed
Last updated
This section explains how to sequence the API calls in order to get your first 3d scan completed
Last updated
To get from scan to insights for the first time, four key steps are necessary: (1) creating a user, (2) initiating a scan capture, (3) getting a 3D body model reconstruction done and (4) finally requesting the desired type of insight.
Please note that to guarantee user privacy, every time a new user is created, Prism Labs only stores the bare minimum amount of information necessary to accurately process captured data. Any additional demographic data, beyond what Prism Labs stores, will be left for partners to decide what and where to store it.
Below you can find the API flow in more detail necessary to go from scan to insights. The full list of endpoints and methods available is summarized in API endpoints section.
1. Create a new user in the Prism Labs cloud
The first step is to create a new user so that scan capture data can be associated with that user. The data required for user creation is sex, region, birth year, and weight. When a user is registered in Prism, the API will return a user ID that should be associated with the user in the partner’s system and used to request new scans. It is also expected that whenever there is a change in the user’s data, for example, if a user’s weight changes, a partner should use the user update endpoint to keep the data accurate in the Prism Labs’ cloud.
2. Initiate scan and upload capture data
Once a user is created, a partner is ready to make a scan. A scan represents a single session of capture data that can be processed by the pipeline to produce the assets listed in the previous section.
To create a scan, a partner needs to use the scan creation endpoint to register a new scan in the system, providing the intended user to be scanned and the device that will capture the data (both should already be registered in the Prism API). This signals the intent to upload capture data that will subsequently be processed by the Prism pipeline. Creating a new scan returns a scan ID that will be used in all subsequent requests involving the scan.
The next step is to zip together relevant scan capture data coming from the scanning device and upload it to the API. The data should include a series of PNG files and a file representing the intrinsics of the capture device (sample scan capture data zip packages can be found here). The data must be uploaded to a URL that is generated by Prism API (this same process will be used when downloading assets later on). The partner should call the API endpoint that generates these short-lived URLs. The capture data ZIP file should then be uploaded to this URL. Prism’s system will automatically validate and process the ZIP file once it is done uploading.
3. Generate 3D body model reconstruction
After the captured data is uploaded and validated successfully, a partner needs to start the 3D body reconstruction using a POST request to the body API. The progress of this process can currently be monitored by webhooks that notify a partner’s platform when assets are ready.
When the pipeline completes the reconstruction, the newly created original 3D body model asset can be downloaded from the system. This process is the same as the upload scan capture data: first, a partner must request a download URL to be generated, and then that URL can be used to fetch a ZIP file with the generated assets.
Finally, when the original scan body asset is generated, the system will automatically generate a canonicalized body model (see Body Insights & Assets above for details), which is a necessary step since other insights depend on it. This canonicalized 3D body model is currently not a downloadable asset but can be made available upon request. The progress can be monitored in a similar manner to the original scan body asset. Note that any errors, for example, bad data, an invalid format, etc., will result in the status indicating a failure state.
4. Request insights and assets
In order to request the various available insights for a scan, both the original scan body and canonicalized body assets must already have been generated (see step above).
Once completed, a partner can request insights by sending a POST request with a scan ID to an insights endpoint (for example, /measurements). This will initiate the pipeline to generate the desired insights. Multiple insights per scan can be initiated simultaneously. The process can be monitored in the same way as in the previous steps, and after completion, the insights & assets can be downloaded after first requesting a download URL. Similar to the 3D body model endpoints, any errors will result in the status turning to a failure state.