IPWorks Cloud 2020 C++ Edition

Questions / Feedback?

GetDownloadAuthToken Method

Create a download authorization token for one or more files in a bucket.

Syntax

ANSI (Cross Platform)
char* GetDownloadAuthToken(const char* lpszAllowedBucketId, const char* lpszAllowedPrefix, int iValidityDuration);

Unicode (Windows)
LPWSTR GetDownloadAuthToken(LPCWSTR lpszAllowedBucketId, LPCWSTR lpszAllowedPrefix, INT iValidityDuration);
- (NSString*)getDownloadAuthToken:(NSString*)allowedBucketId :(NSString*)allowedPrefix :(int)validityDuration;
#define MID_BACKBLAZEB2_GETDOWNLOADAUTHTOKEN 19

IPWORKSCLOUD_EXTERNAL int IPWORKSCLOUD_CALL IPWorksCloud_BackblazeB2_Do(void *lpObj, int methid, int cparam, void *param[], int cbparam[], int64 *lpllVal);

Remarks

This method creates and returns a download authorization token for the files in the bucket specified by AllowedBucketId whose names start with AllowedPrefix. The newly-created token will remain valid for the number of seconds specified by ValidityDuration, which must be a value in the range 1 to 604800 (1 week), inclusive.

Download authorization tokens created using this method can be used by anybody to download an applicable file by name; they cannot be used to download a file by Id. Refer to the DownloadFile method for more information.

The currently-authenticated application key must have the shareFiles capability to call this method successfully, otherwise the server will return an error. Refer to the AccountCapabilities property for more information.

Error Handling (C++)

This method returns a String value; after it returns, call the GetLastErrorCode() method to obtain its result code; 0 indicates success, while a non-zero error code indicates that this method encountered an error during its execution. If an error occurs, the GetLastError() method can be called to retrieve the associated error message.

Copyright (c) 2022 /n software inc. - All rights reserved.
IPWorks Cloud 2020 C++ Edition - Version 20.0 [Build 8265]