Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

  1. Authorization: Bearer <your_auth_token>

  2. Content-Type: application/json

  3. Content-Encoding: gzip

  4. X-File-Content-Classification: Insights.UnityProjects

  5. X-File-Content-Length: <original_file_size_in_bytes>

  6. X-File-Content-MD5: <MD5_hash_of_original_file>

  7. X-File-Name: <original_file_name.json>

...

From within the Opsera portal, follow these steps to generate an API token if you don't already have one.

  1. Login to the HW Sandbox Portal: https://portal.honeywell-sandbox.opsera.io/ Opsera portal.

  2. Access User Profile: Click on your user avatar or profile picture at the top-right corner of the dashboard.

  3. Navigate to API Tokens: Select "API Tokens" or "Personal Access Tokens" from the profile settings menu.

  4. Create a New API Token: Click on the "Create New Token" button and provide a name for the token.

  5. Define Permissions: Choose the appropriate permissions or scopes for the token.

  6. Generate and Save the Token: Click "Generate Token" and securely store the displayed token.

...

  1. Prepare your JSON file (e.g., "data.json").

  2. Compress the file using gzip:

Code Block
   gzip -c data.json > data.json.gz
  1. Calculate the MD5 hash and file size of the original JSON file:

Code Block
   original_md5=$(md5sum data.json | cut -d ' ' -f 1)
   original_size=$(wc -c < data.json)

...

Code Block
bash
curl -X POST "https://api.honeywell-sandbox.opsera.io/data-migration-file/data/upload" \
     -H "Authorization: Bearer YOUR_AUTH_TOKEN" \
     -H "Content-Type: application/json" \
     -H "Content-Encoding: gzip" \
     -H "X-File-Content-Classification: Insights.UnityProjects" \
     -H "X-File-Content-Length: $original_size" \
     -H "X-File-Content-MD5: $original_md5" \
     -H "X-File-Name: data.json" \
     --data-binary "@data.json.gz"

...


This response confirms that your file was successfully uploaded and provides you with the necessary information to verify the upload and reference the file in the future.

Postman Example
To test using Postman, you can import the following cURL command:

Code Block
curl --location 'https://api.honeywell-sandbox.opsera.io/data-migration-file/data/upload' \
--header 'Authorization: Bearer YOUR_AUTH_TOKEN' \
--header 'Content-Type: application/json' \
--header 'Content-Encoding: gzip' \
--header 'X-File-Content-Classification: Insights.UnityProjects' \
--header 'X-File-Content-Length: ORIGINAL_FILE_SIZE' \
--header 'X-File-Content-MD5: ORIGINAL_FILE_MD5' \
--header 'X-File-Name: data.json' \
--data '@/path/to/your/data.json.gz'

To import this into Postman

  1. Open Postman

  2. Click on "Import" in the top left corner

  3. Choose the "Raw text" tab

  4. Paste the curl command above

  5. Click "Continue" and then "Import"

  6. Update the placeholder values with your actual data before sending the request

Please ensure you replace YOUR_AUTH_TOKEN, ORIGINAL_FILE_SIZE, ORIGINAL_FILE_MD5, and the file path with your specific values.