aws-samples / amazon-textract-code-samples

Amazon Textract Code Samples
MIT No Attribution
422 stars 260 forks source link

InvalidParameterException when starting a Textract job using SNS Notification channel. #6

Closed prashanthayyavu closed 4 years ago

prashanthayyavu commented 4 years ago

When I start a textract StartDocumentTextDetection and try to set the NotificationChannel as follows

 response = client.start_document_text_detection(
        DocumentLocation={
            'S3Object': {
                'Bucket': s3BucketName,
                'Name': objectName
            },
        },
        ClientRequestToken='string',
        JobTag='string',
        NotificationChannel={
            'RoleArn': snsRoleArn,
            'SNSTopicArn': snsTopicArn
        }
    )

I am getting an InvalidParameterException

An error occurred (InvalidParameterException) when calling the StartDocumentTextDetection operation: Request has invalid parameters

python 3.7 boto3 1.12.35

darwaishx commented 4 years ago

https://github.com/aws-samples/amazon-textract-serverless-large-scale-document-processing Sample implementation above has example of passing SNS info to start call.