I have successfully figured out how to display singular API data but have faced an issue. - I am trying to use the following API to return the data of "data" using the "following" shown in the next API example.
For this to be completed, two following API's are used.
- is used to return "data" to be further used to retrieve "Following data" in the API in question.
- is used to get the "data" to access the "following data" previously.
Sorry, I am very stuck and have no idea what I have done wrong. Below is my attempted code, I hope this is helpful and explained well.
let response1 = await $.ajax({
method: 'GET',
url: '',
});
let response2 = await $.ajax({
method: 'GET',
url: ''
});
let response3 = await $.ajax({
method: 'GET',
url: ''
});
const result = response3.find(item => item.ID === response2.result === response1.result.codes)
console.log(result.ID);
})();
response2is an array of objects, therefore you need to loop through it and or pull out a specific object in that array. In either case you need to accessresponse2.resultby index.