# AWS Signatures with pm.sendrequest

**URL:** <https://community.postman.com/t/aws-signatures-with-pm-sendrequest/15338>\
**Category:** Help Hub\
**Created:** [August 26, 2020, 6:06pm UTC](https://community.postman.com/t/aws-signatures-with-pm-sendrequest/15338 "2020-08-26T18:06:17Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![dwdmeglio](https://avatars.discourse-cdn.com/v4/letter/d/7c8e57/32.png) [@dwdmeglio](https://community.postman.com/u/dwdmeglio)\
**Post date:** [August 26, 2020, 6:06pm UTC](https://community.postman.com/t/aws-signatures-with-pm-sendrequest/15338/1 "2020-08-26T18:06:17Z")

</div>

If I am using pm.sendRequest, how do I go about generating an AWS Signature? I need to create some tests that involve polling an SQS queue to ensure certain messages are delivered. However, that means I need pm.sendRequest to make repeated calls to polls the SQS and delete the messages off. I’m not seeing a way to this.

---

<div class="post-metadata">

**Author:** ![vdespa](https://sea2.discourse-cdn.com/getpostman/user_avatar/community.postman.com/vdespa/32/2770_2.png) [@vdespa](https://community.postman.com/u/vdespa)\
**Post date:** [August 27, 2020, 12:47pm UTC](https://community.postman.com/t/aws-signatures-with-pm-sendrequest/15338/2 "2020-08-27T12:47:45Z")

</div>

Don’t use pm.sendRequest for this as you don’t want to compute the signature.

Just reuse a regular Postman request. You can use postman.setNextRequest to retry the same request.

---

<div class="post-metadata">

**Author:** ![dwdmeglio](https://avatars.discourse-cdn.com/v4/letter/d/7c8e57/32.png) [@dwdmeglio](https://community.postman.com/u/dwdmeglio)\
**Post date:** [August 27, 2020, 1:00pm UTC](https://community.postman.com/t/aws-signatures-with-pm-sendrequest/15338/3 "2020-08-27T13:00:16Z")

</div>

That’s what I’ve done, it just seems kludgy. I am polling an SQS Queue and iterating the messages to make sure I receive what I expect. So I have to basically call the same request in a loop.

---

<div class="post-metadata">

**Author:** ![vdespa](https://sea2.discourse-cdn.com/getpostman/user_avatar/community.postman.com/vdespa/32/2770_2.png) [@vdespa](https://community.postman.com/u/vdespa)\
**Post date:** [August 27, 2020, 1:01pm UTC](https://community.postman.com/t/aws-signatures-with-pm-sendrequest/15338/4 "2020-08-27T13:01:35Z")

</div>

How would that be different with pm.sendRequest? You would still be polling, right?

---

<div class="post-metadata">

**Author:** ![dwdmeglio](https://avatars.discourse-cdn.com/v4/letter/d/7c8e57/32.png) [@dwdmeglio](https://community.postman.com/u/dwdmeglio)\
**Post date:** [August 27, 2020, 1:13pm UTC](https://community.postman.com/t/aws-signatures-with-pm-sendrequest/15338/5 "2020-08-27T13:13:21Z")

</div>

I don’t have the risk of someone doing something as simple and seemingly innocuous as renaming a request breaking the whole loop because setNextRequest expects the request name and doesn’t even seem to fail if you specify an invalid name…

---

<div class="post-metadata">

**Author:** ![vdespa](https://sea2.discourse-cdn.com/getpostman/user_avatar/community.postman.com/vdespa/32/2770_2.png) [@vdespa](https://community.postman.com/u/vdespa)\
**Post date:** [August 27, 2020, 1:20pm UTC](https://community.postman.com/t/aws-signatures-with-pm-sendrequest/15338/6 "2020-08-27T13:20:24Z")

</div>

Use the requestId instead of the request name, if this is your concern.  
You can get it from the pm.info object.

---

<div class="post-metadata">

**Author:** ![navigation-particip2](https://avatars.discourse-cdn.com/v4/letter/n/8e7dd6/32.png) [@navigation-particip2](https://community.postman.com/u/navigation-particip2)\
**Post date:** [July 15, 2024, 8:03am UTC](https://community.postman.com/t/aws-signatures-with-pm-sendrequest/15338/7 "2024-07-15T08:03:57Z")

</div>

This is an old thread, but incase anybody finds it and has a similar need here is a solution that worked for me that got posted [here](https://community.postman.com/t/accessing-awt-signature-authentication-via-pm-sendrequest/63944/7)

```auto
pm.sendRequest({
    url: "https://ssm.eu-central-1.amazonaws.com",
    method: "POST",
    header: {
        'Content-Type': 'application/x-amz-json-1.1',
        'X-Amz-Target': 'AmazonSSM.GetParameter'
    },
    auth: {
        type: "awsv4",
        "awsv4": {
            "accessKey": "$ACCESSKEY",
            "secretKey": "$SECRET",
            "region": "eu-central-1",
            "service": "ssm",
            "sessionToken": "$SESSION_TOKEN"
        }
    },
    body: .....
}, function (err, response) {
    ....
});

```
