Hello ,
I have been merging PDFs using Aspose’s “default storage” without issues for a long time, but today the same request suddenly stopped working and now returns 400 Bad Request
with errorAmazonS3Storage
. My call is PUT https://api.aspose.cloud/v3.0/pdf/output.pdf/merge?storage=&folder=X
I don’t understand why this error appears — please help me.
What the errorAmazonS3Storage
means
errorAmazonS3Storage
is returned by the Aspose Cloud service when the request is routed to the Amazon‑S3 based storage that backs the default Aspose Cloud storage, but the request does not contain a valid S3 configuration (access key, secret key, bucket, region, etc.).
If you have always been using the default storage without specifying a storage
parameter, the SDK internally uses the Aspose Cloud default bucket that is created for your client‑id/secret pair.
When something changes on the server‑side (e.g., bucket name is regenerated, region is changed, or the bucket is temporarily unavailable) the service returns 400 Bad Request with errorAmazonS3Storage
.
Quick checklist that resolves the issue in most cases
Step | What to do | Why it helps |
---|---|---|
1. Remove the empty storage= query string |
Change the URL from …/merge?storage=&folder=X to …/merge?folder=X (or simply omit the whole query string if you are not using additional parameters). |
An empty storage value forces the API to try to treat it as a custom S3 bucket, which fails. |
2. Verify your OAuth token | Make sure the access token you are sending in the Authorization: Bearer <token> header was obtained after the last time you regenerated your client secret. |
A token tied to a different client‑id/secret can point to a non‑existent default bucket. |
3. Confirm that the default storage is still active | Log in to the Aspose Cloud Dashboard → Storage page and check that the bucket listed under Default Storage is present and not marked as Deleted. | If the bucket was removed (e.g., because of inactivity), the service returns the S3 error. |
4. (Optional) Explicitly specify the default storage name | Use storage=Default (or the exact bucket name shown in the dashboard) in the request: PUT https://api.aspose.cloud/v3.0/pdf/output.pdf/merge?storage=Default&folder=X . |
Explicitly telling the API which bucket to use avoids the empty‑storage ambiguity. |
5. Test with a simple file operation | Try a lightweight call, e.g., GET https://api.aspose.cloud/v3.0/storage/file/<some‑existing‑file>?storage=Default . If this also fails with errorAmazonS3Storage , the problem is storage‑wide, not PDF‑specific. |
Confirms whether the issue is with the bucket itself. |
Example: C# SDK call that works
// 1️⃣ Obtain access token (client_id & client_secret from Aspose Cloud Dashboard)
var token = await new OAuthApi()
.GetTokenAsync(clientId, clientSecret);
// 2️⃣ Create PdfApi instance with the token
var pdfApi = new PdfApi(clientId, clientSecret);
pdfApi.Configuration.AccessToken = token.AccessToken;
// 3️⃣ Prepare merge request – note: *no* empty storage parameter
var request = new MergeDocumentsRequest
{
Name = "output.pdf",
Folder = "X", // folder in the default storage
// Storage = null (or omit) – let the API use the default bucket
};
var response = await pdfApi.PutMergeDocumentAsync(request);
Console.WriteLine($"Pages merged: {response.Code}");
If you prefer to pass the storage name explicitly:
request.Storage = "Default"; // replace with the bucket name shown in the dashboard
Why it started “suddenly”
- Bucket rotation – Aspose Cloud may recycle inactive default buckets after a certain period.
- Client‑secret regeneration – If you regenerated the secret in the dashboard, previously issued tokens become invalid for storage operations.
- Region changes – The underlying S3 bucket could have been moved (e.g., from
us-east-1
toeu-west-1
) and the service temporarily rejected the request.
In all of these scenarios the API response contains errorAmazonS3Storage
.
Next steps for you
- Update the request URL – remove the empty
storage=
or replace it with the actual storage name. - Regenerate a fresh access token (if you haven’t done so in the last 24 h).
- Check the Storage page in the Aspose Cloud Dashboard to confirm the default bucket is active.
- Re‑run the merge operation.
If the problem persists after performing the steps above, please reply with the following information so we can dig deeper:
- The exact request URL you are using (including any query parameters).
- The code snippet (language/SDK version) that builds and sends the request.
- The OAuth token generation method you are using (client‑id/secret pair).
- Whether any recent changes were made to the Aspose Cloud Dashboard (e.g., regenerated client secret, deleted a bucket, etc.).
Helpful links
- PDF API – Merge Documents: https://docs.aspose.cloud/pdf/merge
- Storage API – Working with default storage: https://docs.aspose.cloud/common/storage/
- OAuth authentication: https://docs.aspose.cloud/common/authentication/
Feel free to post the additional details, and we’ll help you get the merge working again!