# How to grab variable from one API and add it to the endpoint of another api so it is called many times?

**URL:** <https://community.postman.com/t/how-to-grab-variable-from-one-api-and-add-it-to-the-endpoint-of-another-api-so-it-is-called-many-times/16446>\
**Category:** Help Hub\
**Created:** [October 2, 2020, 9:58pm UTC](https://community.postman.com/t/how-to-grab-variable-from-one-api-and-add-it-to-the-endpoint-of-another-api-so-it-is-called-many-times/16446 "2020-10-02T21:58:45Z")\
**Posts on this page:** 1\
**Showing post:** 31

<div class="post-metadata">

**Author:** ![shahbaz.shiekhqa](https://avatars.discourse-cdn.com/v4/letter/s/c5a1d2/32.png) [@shahbaz.shiekhqa](https://community.postman.com/u/shahbaz.shiekhqa)\
**Post date:** [October 16, 2020, 2:04pm UTC](https://community.postman.com/t/how-to-grab-variable-from-one-api-and-add-it-to-the-endpoint-of-another-api-so-it-is-called-many-times/16446/31 "2020-10-16T14:04:00Z")

</div>

Hi gpub,

thanks but its more about getting the contentid which is within the contents nested array  
and add it an array where i can use in the next request

this is the question over here if you could please analyze and help here …

> [@How to grab variable from one API that is within a nested Array response body?](https://community.postman.com/t/how-to-grab-variable-from-one-api-that-is-within-a-nested-array-response-body/16758):
>
> How to grab the contentID and content title add it within an array and have it used in the URL of API 2 if i use the code below for section title and sectionid it is working because it is not in an nested array but for the contentid and contenttitle it is not working as it is in a nested array. API 1 test tab i have: for (i = 0; i \< resultCount; i++) { var id = jsonData[i].contents[0].contentId; var modelString = jsonData[i].contents[0].contentTitle; console.log(id) console.log(modelStrin…

---

_[View the full topic](https://community.postman.com/t/how-to-grab-variable-from-one-api-and-add-it-to-the-endpoint-of-another-api-so-it-is-called-many-times/16446)._
