Testing AWS Rekognition from POSTMAN


I was trying AWS Rekognition & before using it in the app, i wanted to test with POSTMAN.
But unfortunately there are not many resources available to be useful.
Thus showing the simple way to setup POSTMAN.

Obviously before jumping to POSTMAN, we need to have an AWS account setup and a user been created. (The user should have Rekognition related permissions)
Also make sure to note the Access Key & Secret Key. 

Lets start the POSTMAN & create a new POST request.
The url to hit is https://rekognition.ap-south-1.amazonaws.com . It could change depending on your selected AWS region, mine is ap-south-1.




First thing to set is the Authorization & select "AWS Signature" from the Type.
Enter AccessKey, SecretKey which we noted while creating the new user.
AWS Region should be from url & Service Name is "rekognition".

We need to add 2 extra headers, "Content-Type" as "application/x-amz-jon-1.1" & "X-Amz-Target" could be "RekognitionService.IndexFaces".
I am using IndexFaces to get face details, there are other options available & can be found at https://any-api.com/amazonaws_com/rekognition/docs/API_Description


The Authorization Header will be added by POSTMAN when we send the request.

Now the next important thing is the Body of the request.
The body will be raw json similar to below 

{
"Attributes": [ "ALL" ],
"CollectionId" : "newCollection",
"Image": {
        "Bytes": "/9j/4AAQSkZJ...." }
}

The Bytes are the base64 string of the image. (You will need to create a new collection & can use CreateCollection API call)

Once all these values setup time to fire up the request.
And here is the response.




Hope this helps connecting to AWS Rekognition.

Happy Coding!!!
Parshuram Naik


Comments

Popular posts from this blog

6000 KM Road Trip

Export MS Access report to Excel..Font Problem