Skip to content

Multipart Upload Initialization



POST /api/v1/rum_sourcemap/multipart_upload_init

Overview

Initialize a SourceMap ZIP multipart upload for the specified RUM environment and version.

Prerequisites and Usage Steps

The current key must have rum.rumCfgManage. It applies only to the workspace to which the current key belongs. Obtain appId from content[].appId in the RUM application quick list; it must match the app_id in SDK/error records and cannot be replaced by the database internal UUID. SourceMap is identified precisely by application, environment env, and version version; case and whitespace are part of the identifier itself and must exactly match the collection records. An omitted env/version or an empty string indicates an empty environment/version, not a wildcard for all. The current managed lifecycle requires each to be at most 256 characters.

See SourceMap multipart upload related API usage instructions for the workflow, and refer to the multipart upload operations documentation. The sequence is: initialize → upload all parts of the original ZIP → verify the part list → complete → query version status and file tree. A successful initialization/complete does not mean the ZIP has been validated or can be parsed; states such as processing/failed/blocked still require further verification.

First generate the complete ZIP locally, then split it in byte order into parts each no larger than 10 MiB. needCover=false by default does not overwrite. If a record already exists for the current environment/version, HTTP 200 returns uploadId="" and existsSameFile=true; the caller should first confirm the old version, then decide whether to reinitialize with needCover=true. Do not continue uploading with an empty ID. Overwriting uses a new generation; published content is replaced only after upload/decompression validation completes. Do not treat needCover as immediately clearing the old directory.

existsOldTask only indicates that a cache already exists in the same scope; it does not prove that the old task can still be resumed or that a writable session has been obtained for this request. Concurrent upload/recovery/cleanup may still return 409; do not initialize multiple times simultaneously. After a non-empty uploadId is returned, save the original value. The session is valid for 1 hour by default, and part requests do not extend it. The first access safely takes over the historical directory/index. If the old upload/index has not completed, wait as prompted by the 409 response or ask an administrator to verify.

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

Body Request Parameters

Parameter Type Required Description
needCover boolean Optional boolean, default false. When false, if a published record exists, returns an empty uploadId for confirmation; when true, allows preparing a replacement generation, still subject to concurrency/ownership/history safety restrictions, and does not overwrite other environments/versions.
Null allowed: False
Example: false
How to obtain or enter: First check the version list to confirm whether replacement of this environment/version is allowed.
appId string Y Required. Active application identifier in the current workspace; it is not the internal RumCfg UUID and cannot be used across workspaces.
Null allowed: False
Example: payment_web
How to obtain or enter: Obtain from content[].appId in the RUM application quick list or from the app_id of an error record.
version string Optional string, empty version by default, up to 256 characters; does not mean the latest/all versions, and null is not allowed.
Null allowed: False
Empty string allowed: True
Example: 1.2.3
How to obtain or enter: Obtain from the actual version released by the client or the version of an error record, corresponding to the build artifact.
env string Optional string, empty environment by default, up to 256 characters; does not mean all environments, and null is not allowed.
Null allowed: False
Empty string allowed: True
Example: production
How to obtain or enter: Obtain from the client release environment or the env of an error record, and keep it exactly consistent with the upload.

Additional Parameter Notes

See SourceMap multipart upload related API usage instructions for the workflow, and refer to the multipart upload operations documentation. The sequence is: initialize → upload all parts of the original ZIP → verify the part list → complete → query version status and file tree. A successful initialization/complete does not mean the ZIP has been validated or can be parsed; states such as processing/failed/blocked still require further verification.

Request Example

curl --request POST 'https://openapi.guance.com/api/v1/rum_sourcemap/multipart_upload_init' \
  -H 'DF-API-KEY: <DF-API-KEY>' \
  -H 'Content-Type: application/json' \
  --data-raw '{"appId":"payment_web","env":"production","version":"1.2.3","needCover":false}'

Response

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

Field Type Description
content.uploadId string Non-empty only allows part uploads to continue; empty string when an existing version is found and overwrite is not enabled.
content.existsOldTask boolean Indication that a task cache already exists in the same scope; not a guarantee of session validity or successful overwrite.
content.existsSameFile boolean Indication that a version record already exists; not equivalent to all source files being validated.
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 the entity's own business fields with the same name.
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; cannot be used alone to replay a published write.
content.actualBytes integer Some capacity errors only: number of bytes counted.
content.maxBytes integer Capacity/read limit in bytes.
content.workspaceUUID string Restricted diagnostics for some errors: UUID of the current workspace.
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 Diagnostics for some errors: environment.
content.version string Diagnostics for some errors: version.
content.bundleUUID string Diagnostics for some errors: ID of the current generation record, not the uploadId.
content.state string Diagnostics for some errors: generation state.
content.resource string Diagnostics for some usage conflicts: resource type, such as application/bundle.
content.shared boolean Diagnostics for some usage conflicts: whether access is shared.
content.waitedSeconds number Diagnostics for some usage conflicts: number of seconds already waited.
content.waitSeconds number Diagnostics for some usage conflicts: number of seconds allowed to wait.
content.waitExhausted boolean Diagnostics for some usage conflicts: whether the wait was exhausted.
content.elapsedSeconds number Diagnostics for some single-file errors: operation duration in seconds.
content.phase string Diagnostics for some errors: failure phase.
content.phaseElapsedSeconds number Diagnostics for some errors: phase duration in seconds.
{
  "code": 200,
  "content": {
    "uploadId": "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaabbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb",
    "existsOldTask": false,
    "existsSameFile": false,
    "declaration": {}
  },
  "errorCode": "",
  "message": "",
  "success": true,
  "traceId": "TRACE-EXAMPLE"
}
{
  "code": 200,
  "content": {
    "uploadId": "",
    "existsOldTask": false,
    "existsSameFile": true,
    "declaration": {}
  },
  "errorCode": "",
  "message": "",
  "success": true,
  "traceId": "TRACE-EXAMPLE"
}

Error Responses

See Common Error Definitions for authentication, rate limiting, and common request errors.

Storage lifecycle retains compatible error codes: 409 is usually still ft.InvalidAction; the localized message and content.reasonCode further distinguish the cause. Do not treat message names such as SourceMapOperationBusy as the mandatory errorCode. Reading a missing package/processing/unavailable state usually returns 404 ft.SourceMapPackageNotFound; see reasonCode for the specific cause. Back off and retry only when retryable=true is explicitly returned and the current state allows it; when uploadCommitted=true, do not replay a write that has 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.
400 ft.RequestJsonFormatError Invalid request JSON syntax Request JSON format error Fix the JSON according to content.reason, line, and column.
400 ft.JsonFormatError The JSON top level is not an object Some JSON file format error Submit an object.
404 ft.NotFoundRumSet The application is not in the current workspace, has been deleted, or does not exist Specified RUM setting not found Refresh the RUM application quick list and use a real appId in the current workspace.
409 ft.InvalidAction Upload/read/cleanup conflict, old directory takeover incomplete, ownership/recovery pending verification, or environment/version outside the lifecycle allowed range Returns a specific localized prompt based on reasonCode, such as 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 an administrator to verify first; do not delete occupied records or force an overwrite yourself. For invalid_scope, check that env/version are at most 256 characters.
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 marks, so do not blindly overwrite/delete again.

Feedback

Is this page helpful?