Skip to content

Merge Chunks to Generate a File



POST /api/v1/rum_sourcemap/part_merge

Overview

Merge the ZIP in the order of uploaded indexes and schedule asynchronous extraction and publishing.

Prerequisites 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 again in this request.

The current Key requires rum.rumCfgManage. Only the workspace to which the current Key belongs is supported. Obtain appId from RUM application summary table content[].appId. It must be consistent with the app_id in SDK/error records and cannot be replaced with the database internal UUID. SourceMap is precisely located 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. No additional scope fields are accepted; omitting these fields does not change the bound environment or version. The current managed lifecycle requires each to be at most 256 characters.

The process is described in SourceMap Multipart Upload Related API Usage Guide, and you can also refer to Multipart Upload Operations Guide. Initialize → Upload all original ZIP chunks → Verify the chunk list → Merge → Query version status and file tree. Successful initialization/merging does not mean the ZIP has been verified or can be parsed; states such as processing/failed/blocked still need further verification.

chunkIndexs is a compatibility declaration. The current merge controller does not read this array; it actually scans all numeric indexes in the session directory and merges them sorted as integers. It cannot be used to select a subset of chunks, adjust the order, or declare the total number of chunks. The managed path must contain at least one chunk, and the indexes must be consecutive, but the starting point does not need to be 0. The caller must still ensure that all expected chunks have been uploaded; consecutive indexes do not prove that no trailing chunks are missing.

A normal new session returns content.state=processing and does not return a task ID or completed progress; an old compatibility session may return {}. The new generation is published only after background secure extraction, capacity, and Web .map content validation are completed. On failure, the old published version may be retained and failed/reasonCode recorded. The ZIP must not contain path traversal, links, or device files; by default, the total number of extracted files is at most 2GiB (site-configurable). Web requires an actually valid version=3 SourceMap; it is not sufficient to simply rename arbitrary JSON to .map.

If queue delivery fails, the persisted merge marker can be retained for periodic recovery, and the API may still succeed. Do not repeatedly initialize and overwrite merely because the status is temporarily processing. After the merge marker is set, chunk writes/cancellations are protected. Read the version list and file tree to confirm publication and perform actual parsing acceptance. This request is not a general idempotent task: repeated merges may be rejected or queued repeatedly. If the network result is unknown, query the current state first.

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 this operation permission from API Key Management in the target workspace.

Request Body Parameters

Parameter Type Required Description
chunkIndexs[*] integer Compatibility index element; integers are recommended. This parameter does not participate in the actual scan and merge.
Example: 0
How to obtain or enter: Same as the uploaded chunk list.
uploadId string Y Required upload session ID. Do not construct it yourself and do not replace it with taskId. Keys with management permissions in the same workspace can continue; sessions are not isolated by the creating Key. The session defaults to 3600 seconds, and chunk uploads do not automatically renew it. If it expires or is overwritten by a new session, verify and then reinitialize.
Null allowed: False
Example: aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaabbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb
How to obtain or enter: Save content.uploadId from the successful response of Initialize Multipart Upload as-is.
chunkIndexs array Optional array. It is ignored by the current implementation and cannot control the merge scope or replace client-side integrity checks; omitting it is recommended.
Null allowed: False
Empty string allowed: False
Example: [0, 1, 2]
How to obtain or enter: You can retrieve saved indexes from part_list, but there is currently no need to submit this compatibility field.

Additional Parameter Notes

The process is described in SourceMap Multipart Upload Related API Usage Guide, and you can also refer to Multipart Upload Operations Guide. Initialize → Upload all original ZIP chunks → Verify the chunk list → Merge → Query version status and file tree. Successful initialization/merging does not mean the ZIP has been verified or can be parsed; states such as processing/failed/blocked still need further verification.

Request Example

curl --request POST 'https://openapi.guance.com/api/v1/rum_sourcemap/part_merge' \
  -H 'DF-API-KEY: <DF-API-KEY>' \
  -H 'Content-Type: application/json' \
  --data-raw '{"uploadId":"aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaabbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb"}'

