Upload a file (step 2 of 3)
Second step of the file-upload flow: streams the actual file content (multipart, field name `file`) to the data source authorized in step 1. Only `sftp` and `localfile` destination types are supported — any other type fails with `400`. If the destination already exists and `overwrite` is not `true`, fails with `409`.
Second step of the file-upload flow: streams the actual file
content (multipart, field name file) to the data source
authorized in step 1. Only sftp and localfile destination types
are supported — any other type fails with 400. If the destination
already exists and overwrite is not true, fails with 409.
Authorization
SymetryMLAuth HMAC-SHA256 signature-based authentication: requests are signed with
your secret key and sent with the Customer-ID, Sym-date,
Authorization, Content-MD5 and sym-version headers.
sym-version is required and must be 7.x (for example 7.0).
See SymetryML REST API Security
for the signature algorithm and a complete example.
In: header
Path Parameters
User/Customer identifier
Query Parameters
Base64 of the Authorization header value returned by upload/auth
RFC 2104 HMAC of key, computed with the customer's secret key
falseRequest Body
multipart/form-data
TypeScript Definitions
Use the request body type in TypeScript.
Response Body
application/json
application/json
application/json
curl -X POST "https://example.com/files/c1/upload?key=RHRFRTg2SHo1S1NJUi9SQTVsbXVlb0lPNWxYdDd2d1BsZU1uWk5XRVZNTT0%3D&keyhmac=ACUYUqDphHWfppXAKt4L2%2FSZ4ZogVX9aCWUiyivJB%2Fk%3D" \ -F file="uploaded_file.csv"{ "statusCode": 200, "statusString": "Uploaded", "values": {}}{ "statusCode": 400, "statusString": "java.lang.Exception: Invalid key HMAC", "values": {}}{ "statusCode": 409, "statusString": "Upload interrupted. Destination file in DataSource [ my_ds ] already exists", "values": {}}Authorize a file upload (step 1 of 3) POST
First step of the file-upload flow: registers a data source definition and authorizes a subsequent upload for it. Only `sftp` and `localfile` destinations are accepted (`localfile` only when the server sets `sml.local_ds.enable=1`); since 7.0 any other type, or a definition missing a required field, is refused here with `400`. The request body is a `DSInfoEncrypted` — the JSON serialization of a `DSInfo` encrypted with the customer's secret key in the 7.0 `v2:` format ([Encrypted Request and Response Bodies](/docs/symetryml-rest-client/rest-documentation/symetryml-rest-api-security#encrypted-request-and-response-bodies)). On success, the response's `statusString` **is** the value the caller sent in its own `Authorization` header — base64-encode that value to use as the `key` query parameter in `upload` (step 3), and compute its RFC 2104 HMAC (with the same secret key) to use as `keyhmac`. The authorization is only valid for 10 minutes.
Get file upload progress (step 3 of 3, pollable) GET
Poll for the progress of an in-flight upload started via `upload`. `statusString` is the number of bytes read so far while the upload is in progress, or `1` once complete — polling again after completion returns the "not being uploaded" `400` below, since the completed entry is removed on first read.