Hi
Is Storage Configuration required if I am using SDK directly?
I am using Python SDK for conversion and comparison. I think Storage configuration si only required if I use REST API end points directly. Could you confirm?
I will appreciate it if you please elaborate on your question, so we will guide you exactly.
Furthermore, there is no difference between using GroupDocs Cloud APIs via a REST client or SDK. As GroupDocs Cloud SDKs are wrappers of GroupDocs Cloud APIs.
We use GroupDocs(Cloud) for word docx to PDF conversion and comparison.
We use GroupDocs Python SDK for that.
We have defined Storage configuration for AWS S3 in the GroupDocs dashboard.
Screenshot 2023-12-17 at 10.27.11 PM.png (235.9 KB)
It is called “Juddoc Comparison Storage”. However we never used this in our Python code while using Python SDK. So Where do we use this Storage configuration?
Thanks for your feedback. It depends on the method; it processes files from a local drive or cloud storage. For example, the GroupDocs.Conversion Cloud API provides two methods for the conversion. For example, please note that there are two types of methods. The ConvertDocument API method converts files from cloud storage, so you need to use cloud storage in this case. Whereas the ConvertDocumentDirect API method does not use cloud storage as it converts files from a local drive.
Thanks for the response. This clarify the scenario of doc conversion. Since we use ConvertDocumentDirect API method we don’t need storage configuration for conversion.
But what about scenario of comparison? When we compare two documents, do we need “Storage Configuration” ? If yes, how to use that?
Here is my code for Comparison.
app_sid = settings.GROUP_DOCS_CLIENT_ID
app_key = settings.GROUP_DOCS_CLIENT_SECRET
api = groupdocs_comparison_cloud.CompareApi.from_keys(app_sid, app_key)
source = groupdocs_comparison_cloud.FileInfo()
source.file_path = source_file_path
target = groupdocs_comparison_cloud.FileInfo()
target.file_path = target_file_path
options = groupdocs_comparison_cloud.ComparisonOptions()
options.source_file = source
options.target_files = [target]
options.output_path = f"{output_file_name}.{output_format}"
comparison_request = groupdocs_comparison_cloud.ComparisonsRequest(options)
response = api.comparisons(comparison_request)
As suggested in the documentation you need to upload the source and target documents to your cloud storage for comparison. Please check the following documentation to upload a file to cloud storage.
In my code snippet provided I am not using the “Strorage name”. But it still works. So my questions is where I am missing the Storage name? Could you please refer my code snippet and guide?
Please note that if you do not set the storage name explicitly in the request call, GroupDocs Cloud APIs will use the default storage of your application.
OK…now it is clear. Thanks for explaining.