Hi i am trying to connect to get my 3rd party storage file list.
here is my errors
Exception in thread "main" com.aspose.storage.client.ApiException: {"Message":"Authentication failed!"}
at com.aspose.storage.client.ApiInvoker.invokeAPI(ApiInvoker.java:284)
at com.aspose.storage.api.StorageApi.GetListFiles(StorageApi.java:587)
at wordleMain.aposeCloudTest.main(aposeCloudTest.java:12)
Here is my code
package wordleMain;
import com.aspose.storage.api.StorageApi;
import com.aspose.storage.model.FilesResponse;
public class aposeCloudTest {
public static void main(String[] args) {
StorageApi api = new StorageApi("https://api.aspose.cloud/v1.1", "<key>", "<sid>");
String path = "/";
String storage = null;
FilesResponse response = api.GetListFiles(path, storage);
System.out.println(response.toString());
}
}
Maybe i am getting my key incorrectly?
@Corvettemina1
It seems you are using obsolete API Version V1.1. Please note in the latest API versions we have included the storage operation in each Cloud Product. So you do not need to use Aspose.Storage Cloud API anymore. Please find the sample working Java code of Aspose.Words Cloud SDK for Java. Hopefully, it will help you to accomplish the task.
package aspose.example.asposeWordCloud;
import java.io.IOException;
import java.nio.file.Files;
import java.nio.file.Paths;
import javax.mail.MessagingException;
import com.aspose.words.cloud.ApiException;
import com.aspose.words.cloud.api.WordsApi;
import com.aspose.words.cloud.model.FilesList;
import com.aspose.words.cloud.model.requests.*;
public class AWStorageTests {
public static void main(String[] args) throws ApiException, MessagingException, IOException {
WordsApi wordsApi = new WordsApi("xxxxxx-xxxx-xxxx-xxxx-xxxxxxxx", "xxxxxxxxxxxxxxxxxxx",
"https://api.aspose.cloud");
String path = "/";
String storage = null;
GetFilesListRequest request = new GetFilesListRequest(path, storage);
FilesList result = wordsApi.getFilesList(request);
System.out.println(result);
System.out.println("api request completed...");
}
}