...
Authorization: Bearer <your_auth_token>
Content-Type: application/json
Content-Encoding: gzip
X-File-Content-Classification: Insights.UnityProjects
X-File-Content-Length: <original_file_size_in_bytes>
X-File-Content-MD5: <MD5_hash_of_original_file>
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.
Login to the HW Sandbox Portal: https://portal.honeywell-sandbox.opsera.io/ Opsera portal.
Access User Profile: Click on your user avatar or profile picture at the top-right corner of the dashboard.
Navigate to API Tokens: Select "API Tokens" or "Personal Access Tokens" from the profile settings menu.
Create a New API Token: Click on the "Create New Token" button and provide a name for the token.
Define Permissions: Choose the appropriate permissions or scopes for the token.
Generate and Save the Token: Click "Generate Token" and securely store the displayed token.
...
Prepare your JSON file (e.g., "data.json").Compress the file using gzip:
Code Block |
---|
gzip -c data.json > data.json.gz |
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" |
...