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

204
Views
How to access URL inside of a JSON API that leads to another JSON API, and display that information on a page in React?

I have a property of 'inspection-link' that has a value of a URL that I'm pulling in from a JSON API.

"inspection-link": "https://qa.toromont.ca/ToromontCAT/ServiceHub/PublicInfo/ecomm/inspection?sku=N001|BFEN1868620151TLI45073",

Instead of simply displaying the "inspection-link" URL onto the pay, I need to be able to access the URL, and then display that information on the page.

The code I have below (<p>{jsonDataProduct?.["inspection-link"]}</p>) only displays the URL on the page in text, but of course I need to display that URL's data coming in from it's on JSON URL.

const PeriodicAnnualInspectionReport = ({
  lang,
  jsonDataProduct,
}: Props_PIReport) => {
  return (
    <div className="container">
      <div className="row">
        <div className="col-lg-12">
          {}
          <h2>
            {outputEnFr(
              "Periodic Annual Inspection Report",
              "Rapport d'inspection annuel périodique",
              lang
            )}
          </h2>
          <p>{jsonDataProduct?.["inspection-link"]}</p>
        </div>
      </div>
    </div>
  );
};

export default PeriodicAnnualInspectionReport;
about 4 years ago · Juan Pablo Isaza
1 answers
Answer question

0

Then in the component mount using useEffect with empty array dependencies, and fetch the data from that URL, and set a state for it to update the UI, when data come.

const [data, setData] = useState()

useEffect(() => {
  if (jsonDataProduct) {
    fetch(jsonDataProduct["inspection-link"]).then(response => response.json())
        .then(data => setData(data));
  }
}, [])

Then you can output the data come from that json URL

about 4 years ago · Juan Pablo Isaza Report
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!