0

In my project,I need to send request ID in request for postman API testing. It is a google server based application project.For job creation in application,an unique ID will be sent along with required details in request as json format.

That ID will not be same for all request.It will be vary on every request. I couldn't get via API backend calls.Is any possible to generate it by postman pre-requiste script???

Thanks in advance

IshuVisha
  • 13
  • 3
  • Is it just a random Id that you need to generate with the request? You could use `"{{$guid}}"` in the payload if it's just random id. Can you provide an example request body? – Danny Dainton Jan 19 '23 at 08:29
  • It's always worth noting that the information in your question is vague which is not helpful for the people you're hoping to answer it. I would recommend following this guide when asking questions here https://stackoverflow.com/help/how-to-ask – Danny Dainton Jan 19 '23 at 08:32
  • @DannyDainton Hi.... I have done as you said.I am gettting response as below.... [ { "type": 1, "message": "Invalid Request. File Name is invalid." } ] – IshuVisha Jan 19 '23 at 08:40
  • 1
    I have no idea what you're sending, what should be sent or what the response should be. Edit your original question with more details and provide examples. – Danny Dainton Jan 19 '23 at 09:00

1 Answers1

0

you use guid in Pre-request Script like this:

let uuid = require('uuid');   
var gid = uuid.v4(); //now you can pass gid where ever you need unique id.
shyam yadav
  • 214
  • 1
  • 10