I am trying to run the Document analysis request with the use of an S3 bucket, but it is giving me an internal error. I extracted table values from a document. Here is my code. Please note and using the AWS SDK for .Net.
public async Task<IActionResult> Index()
{
var res = await StartDocumentAnalysis(BucketName, S3File, "TABLES");
return View();
}
public async Task<string> StartDocumentAnalysis(string bucketName, string key, string featureType)
{
var request = new StartDocumentAnalysisRequest();
var s3Object = new S3Object
{
Bucket = bucketName,
Name = key
};
request.DocumentLocation = new DocumentLocation
{
S3Object = s3Object
};
request.FeatureTypes = new List<string> { featureType };
var response = _textract.StartDocumentAnalysisAsync(request).Result;
WaitForJobCompletion(response.JobId, 5000);
return response.JobId;
}
Error message:
Internal error Unable to get object metadata from S3. Check object key, region and/or access permissions in aws Textract awssdk.core