Add 3D viewing & CAD Download to your product pages


The most common request is to add 3D viewing and CAD download capabilities on a product page related to a part number. This documentation list the endpoints to be used to achieve that goal and the final result could look like the example below, knowing you can easily customize the User Interface (UI) to match your own graphical layout.

Here are the different endpoints you need to implement 3D viewing and CAD download capabilities on your product page:

1. Checking if 3D data is available or not for a given part number

To avoid requesting 3D data for a part number that does not exist in the TraceParts database, you have to use the PartNumber/Availability endpoint.

For the part vendors having an internal code, different from the public part number, to connect their data to TraceParts, please use the YourOwnCode/Availability endpoint.

2. Page design

With the Availability endpoints, you can build your page with the 3D viewer embedded, the drop-down list of CAD formats available for download, and the button to download the CAD file in the selected format.

2.1. Display of the 3D viewer

In the 3D viewer documentation, you have several display options to display or not the toolbars, to display the coordinate system, to start an automatic rotation of the model, and many more.

2.2. List of CAD formats

The list of CAD formats available for download is related to each part number. It is important to use the list provided with the Product/CadDataAvailability endpoint for each single part number and for its related language. If you use a unique list of CAD formats for all part numbers, you may experience some errors when requesting a format which is not available for one given part number.

Therefore, we advise you to use a drop-down list for the CAD formats instead of listing all of them with a download button for each. Please note that new CAD formats are regularly added and new labels may break the design of your page if you do not use a drop-down list.


Best practice


Not recommended

2.3. Create a user account

The download event is related to a user account. Before to use the endpoint to request a CAD file, the Account/SignUp endpoint must be used. In case the user account already exists in the TraceParts data, nothing will be updated.

2.3.1. Check the existence of a user account

Before to create a user account, the Account/CheckLogin endpoint can check if the email address is already registered in the TraceParts database. In this case, you do not need to create a user account. Even if you perform the user account creation, none of your data used in the Account/SignUp endpoint will update the data in the TraceParts database.

2.4. Downloading a CAD file

Once the user clicks on the Download icon for one given part number, you have to dynamically request the related CAD file thanks to the cadRequest and cadFileUrl endpoints.

Time to receive the URL to download the CAD file may vary depending on the availability or not of the file inside the TraceParts cache infrastructure.
When the cadFileUrl HTTP status code is a 204, it means the file creation is still in progress. We suggest you to add a loop mechanism calling cadFileUrl every 3 seconds until to have the HTTP status code 200, 4xx or 5xx.

The URL to the CAD file is temporary so for each single CAD download request, you have to call the cadRequest endpoint, even if the same combination of partNumber / cultureInfo / cadFormatId has already been requested previously.

Each CAD file download is linked to a user through his/her email address. It is your choice to provide the download service with your visitor email address or with a generic one, keeping in mind that download events inside TraceParts Analytics will then contain more or less detailed contact information.

Developer support

Please contact us for any problem, question or comment related to this content integration.