Skip to content

Upload a Single Part



POST /api/v1/rum_sourcemap/upload_part

Overview

Upload one byte part of a SourceMap ZIP.

Before Calling and Usage Steps

This request uses the uploadId returned by initialization; appId, env, and version are already bound during initialization. Do not submit these scope fields additionally in this request.

The current Key must have rum.rumCfgManage. Only the workspace to which the current Key belongs is supported. Take appId from content[].appId in the RUM application summary; it must match the app_id in SDK/error records and cannot be replaced with the database internal UUID. SourceMap is precisely identified by application, environment env, and version version; case and whitespace are part of the identifier itself and must exactly match the collection records. The appId/env/version of this request inherit the scope bound during initialization. Additional scope fields are not accepted; omitting these fields does not change the bound environment or version. The current hosting lifecycle requires each to be at most 256 characters.

For the workflow, see SourceMap multipart upload related API usage instructions, and refer to Multipart Upload Operations Guide. Perform the following in order: initialize → upload all parts of the original ZIP → verify the part list → merge → query the version status and file tree. Successful initialization/merge does not mean the ZIP has been validated or can be parsed; statuses such as processing/failed/blocked still need to be verified.

Use multipart/form-data, with regular Form fields uploadId/chunkIndex and file field files; do not send JSON. files is a contiguous byte range of the original ZIP, with each part at most 10 MiB. Use a .zip file name to satisfy the declaration; the server does not require each part itself to be an independently extractable ZIP at this time. Number parts in original ZIP order; consecutive numbering starting from 0 is recommended. Do not treat multiple independent ZIPs as parts.

The same uploadId + integer chunkIndex replaces that part. For retries, send only exactly the same bytes to avoid concurrent overwrites of the same number. Numeric strings are converted to integers; 00 and 0 are the same index. Do not rely on leading zeros for distinction. Once the merge and publish phase has been entered, writing parts is prohibited and may return 409; if the session has expired/been replaced, or the target generation is not writable, 406 is returned. Success only proves that the part has been saved; it does not prove that all parts, the complete ZIP, or the SourceMap content is valid.

Request Headers

Parameter Type Required Description
DF-API-KEY string Y OpenAPI authentication credential for the workspace.
Example: <DF-API-KEY>
How to obtain or enter: Obtain an OpenAPI Key with the permission for this operation from API Key Management in the target workspace.

Form Parameters

Parameter Type Required Description
uploadId string Y Required upload session ID. Do not construct it yourself or replace it with taskId. A Key with management permissions in the same workspace can continue; it is not isolated by the Key that created it. The session defaults to 3600 seconds, and multipart upload does not renew it automatically. If it expires or is overwritten by a new session, verify and then reinitialize.
Allows null: False
Example: aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaabbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb
How to obtain or enter: Save content.uploadId from the successful response of Initialize Multipart Upload exactly as returned.
chunkIndex digitsString Y The client must use a non-negative decimal numeric string. The current declared digitsString type recognition has a compatibility gap and does not strictly reject non-numeric values: values such as abc/1.2 can return 500 during int conversion; negative numbers return 406 in the hosting logic; an explicit empty string is currently treated as 0 for compatibility. Do not rely on these exceptional-value behaviors. Do not use the original file name/UUID in place of the index.
Allows null: False
Allows empty string: False
Example: 0
How to obtain or enter: Generated by the caller's part list, starting from 0 and incrementing in original ZIP order.

File Parameters (multipart/form-data)

Parameter Type Required Description
files file Y Required: one file with a .zip suffix (a compatibility declaration allows an empty file name). The same part does not need to have an independent ZIP structure, and uploading must not change the bytes.
Maximum single file size: 10M
Allows empty file name: True
Maximum number of files: 1
Allowed file suffixes: ['zip']
Example: part-000.zip
How to obtain or enter: Split the complete local ZIP in original byte order, with each part no larger than 10 MiB.

Additional Parameter Notes

For the workflow, see SourceMap multipart upload related API usage instructions, and refer to Multipart Upload Operations Guide. Perform the following in order: initialize → upload all parts of the original ZIP → verify the part list → merge → query the version status and file tree. Successful initialization/merge does not mean the ZIP has been validated or can be parsed; statuses such as processing/failed/blocked still need to be verified.

Request Example

curl --request POST 'https://openapi.guance.com/api/v1/rum_sourcemap/upload_part' \
  -H 'DF-API-KEY: <DF-API-KEY>' \
  -F 'uploadId=aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaabbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb' \
  -F 'chunkIndex=0' \
  -F 'files=@./part-000.zip'

Response

HTTP 200, application/json. The example below shows the main fields that can be read directly.

