Textrack - An error occurred (InvalidParameterException) when calling the AnalyzeDocument operation: Request has invalid parameters

0

Hi everyone, this is my first postQuestion, so im sorry if i broke any rule šŸ˜…. I try to extract some text from a PDF file and when the script run i have this message error with queries method analyze document. The thing is, the bucket is enable, the file exists in this path and the queries object are too simple. There is something on my syntax what be wrong or missing some params?

Error message An error occurred (InvalidParameterException) when calling the AnalyzeDocument operation: Request has invalid parameters

My boto3 version is 1.34.54

queries = [ {'Text': 'TextOnDoc', 'Alias': 'AliasName'} ]

TextrackClient.analyze_document(
      Document={'S3Object': {'Bucket': 'ActiveBucketName', 'Name': "folderOnBucket/file.pdf"}},
      FeatureTypes=["QUERIES"],
      QueriesConfig={ "Queries": queries }
)

if someone would be helpme, i really will preciate it I have seen some similar unanswered cases in the forum

Claudio Alvarez

profile picture
Claudio
asked 2 months ago198 views
1 Answer
1
Accepted Answer

Hello.

I looked at the documentation below and I thought your Python code was correct.
If possible, why not try using a different version of Boto3?
It is possible that changing the version may resolve the issue.
https://boto3.amazonaws.com/v1/documentation/api/latest/reference/services/textract/client/analyze_document.html

By the way, were there any other error messages output?
For example, can you check if there are any messages stating that there is a problem with a particular parameter?

profile picture
EXPERT
answered 2 months ago
profile picture
EXPERT
reviewed 2 months ago
  • I'll try made a downgrade of boto3 and run the same script. For the other hand i try configured cloudwatch logs in My aws console but i failed ajjajaj šŸ«  just to know where textract has the conflict

    Thanks for your answer

  • Hi Riku, after some hours ajajaj i solved this issue about the invalid params. The thing is the document are in Spanish and some Text inside the queries object have a special character like "Ć”". I just remove from the text and it works

    Again, thanks for your support :)

You are not logged in. Log in to post an answer.

A good answer clearly answers the question and provides constructive feedback and encourages professional growth in the question asker.

Guidelines for Answering Questions