Skip to content
URL:
https://<root>/uploads/upload
Methods:
POST
Version Introduced:
10.9

Access requirements

Required privileges

The Enterprise Administrator API requires privilege-based access. An administrator must be assigned a specific user privilege, or role, to access any given endpoint. Listed below are the user privileges or roles an administrator can be assigned that provides access to this endpoint. If multiple privileges are listed, only one needs to be assigned to gain access.


Tokens

This API requires token-based authentication. A token is automatically generated for administrators who sign in to the Enterprise Administrator API directory's HTML interface. Tokens generated in this way are stored for the entirety of the session.

Those accessing the API directory outside of the HTML interface will need to acquire a session token from the generateToken operation in the Enterprise Directory API. For security reasons, all POST requests made to the Enterprise Administrator API must include a token in the request body.


Learn how to generate a token

Description

The upload operation uploads files to an organization. You can upload items with the following file extensions:

  • .soe
  • .sd
  • .sde
  • .odc
  • .csv
  • .txt
  • .zshp
  • .agssite
  • .agssiteservices
  • .zip
  • .geodatabase
  • .kmz
  • .json
  • .geojson
  • .gpx
  • .xlsx
  • .xls

Request parameters

ParameterDetails

itemFile

(Required)

The file to be uploaded, processed as a multipart POST file.

description

(Optional)

A description for the uploaded item.

f

The response format. The default format is html.

Vales: html | json | pjson

Example usage

The following is a sample POST request for the upload operation:

Use dark colors for code blocksCopy
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
POST /<context>/admin/uploads/upload HTTP/1.1
Host: organization.example.com
Content-Type: multipart/form-data; boundary=------boundary

------boundary
Content-Disposition: form-data; name="itemFile"; filename="fireWeatherWatch.kmz"
Content-Type: application/octet-stream

FireWeatherWatch.kmz
------boundary
Content-Disposition: form-data; name="description"


------boundary
Content-Disposition: form-data; name="f"

pjson
------boundary
Content-Disposition: form-data; name="token"

eDleqkNQOm5GJnRfphx61zCwr1rLF5dKEqnTQal53RYl5KoMFHweXHJfkwDk7zYMLGjdKTYA63yWKnFw-jbL6i-Xq0rcPTh4rsz8YhWta-k-7RJ3pqKYJEHcmxfX5EdeVuKMlUlOqT5t06AFwpo_lVOAPOD2RdOhPjCDDPD4Nca2g1ddcLdmdDnyN5GBaPY5wXENqaP9dgLMfkkx86RO5f4LBBiGZ5mmLg1oRx7EqtCo7fTdHrHetOUVJEptFfXp
------boundary--

JSON Response example

Once the upload has completed, users viewing the HTML view will be redirected to the new uploaded item resource page that outlines the item properties, such as its item ID, item name, and description. If the f parameter was specified as either json or pjson, users will not be redirected to the item resource page. Instead, a response that includes a success message, as well as the JSON representation of the item's properties from the item resource page, will be returned.

Use dark colors for code blocksCopy
1
2
3
4
5
6
7
8
9
10
11
{
  "status": "success",
  "item": {
    "itemID": "caf81a83-b6a7-4810-9e7c-dbff96c6050a",
    "description": "",
    "itemName": "FireWeatherWatch.kmz",
    "date": 1597190184236,
    "committed": true,
    "contentType": "application/octet-stream"
  }
}

Your browser is no longer supported. Please upgrade your browser for the best experience. See our browser deprecation post for more details.