# Postman API requests are not synchronized

**URL:** <https://community.postman.com/t/postman-api-requests-are-not-synchronized/54678>\
**Category:** Help Hub\
**Tags:** tests, collections, authentication, json, api\
**Created:** [November 16, 2023, 12:31pm UTC](https://community.postman.com/t/postman-api-requests-are-not-synchronized/54678 "2023-11-16T12:31:20Z")\
**Posts on this page:** 2\
**Page:** 2

<div class="post-metadata">

**Author:** ![Khushboo\_Postman](https://avatars.discourse-cdn.com/v4/letter/k/7ab992/32.png) [@Khushboo\_Postman](https://community.postman.com/u/Khushboo_Postman)\
**Post date:** [December 19, 2023, 6:38am UTC](https://community.postman.com/t/postman-api-requests-are-not-synchronized/54678/21 "2023-12-19T06:38:07Z")

</div>

Hi Everyone,

Thanks, it is working now I want to share my code it may help someone like me 😛

Post api call for Search API

Pre request  
var nextIndexQ = +parseInt(pm.environment.get(‘nextIndexQ’));

newqr = JSON.parse(pm.environment.get(“Qstring”));

console.log(nextIndexQ)

pm.environment.set(‘currentQ’, newqr[nextIndexQ]);

nextIndexQ = nextIndexQ + 1;

if(nextIndexQ \< newqr.length){

postman.setNextRequest(‘SearchJob’);

}

else

{

console.log(“No data”)

}

pm.environment.set(“nextIndexQ”, nextIndexQ);

**Body**  
“query”: {{currentQ}},  
“from”: “{{fromDate}}”,  
“to”: “{{toDate}}”,  
“timeZone”: “IST”,  
“byReceiptTime”: true  
**Test tab**

collected response and saved ids from each responses and used it in a next job call.

---

<div class="post-metadata">

**Author:** ![system](https://sea2.discourse-cdn.com/getpostman/user_avatar/community.postman.com/system/32/29796_2.png) [@system](https://community.postman.com/u/system)\
**Post date:** [January 18, 2024, 6:38am UTC](https://community.postman.com/t/postman-api-requests-are-not-synchronized/54678/22 "2024-01-18T06:38:48Z")

</div>

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.

[Previous page](https://community.postman.com/t/postman-api-requests-are-not-synchronized/54678.md?page=1)
