Returns the storage endpoint URL for a bucket — or for whichever bucket a file lives in. Useful for orgs with more than one configured bucket, where different parent objects or file types can be routed to different buckets (and potentially different endpoints/regions).
This is an optional, supporting piece for anyone making their own direct calls to the storage backend (S3). Most integrations won't need it unless they're bypassing S-Drive's own upload/download flow.
How to call this method
global static String getS3Endpoint()
global static String getS3Endpoint(String objectId, String fileObjectName)
global static String getS3Endpoint(String bucketId)
Three ways to resolve an endpoint, depending on what you already know:
|
Overload |
Use it when... |
|---|---|
|
|
You just want your org's default configured bucket's endpoint. |
|
|
You already have an existing file record's own Id and its file object type, and want that specific file's bucket's endpoint. |
|
|
You already have a specific bucket's Id (from a |
Parameters
|
Parameter |
Type |
Description |
|---|---|---|
|
|
|
Id of the existing file record itself (not its parent record) — e.g. an Account File record's own Id. |
|
|
|
Full API name of the file object, e.g. |
|
|
|
Id of a specific |
Return value
Returns a String — the storage endpoint URL.
If your org hasn't configured Multi-Bucket Settings for that file object type, this returns your org's default bucket's endpoint without ever looking up the file record.
Example
String endpoint = cg.SDriveTools.getS3Endpoint(existingFile.Id, 'cg__AccountFile__c');