πŸ“©Fetching Data

Learn how to integrate our system with React Native.

You can easily use echo3D with your React Native project by using our RESTful API.

You can use the fetch interface to query your project data set using the query API call:

...

render: function() {
 
  var echoDB;
  
  // Query echo3D
  fetch('https://api.echo3D.com/query?key=' + API_KEY)
  .then((response) => response.json())
  .then((json) => {
    // Store database
    global.echoDB = json; // Save JSON response as a global variable
  })
  .catch((error) => {
    console.error(error);
  });
  
  ...

}

...

You will be able to access your API key and database entries anywhere as follows:

var apiKey = global.echoDB.apiKey;
var db = Object.values(global.echoDB.db);

Last updated