- URL:
- https://<root>/<serviceName>/FeatureServer/<layerId>/uploadAssets
- Methods:
- GET
- Required Capability:
- Editing, Uploads
- Version Introduced:
- 11.1
Description
The upload  operation uploads assets to a service either by referencing the upload ID of an asset or having the asset embedded in the request. Assets must be uploaded to a service before they can be referenced in apply  or convert3D  requests.
If the operation is successful, the response will include the upload  property, which will have a result object for each asset included in the request. If an asset is uploaded successfully, the result object will return success  as true  and the computed hash for the asset. If an asset was not uploaded successfully, the result object will return success  as false  and an error object that includes an error code and description of the error. If the operation is not successful, the response will return an error.
Request parameters
| Parameter | Details | 
|---|---|
| 
 | An array of asset objects. Each asset object contains the  Syntax Example  | 
| 
 | The response format. The default response format is  Values:  | 
Example usage
The following is a sample request for the upload  operation:
https://machine.domain.com/webadaptor/rest/services/City_Park_Assets/FeatureServer/0/uploadAssets?assets=[{"assetType": "3D_gltf","assetData": "Z2xURgIAAACoiRAAsFcAAEpTT057ImFjY2Vzc29ycyI6W3siYnVmZmVyVmlldyI6MSwiY29tcG9uZ..."},{"assetType": "IM_png","assetUploadId": "i0bcaf83a-85e2-40a3-b1e7-f80c7b63b832"}]&f=pjsonJSON Response syntax
{
  "uploadResults": [
    {
      "success": true,
      "assetHash": "<assetHash1>"
    },
    {
      "success": true,
      "assetHash": "<assetHash2>"
    },
    {
      "success": false,
      "error": {
        "code": "<error code>",
        "description": "<error description>"
      }
    }
  ]
}JSON Response example
{
  "uploadResults": [
    {
      "success": "true",
      "assetHash": "045ef29d382f1c8227bde3a25d37f7a62fe0d2259a3a14dd6486ee53c8faba18"
    },
    {
      "success": "false",
      "error": {
        "code": 2017,
        "description": "Invalid upload item id"
      }
    }
  ]
}