Demyst File Transfer

User Management

Demyst offers a web portal to securely exchange files. Files can be uploaded or downloaded by the clients using the file transfer page on our website. Demyst team can provide access to the site

Industry-standard Transport Layer Security ("TLS") version 2.0 or greater is used to create a secure connection using 256-bit Advanced Encryption Standard ("AES") encryption. All the files uploaded will be encrypted at rest using industry-standard AES encryption. In addition, the site displays a GPG key that can be used to further encrypt the file before sending it to us. RSA public/private keys can also be created and shared instead of GPG keys.

docs_upload_file

Python API

Demyst provides a Python API wrapper that performs the same function as manually uploading and downloading files from the Demyst site. Install the latest version of the package to get started

Install the latest demyst-cli python package (v0.8.37 and above) to transfer files

        
                $pip install demyst-cli
		
                #import the requisite methods
                from demyst.cli.file_transfer import upload_file, demyst_uploaded_files
                
                #to view files uploaded
                demyst_uploaded_files(region='us')
                
                #to upload files to Demyst
                upload_file('test.csv', region='us')
        
      
  • demyst_uploaded_files(region=None) Will list the files uploaded by Demyst along with a pre-signed URL to download the file, file uploaded date, and the size of the file. Region by default will be US. The URL will be active for 15 minutes. Re-running the method will generate a new active URL.

    docs_region
  • upload_file(filepath=None, region=None) - Will be able to upload files by specifying the path and name. Allowed file types are .xlsx, .xls, .csv, .zip, .gz, .pgp, .gpg. The file type is limited tot these for security reasons. Region by default will be US.

    docs_region1.png

HTTPS Request

The aforementioned methods for transferring files can also be achieved through HTTPS Request

  • Download Demyst Uploaded Files - This is a two-step method where you first have to generate a token that can be used to list the files available for download

    Request to generate the token

    POST

    https://console.demystdata.com/jwt/create

    arrows curl
    	    
                        curl -X POST \
                        https://console.demystdata.com/jwt/create \
                        -H 'Content-Type: application/json' \
                        -d '{
                        "email_address": "EMAIL/USERNAME",
                        "password": "PASSWORD"
                        }'
    	    
    	  

    Request to list the files with pre-signed URL (active 15 minutes and can be regenerated)

    The response would contain the This Filename, file upload date, size, and the pre-signed URL which can be used to download the files.

    Note - Pre-signed URLs are active for 15 minutes only. Re-run the GET request to generate active pre-signed URLs. The File are purged based on the org policy set (By default it will be 30 days)

    GET

    https://gw.us.demystdata.com/v2/channel

    arrows curl
    	    
                        curl -X GET \
                        'https://console.demystdata.com/download/get_file_list?direction=download&region_code=us' \
                        -H 'Accept: application/json' \
                        -H 'Authorization: REPLACE_WITH_TOKEN' \
                        -H 'Content-Type: application/json' \
    	    
    	  
  • To upload the file using HTTPS Request, you will have to follow all the steps from below

    - Request to generate the token for the Get Signed URL and Notify Demyst of upload steps below

    POST

    https://gw.us.demystdata.com/v2/channel

    arrows curl
    	    
                        curl -X POST \
                        https://console.demystdata.com/jwt/create \
                        -H 'Content-Type: application/json' \
                        -d '{
                        "email_address": "EMAIL/USERNAME",
                        "password": "PASSWORD"
                        }'
    	    
    	  

    - Get Signed URL. Note that region code has to be 2 digit ISO country code (us, au, sg, hk, etc) Organization ID has to be your org ID provided by the Demyst Team. If organization_id is not provided in the call, it will default to the account (username and pass from above) of the organization. So it is ok to not send organization_id in the call but filename and region_code are musts.

    GET

    https://gw.us.demystdata.com/v2/channel

    arrows curl
    	    
                        curl -X GET \
                        'https://console.demystdata.com/upload/get_url?filename=test.csv&region_code=us&organization_id=3' \
                        -H 'accept: application/json' \
                        -H 'authorization: REPLACE_WITH_TOKEN' \
                        -H 'content-type: application/json' 
    	    
    	  

    - Put File. Response will contain signed_url and s3_object_id. signed_url will be needed for Put File step whereas s3_object_id will be needed for Notify Demyst of upload step below

    PUT

    https://gw.us.demystdata.com/v2/channel

    arrows curl
    	    
                        curl -X PUT \
                        'REPLACE_WITH_SIGNED_URL' \
                        -H 'content-type: multipart/form-data; boundary=----WebKitFormBoundary7MA4YWxkTrZu0gW' \
                        -F data=@test.csv
    	    
    	  

    - Notify Demyst of upload (Also enables display on UI) - Important. Same as Get Signed URL step you can ignore organization_id.

    GET

    https://gw.us.demystdata.com/v2/channel

    arrows curl
    	    
                        curl -X GET \
                        'https://console.demystdata.com/upload/new_file_uploaded?filename=test.csv&region_code=us&organization_id=3&s3_object_id=REPLACE_WITH_S3_OBJECT_ID' \
                        -H 'accept: application/json' \
                        -H 'authorization: REPLACE_WITH_TOKEN' \
                        -H 'content-type: application/json'