Backblaze-B2V4

 view release on metacpan or  search on metacpan

README.md  view on Meta::CPAN

token and upload URL.  You can retrieve these via b2\_get\_upload\_info()
with the bucket name as an argument.

Example:

        my $results = $b2->b2_get_upload_info(
          bucket_name => 'MyBucketName'
        );

The %$results hash now has 'upload\_url' and 'authorization\_token'

Note: You have to call b2\_get\_upload\_info on a bucket for each file
upload operation.  My b2\_upload\_file method does that for you, so that's
just FYI if you roll your own.

See: https://www.backblaze.com/b2/docs/b2\_get\_upload\_info.html

## send\_request

send\_request() handles all the communications with B2.
You should be able to use this to make calls not explicitly
provided by this library.

If send\_request() gets a 200 HTTP status from B2, then the call went
great, $b2->current\_status\_is\_not\_ok will be 0, and 
the JSON response will be returned.

If a 200 is not received from B2, $b2->current\_status\_is\_not\_ok
will be 1, and you can find an error in $b2->latest\_error()

Note that the base URL for this API session will be stored
under $b2->api\_info->{api\_url} so that you build a URL like so:

$list\_buckets\_url = $b2->api\_info->{api\_url}.'/b2api/v4/b2\_list\_buckets';

Example of a GET API request:

        my $response = $b2->send_request(
          url => 'https://SomeB2.API.URL?with=GETparams',
        );

Example of a POST API request:

        my $response = $b2->send_request(
          url => 'https://SomeB2.API.URL',
          post_params => {
            param1_name => 'param1_value',
            param2_name => 'param2_value',
            param3_name => 'param3_value',
          },
        );

See: https://www.backblaze.com/b2/docs/b2\_list\_buckets.html

# DEPENDENCIES

This module requires:

        Cpanel::JSON::XS
        Digest::SHA
        HTTP::Request
        LWP::Protocol::https
        LWP::UserAgent
        Marlin
        MIME::Base64
        Path::Tiny
        URI::Escape

# SEE ALSO

B2 API V4 Docs: https://www.backblaze.com/apidocs/b2-authorize-account

Paws::S3 - If using Backblaze's S3-compatible API.

# AUTHOR / BUGS

Eric Chernoff <eric@weaverstreet.net> - Please send me a note with any bugs or suggestions.

ESTRABD <estrabd@cpan.org> - Enhanced b2\_list\_file\_names() to fully use options and a great bugfix 
when using the 'file\_contents' option in the b2\_upload\_file() method.

# LICENSE

MIT License

Copyright (c) 2026 Eric Chernoff

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modi...

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDE...



( run in 0.602 second using v1.01-cache-2.11-cpan-acf6aa7dc9e )