🔼Upload
Learn how to upload assets with a query.
Upload content entry
POST
https://api.echo3D.com/upload
This endpoint allows you to upload a new 3D content entry.
Headers
Content-Type
string
Use multipart/form-data
when uploading multiple files.
Request Body
key
string
Your API key.
string
Your user email.
target_type
integer
A type of target. Options: 0
for IMAGE_TARGET
, 1
for GEOLOCATION_TARGET
, or 2
for BRICK_TARGET
. For each target type see additional required data parameters below.
hologram_type
integer
A type of hologram. Options: 0
forVIDEO_HOLOGRAM
, 1
forIMAGE_HOLOGRAM
, or 2
forMODEL_HOLOGRAM
. For each hologram type see additional required data parameters below.
data
string
A string representing metadata to add to the uploaded content. Format: key1:value1;key2:value2;...
secKey
string
Target Type
Target types can be one of the following:
0
for IMAGE_TARGET
0
for IMAGE_TARGET
If you choose to use an image as your AR target, you must also add to your request one of the following:
url_image
: A URL to the image you want to use as a targetfile_image
: The image file you want to use as a target. The file will be uploaded as Part.
1
for GEOLOCATION_TARGET
1
for GEOLOCATION_TARGET
A location target must be associated with a location. You must either send an address or send location coordinates (longitude and latitude):
text_geolocation
: Address for the location.longitude
andlatitude
: Longitude and latitude coordinates
2
for BRICK_TARGET
2
for BRICK_TARGET
A surface target needs no additional arguments.
Asset Type
Asset types can be one of the following:
0
for VIDEO_HOLOGRAM
0
for VIDEO_HOLOGRAM
You can upload a video file as your 3D asset. Your request must include one of the following:
url_video
: A URL to the video image you want to use as your AR objectfile_video
: The video file you want to use as your AR object. The file will be uploaded as Part
1
for IMAGE_HOLOGRAM
1
for IMAGE_HOLOGRAM
You can upload an image file as your 3D asset. Your request must include:
file_image_hologram
: The image file you want to use as your hologram. The file will be uploaded as Part.
2
for MODEL_HOLOGRAM
2
for MODEL_HOLOGRAM
You can upload 3D models to your project. Your request must also include:
type
, which must be one of the following values:upload
: New model file upload. Expects a file part from local storage. If the upload option is chosen, the following must be set as well:file_model
: The file or files you want to use as your asset. The file or files will be uploaded as Part. In this case, make sure to set theContent-Type
request header tomultipart/form-data
.
search
: Getting a 3D model from third-party 3D search engines. If the search option is chosen, the following must be set as well:source
, either:Poly
: Finds a model in Google Poly. If the search option is chosen, the following must be set as well:bin_url
, the Poly URL to the .bin file of the modelgltf_url
, the Poly URL to the .gltf file of the modelthumbnail
, the Poly URL to the thumbnail of the modelpng_url
, the Poly URL to the .png resource of the modelpng_path
, the Poly relative path to the .png resource of the model
Sketchfab
: Finds a model in Sketchfab. If the search option is chosen, the following must be set as well:url
, the Sketchfab API URL redirecting to the model. Should be in the form of https://api.sketchfab.com/v3/models/<ID>/download
name
, the model name.
4
for GENERAL_HOLOGRAM
4
for GENERAL_HOLOGRAM
You can upload a file that is not a 3D model, image, video, or audio as a general hologram. Your request must include:
file_general_hologram
: The file you want to upload. The file will be uploaded as Part.
Examples
Here are a few upload API examples using Postman.
1. Uploading a model asset on a surface target from local storage :
type
isupload
andfile_model
includes a filehologram_type
is2
target_type
is2
2. Uploading a model asset on a brick target from a third-party search engine:
type
issearch
,source
isSketchfab
, andurl
includes an URL redirecting to the modelhologram_type
is2
target_type
is2
Uploading with Metadata
You can attach a .csv file that contains pairs of keys and values to the Upload API call to be added alongside the uploaded asset as data entries. Your request must include:
file_cvs
that includes a file
Your metadata file should contain only two columns: one for keys and the second for values.
Here is a sample file you can use:
Overwrite or Edit an Existing Entry
You can overwrite or edit an existing entry that was previously uploaded by using the upload API with a few additional parameters. Your request must include:
edit_type
that included the type of edit to make:hologram
ortarget.
entryId
that included the Entry ID of the existing Entry to overwrite.
Batch Upload
If you would like to upload many assets at once, the following repository allows for customized batch uploads via a Python script and a CSV data file. Click here to access the repository on GitHub.
Last updated