upload#
- argus_api.files.documents.upload.upload_document(mime_type: str, data: Union[bytes, pathlib.Path], folder: Union[str, int], name: str, customer: Optional[Union[str, int]] = None, accessMode: Optional[str] = None, overwriteExisting: bool = False, skipNotification: bool = False, createMissing: Optional[bool] = None, json: bool = True, verify: Optional[bool] = None, proxies: Optional[dict] = None, apiKey: Optional[str] = None, authentication: Optional[dict] = None, server_url: Optional[str] = None, api_session: Optional[ArgusAPISession] = None) dict #
Upload a document to a folder.
- Parameters
mime_type – MIME type of the document
data – document data, either as raw bytes or a
pathlib.Path
object. if a pathlib.Path object is provided, the file it is pointing to will be read.folder – folder ID or path to upload the document to. If using a folder ID, it must be passed as an int.
name – file name of the document.
customer – ID or shortname of the customer whose space the document will be uploaded to. Ignored if the destnation folder is provided as an ID, otherwise defaults to the current user’s customer.
accessMode (str) – Access mode to set on new document
overwriteExisting (bool) – If true, overwrite existing document with the same name
skipNotification (bool) – If true, skip notification to folder watchers
createMissing – If set to
True
, create any missing folders before adding the document. Will be ignored if the folder has been provided as an ID.json – return the response’s body as a
dict
parsed from json.True
by default. If set to false, the rawrequests.Response
object will be returned.verify – path to a certificate bundle or boolean indicating whether SSL verification should be performed.
apiKey – Argus API key.
authentication – authentication override
server_url – API base URL override
api_session – session to use for this request. If not set, the global session will be used.
- Raises
AuthenticationFailedException – on 401
AccessDeniedException – on 403
ObjectNotFoundException – on 404
ValidationErrorException – on 412
ArgusException – on other status codes
- Returns
dictionary translated from JSON