Response

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

Field Type Description
content.state string For a successful managed response, this is fixed to processing, indicating that asynchronous processing has been scheduled. Some error diagnostics may also use state to indicate the generation status at that time.
content.declaration object or null Workspace common declaration attached to non-empty business objects. If not configured, it may be null or an empty object; empty objects are 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, such as active_operation/invalid_scope/registry_missing.
content.action string Error responses only: suggested action, such as retry_after_operation/verify_ownership/check_scope_and_upload.
content.retryable boolean Error responses only: server-suggested retryable flag. It cannot be used alone to replay published writes.
content.actualBytes integer Some capacity errors only: bytes already counted.
content.maxBytes integer Capacity/read limit in bytes.
content.workspaceUUID string Restricted diagnostics for some errors: current workspace UUID.
content.appId string Restricted diagnostics for some errors: public application identifier.
content.rumCfgUUID string Restricted diagnostics for some errors: internal application identifier, used only for support troubleshooting and does not replace the request appId.
content.env string Some error diagnostics: environment.
content.version string Some error diagnostics: version.
content.bundleUUID string Some error diagnostics: generation record ID for this request, not uploadId.
content.resource string Some contention diagnostics: resource type, such as application/bundle.
content.shared boolean Some contention diagnostics: whether access is shared.
content.waitedSeconds number Some contention diagnostics: seconds already waited.
content.waitSeconds number Some contention diagnostics: allowed wait seconds.
content.waitExhausted boolean Some contention diagnostics: wait exhausted for this request.
content.elapsedSeconds number Some single-file error diagnostics: operation elapsed seconds.
content.phase string Some error diagnostics: failure phase.
content.phaseElapsedSeconds number Some error diagnostics: phase elapsed seconds.
{
  "code": 200,
  "content": {
    "state": "processing",
    "declaration": {}
  },
  "errorCode": "",
  "message": "",
  "success": true,
  "traceId": "TRACE-EXAMPLE"
}
{
  "code": 200,
  "content": {},
  "errorCode": "",
  "message": "",
  "success": true,
  "traceId": "TRACE-EXAMPLE"
}

Error Responses

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

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. A missing package, in-progress processing, or unavailability during reads 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 Resolution
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.
400 ft.RequestJsonFormatError Request JSON syntax is invalid Request JSON format error Correct the JSON based on content.reason, line, and column.
400 ft.JsonFormatError JSON top level is not an object Some json file format errors Submit an uploadId object.
404 ft.NotFoundRumSet Application is not in the current workspace, has been deleted, or does not exist Specified RUM setting not found Refresh the RUM application summary table and use the real appId in the current workspace.
406 ft.InvalidUploadId Session cache is invalid/replaced, the target generation status does not allow merging, or there are no chunks/numeric indexes are not consecutive Invalid UploadId value, or the task has been overwritten Verify the original uploadId and uploaded chunks; confirm the old session and publication status before reinitializing. Do not overwrite blindly.
409 ft.InvalidAction Upload/read/cleanup conflict, old directory takeover not completed, ownership/recovery pending verification, or environment/version exceeds the range allowed by the lifecycle Returns a specific localized prompt based on reasonCode, for example, SourceMap is being used by another upload, read, or cleanup operation Read content.reasonCode/action/retryable: for active_operation/active_upload, etc., back off as instructed; for owner_recovery_required/ownership_verification_required/legacy_invalid, etc., ask the 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 File relative path, symlink, or historical publishing path is unsafe The SourceMap file path does not meet requirements, or contains an unsupported link. Check the relative path and directory structure of the uploaded file. Use valid relative paths within the package, without .., backslashes, absolute paths, or symlinks; check reasonCode=invalid_path.
500 ft.InternalServerError Database, Redis, storage read/write, queue, or unhandled system exception Internal error Retain traceId, application/env/version/uploadId and first verify the list/file tree; a failure may already have published files or processing markers. Do not blindly overwrite or delete again.

Feedback

Is this page helpful?