- URL:
- https://dataaccess/notebookworkspace/uploadFile
- Methods:
POST- Version Introduced:
- 11.5
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.
To access notebook-related endpoints, administrators must be assigned a custom role that includes any of the privileges listed above as well as the Create and edit notebooks privilege.
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 generate 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.
Description
The upload operation allows uploads of a single file to your workspace directory (/arcgis/home). By default, the file is uploaded to the root of the workspace directory. You can prefix a directory path to the file name to upload the file to a subdirectory.
The upload file size limit is 128 MB for a single file. Large files can also be uploaded in parts from a client that has the ability to split files into smaller parts. To initiate a multipart upload, the client passes in the is parameter as true, along with the file and block parameters. After uploading all parts, the operation can be completed by passing in the xml and file parameters, as well as the is parameter set as true.
Request parameters
| Parameter | Details |
|---|---|
(Optional) | The file to be uploaded. This is required when uploading a single file or a file in multiple parts. This is not required when |
(Required) | Defines the name of the file to be uploaded. Optionally, the file can be uploaded to a subdirectory by prefixing a folder path to the file name. If you upload a file using a Example |
(Optional) | A Boolean that is set to Values: |
(Optional) | Required when uploading files in multiple parts. The Example |
(Optional) | Required to complete the upload of a large file in multiple parts. Once the individual parts have been uploaded, specify values for the Example |
(Optional) | Required when uploading a single file or a file in multiple parts. This parameter is not required when Value: |
| The response format. The default response format is Values: |
Example usage
The following are example requests for the upload operation.
POST /<context>/notebooks/admin/dataaccess/notebookworkspace/uploadFile
Host: organization.domain.com
Content-Type: multipart/form-data; boundary=------boundary
------boundary
Content-Disposition: form-data; name="uploadFile"; filename=""
Content-Type: application/octet-stream
mjwater.zip
------boundary
Content-Disposition: form-data; name="fileName"
mjwaterzip
------boundary
Content-Disposition: form-data; name="blockId"
------boundary
Content-Disposition: form-data; name="xmlField"
------boundary
Content-Disposition: form-data; name="f"
pjson
------boundary
Content-Disposition: form-data; name="token"
Mya-BuB9qRjkorfcgskCrFjDgcLCqZzehI_3sHMgSVY8JQCdmUHzQCX6qayumb7ecIgrADEuTy-NnF35rlAH9AiXZg3M_AWVNaqyZwM8SNf_mfRVbyf1SfPkUNXJoFVwFYLb1AlIKHm_EONlTvr2V-gaxfnHgpJvvQ5u-mdO9yYvRzjzmuYQge6rsqftqCnXXU9S7NOLmTahmPpRKTGy8c0z2dVlnfZfp7IdnJfmUm-s1I-mu7HDJWTkw4TXxPiL
------WebKitFormBoundaryCuVJC964pmBXvkM6
Content-Disposition: form-data; name="x-ms-blob-type"
BlockBlob
------boundary--JSON Response syntax
{"status": "<success | failure>"}JSON Response example
{"status": "success"}