Field Type Description
content.uploadId string Current session ID.
content.chunkIndex integer Integer part number actually saved.
content.declaration object or null Workspace common declaration attached to a non-empty business object; when not configured, it may be null or an empty object; an empty object is not added. It does not change the semantics of business fields with the same name on the entity itself.
content.reasonCode string Error responses only: machine-readable reason, for example active_operation/invalid_scope/registry_missing.
content.action string Error responses only: suggested action, for example retry_after_operation/verify_ownership/check_scope_and_upload.
content.retryable boolean Error responses only: server-suggested retryable flag; do not replay published writes based solely on this.
content.actualBytes integer Some capacity errors only: number of bytes counted.
content.maxBytes integer Capacity/read limit in bytes.
content.workspaceUUID string Limited diagnostics for some errors: current workspace UUID.
content.appId string Limited diagnostics for some errors: public application identifier.
content.rumCfgUUID string Limited diagnostics for some errors: internal application identifier, used only for support troubleshooting; it does not replace the request appId.
content.env string Diagnostics for some errors: environment.
content.version string Diagnostics for some errors: version.
content.bundleUUID string Diagnostics for some errors: generation record ID for this operation, not uploadId.
content.state string Diagnostics for some errors: generation state.
content.resource string Some occupancy diagnostics: resource type, such as application/bundle.
content.shared boolean Some occupancy diagnostics: whether access is shared.
content.waitedSeconds number Some occupancy diagnostics: seconds already waited.
content.waitSeconds number Some occupancy diagnostics: allowed wait seconds.
content.waitExhausted boolean Some occupancy diagnostics: this wait was exhausted.
content.elapsedSeconds number Some single-file error diagnostics: operation elapsed seconds.
content.phase string Diagnostics for some errors: failure phase.
content.phaseElapsedSeconds number Diagnostics for some errors: phase elapsed seconds.
{
  "code": 200,
  "content": {
    "uploadId": "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaabbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb",
    "chunkIndex": 0,
    "declaration": {}
  },
  "errorCode": "",
  "message": "",
  "success": true,
  "traceId": "TRACE-EXAMPLE"
}

Error Responses

For authentication, rate limiting, and common request errors, see Common Error Definitions.

The storage lifecycle retains compatibility error codes: 409 is usually still ft.InvalidAction, and the localized message and content.reasonCode further distinguish the cause. Do not treat message names such as SourceMapOperationBusy as necessarily the errorCode. On read, a missing package, processing, or unavailable state is usually 404 ft.SourceMapPackageNotFound; see reasonCode for the specific cause. Retry with backoff only when retryable=true is explicitly returned and the current state allows it; when uploadCommitted=true, do not replay writes that have already been confirmed as published.

HTTP Status errorCode Trigger Condition Message or Response Description Handling
406 ft.ParameterValidationFailed Request field is missing, or the field value violates the declared validation conditions Parameter parsing failed Check the parameter location, field name, type, and value.
404 ft.NotFoundRumSet The application is not in the current workspace, has been deleted, or does not exist The specified RUM setting was not found Refresh the RUM application summary and use the actual appId in the current workspace.
406 ft.InvalidUploadId Session cache does not exist/has expired/has been replaced, target generation state/operation ID does not match, or the write phase has been canceled; hosted negative indices are also rejected Invalid UploadId value, or the task has been overwritten Verify the original uploadId and uploaded parts; after confirming the old session and publish status, reinitialize. Do not overwrite blindly.
409 ft.InvalidAction Upload/read/cleanup conflict, legacy directory takeover not completed, ownership/recovery pending verification, or environment version exceeds the range allowed by the lifecycle A specific localized prompt is returned according to reasonCode, for example, SourceMap is being used by another upload, read, or cleanup operation Read content.reasonCode/action/retryable: back off as instructed for active_operation/active_upload, etc.; for owner_recovery_required/ownership_verification_required/legacy_invalid, etc., ask an administrator to verify first. Do not delete occupancy records or force overwrite on your own. For invalid_scope, verify that env/version are at most 256 characters.
406 ft.InvalidFileName The file relative path, symbolic link, or historical release path is unsafe The SourceMap file path does not meet the requirements or contains an unsupported link. Check the relative path and directory structure of the uploaded file. Use a valid relative path within the package, without .., backslashes, absolute paths, or symbolic links; check reasonCode=invalid_path.
500 ft.InternalServerError A non-numeric chunkIndex such as abc/1.2 passes the current type recognition but fails int conversion, or an unhandled file/cache/database exception occurs Internal error Pass only a non-negative decimal number; for storage exceptions, first check part_list to verify whether the part was saved, then retry the same bytes.

Feedback

Is this page helpful?