Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

99
Views
How to reset the next_page url to list out the whole data in javascript

How can I set the "next_page" url to replace the GetUrl until the "next_page" is null?

The first "GetUrl", I need to set it manually. And then I will get the data which include "next_page" value. I would like to call back the function and reset the "GetUrl" till it's null. So that I can be able to list the whole data from the API. Can someone help to give some suggestion how I can do it in JavaScript? Thanks .

const getFieldsFromApi = async () => {
    const GetUrl = "abc.net"
    const Doorkey = {username: "token", password: "token"}
    const response = await Axios.get(GetUrl, {auth: Doorkey})
    // console.log ("here I am able to console.log the next_page url", response.data.next_page)
    return response.data.users
}

const getData = async () => {
    const values = await getFieldsFromApi()
    values.forEach(field => {
        const row = document.createElement("tr");
        row.appendChild(addCell(field.name));
        row.appendChild(addCell(field.email)); 
        tblbody.appendChild(row);
    })
};
about 4 years ago · Juan Pablo Isaza
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!