Use this tag for issues with pre-request scripts in postman, use the "postman" tag for general issues
Questions tagged [postman-pre-request-script]
319 questions
2
votes
2 answers
Sending dynamic variables in sendgrid v3 body using postman
I am trying to send the emails via Sendgrid using v3 API using postman, I have created 3 separate variables in 3 different requests, I want to pass all those 3 variables in a single mail, for that I have used below sendgrid
…

Rajashekar
- 23
- 1
- 7
2
votes
1 answer
Postman Pre-Request Script to create JWT for Google Service Account
I am trying to create a JWT to get an access token for a Google Service Account to use in a Postman Pre-Request script.
But I keep getting this error in the Postman Console:
Error:
And in the Postman Response window I get:
There was an error in…

Kyle Calica-St
- 2,629
- 4
- 26
- 56
2
votes
3 answers
There was an error in evaluating the Pre-request Script: ReferenceError: $randomEmail is not defined
I'm trying to send a POST request to create a user using Postman. Require dynamic user email and password for that.
I'm trying assign value in new variable return from Postman inbuilt variable $randomEmail in Pre-request Script -
var new_user_email…

Nik
- 204
- 3
- 20
2
votes
3 answers
get key:value pair inside sub-blocks
I have the below output from Postman or hitting end point(we can say).
{
"SearchResult": {
"total": 11,
"resources": [
{
"id": "12345",
"name": "GuestType",
"description": "Identity group ",
},
{
…

impika
- 107
- 3
- 11
2
votes
3 answers
Postman Pre-request Script for authorization bearer token
I'm trying to make script to generate my authentication bearer token for collections. so I don't have to pass token each time and I will Inherit auth from parent. But I don't know where I'm wrong in script, I'm not able to generate token and it…

nancy
- 89
- 1
- 1
- 9
2
votes
0 answers
Postman sendrequest html render
if I want to use postman to sendRequest to an html page (as part of a pre-request script), is there any way I can wait for it to fully render before getting the response?
My html page has ajax calls - currently
sendRequest(credentials,…

user2047485
- 391
- 5
- 20
2
votes
1 answer
Using Postman runner to call API n times for benchmark testing
I am writing a new API and want to be able to see how it fairs when hit with n requests.
I have tried to setup environment variables and use the runner tool within Postman to no avail.
End goal is to run it n times, where I pass in the value of [n]…

andrewb
- 2,995
- 7
- 54
- 95
2
votes
2 answers
How to run a pre-defined postman request in a collection before running current one?
I need to run another request before running my current one.
The reason I need to do this is because the other request creates a token using an API key. I then set the token in an environment variable to authenticate the method I'm trying to run. …

sendricardo
- 31
- 1
- 3
2
votes
1 answer
Get redirected URL from Postman
I'm currently migrating my old website to a new one and I have just created some url redirect rules to redirect old links to their pages on the new website.
In order to test these redirect rules I'm using Postman but I can't find any way of getting…

MrPickles2009
- 117
- 4
- 10
2
votes
1 answer
Postman multiple image
I'm not able to select multiple images in postman. Is their any script using which we can select multiple image? please help

pratik kolhe
- 21
- 1
2
votes
1 answer
Trying to call cognito token from postman script
Working within Postman I'm trying to call a jwtToken from Cognito using node's aws-sdk but I'm getting the following error:
There was an error in evaluating the Pre-request Script: Error: Cannot find module 'aws-sdk'
This is my scrypt:
const AWS…

Sebastian Carpaneto
- 43
- 3
1
vote
1 answer
postman body get the last 3 characters on the username
{
"data": {
"username": "tell1535",
"password": "{{encryptedPassword}}",
"type": "session"
}
}
this is the body of my postman request
is there a way to use the value of username in pre request tab and set a value…

guradio
- 15,524
- 4
- 36
- 57
1
vote
0 answers
Automatically Handling File Paths in Postman Collections When Transferring to Another Computer
I have a file in my postman request, and the file's path is specific to my own computer. When I transfer this collection to a different computer, the old computer's path remains, and I have to change it again. How can I automatically find this path…

pacmantester
- 11
- 2
1
vote
0 answers
How To Run Postman Collection Again, Passing A Different Value Into Environment Variable?
I have some Postman tests to run.
The majority of them are GET requests, with the following URL:
{{BASE_URI}}/api/controlli-formali/controlla-dominio-dati/2020/1?stato_controllo_attivo=1.
I wanted to know if it is possible, and in which way…

marramatteo
- 13
- 2
1
vote
2 answers
OpenAPI Authentication issues - signature calculation
I am working on a project for an integration with HikCentral Professional OpenAPI.
I want to send a couple of requests to the API but I am unable to properly authenticate.
I have created partner appKey and appSecret but based on the documentation I…

vsapountzis
- 618
- 3
- 11
- 28