b2_get_upload_part_url
    • Dark
      Light

    b2_get_upload_part_url

    • Dark
      Light

    Article Summary

    Get
    /b2api/v3/b2_get_upload_part_url

    PLEASE NOTE:

    This API request is now being described as a GET request and not a POST request, as was the case in previous versions of our documentation.

    We made this update because we believe that an API call that retrieves data and does not alter state is more accurately represented as a GET request.

    You may still make a POST request to this endpoint by simply submitting a JSON-formatted request body containing the parameters, with Content-Type set to application/json.


    Returns a URL to use for uploading parts of a large file

    When you upload part of a large file to B2, you must call b2_get_upload_part_url first to get the URL for uploading. Then, you use b2_upload_part on this URL to upload your data.

    An uploadUrl and upload authorizationToken are valid for 24 hours or until the endpoint rejects an upload, see b2_upload_file. You can upload as many files to this URL as you need. To achieve faster upload speeds, request multiple uploadUrls and upload your files to these different endpoints in parallel.

    API Versions

    v1: Application keys (July 26, 2018)

    Incompatible change: After calling b2_authorize_account with an application key that does not have the right permissions, this call will return a 401 Unauthorized.

    v1: Original release (September 22, 2015)

    Header parameters
    Authorization
    stringRequired

    An account authorization token, obtained from b2_authorize_account.
    The token must have the writeFiles capability.

    Query parameters
    fileId
    stringRequired

    The ID of the large file whose parts you want to upload.

    Responses
    200

    The request succeeded.


    The response headers include the Content-Type that was specified when the file was uploaded. They also include the X-Bz-FileName and X-Bz-Content-Sha1 headers, plus X-Bz-Info-* headers for any custom file info that was provided with the upload. The X-Bz-FileName uses percent-encoding, as if it were a URL parameter.

    object
    fileId
    string

    The unique ID of file being uploaded.

    Example4_ze73ede9c9c8412db49f60715_f200b4e93fbae6252_d20150824_m224353_c900_v8881000_t0001
    uploadUrl
    string

    The URL that can be used to upload parts of this file, see b2_upload_part.

    Examplehttps://pod-000-1016-09.backblaze.com/b2api/v3/b2_upload_part/4_ze73ede9c9c8412db49f60715_f200b4e93fbae6252_d20150824_m224353_c900_v8881000_t0001/0037
    authorizationToken
    string

    The authorizationToken that must be used when uploading files with this URL. This token is valid for 24 hours or until the uploadUrl endpoint rejects an upload, see b2_upload_part.

    Example3_20160409004829_42b8f80ba60fb4323dcaad98_ec81302316fccc2260201cbf17813247f312cf3b_000_uplg
    400
    statuscodedescription
    400bad_bucket_idThe requested bucket ID does not match an existing bucket.
    400bad_requestThe request had the wrong fields or illegal values. The message returned with the error will describe the problem.
    object
    status
    integer

    The numeric HTTP status code. Always matches the status in the HTTP response.

    Example400
    code
    string

    A single-identifier code that identifies the error.

    Exampleinvalid_bucket_name
    message
    string

    A human-readable message, in English, saying what went wrong.

    Examplebucket name is too long
    401
    statuscodedescription
    401bad_auth_tokenThe auth token used is not valid. Call b2_authorize_account again to either get a new one, or an error message describing the problem.
    401expired_auth_tokenThe auth token used has expired. Call b2_authorize_account again to get a new one.
    401unauthorizedThe auth token used is valid, but does not authorize this call with these parameters. The capabilities of an auth token are determined by the application key used with b2_authorize_account.
    403
    statuscodedescription
    403storage_cap_exceededUsage cap exceeded.
    503
    statuscodedescription
    503service_unavailableNo uploads available in vault <vaultId>.

    Was this article helpful?