Learn in this article how you can set-up 3D model upload through the SynergyXR content API.
SynergyXR – Content Upload API
Presented below is a detailed walkthrough illustrating the process of uploading a 3D
model through the SynergyXR Content API. To initiate this procedure, you must possess a
user account with Author-level access to a SynergyXR Workspace. Your credentials will
include a username (which is invariably an email) and a password. Additionally, you will
require the workspace identifier.
Locate your workspace identifier in the URL of your browser while logging into the
Manager, as demonstrated here:
Additional details (which are also provided in the examples) are listed here for reference:
Login Base URL: https://login.synergyxr.com/
Storage Base URL: https://storage.synergyxr.com/
Client Id: SynergyPostmanClient
Client Secret:
8StTCcGYWkWmdu9kUveBPpgGmvWH8rvAeJ6GDNpx7PM649r9bt2KEwXWuzq4fd9h
(Note: The Client Secret for the SynergyXR Content API is not confidential as it is a public
API. Therefore, we openly list it here. Your account credentials, however, remain
confidential.)
The flow goes like this:
curl
If you're not familiar with the curl command-line tool, which is used for making HTTP
requests, don't worry. Most developers with Git installed have access to curl via Git Bash.
It's a powerful tool for interacting with APIs. If you don't have it installed (again, it
comes with git so if you have git installed you probably already have it), then you
can download it from https://curl.haxx.se/download.html
1. Login
Response (example):
Note down the returned access_token value, it will be a JWT token (something
like for example
eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiIxMjM0NTY3ODkwI
iwibmFtZSI6IkpvaG4gRG9lIiwiaWF0IjoxNTE2MjM5MDIyfQ.SflKxwRJSMeK
KF2QT4fwpMeJf36POk6yJV_adQssw5c).
2. Create Draft
You’ll need a 3D model so let’s download Avocado.glb from the public glTF
KronosGroup GitHub to the current folder:
Now create the draft.
Response (example):
Note down the contentDraftId, it will be a UUID (something like for example
25e94324-edec-41d0-b2fe-057ea3edc0ef).
3. Check Draft Status
Response (example):
(if not done yet it will say PROCESSING instead of READY_TO_PUBLISH)
4. Publish Draft
Now we publish the draft so the content becomes visible to all synergy users with
access to the workspace.
Response (example):
The publish operation will return information about the created file. Most relevant
here is the ID, which is the reference ID in SynergyXR. A full documentation of the
file info object is beyond the scope of this guide.
Done! You have now published a piece of content to SynergyXR.