Is there a way to use test data in API calls?
Currently, the Xano instance has 2 branches, one live and one inactive. I've been building and debugging a series of API endpoints in the inactive branch using test data. The next step would be to start initializing API calls from the front end of the app to make sure that data is being retrieved and displayed correctly. Is there a way to ensure that API calls sent to the inactive branch will query/edit test data only, not the live database?
Answers
-
Hi, @margaret-bf. You can specify the use of test data from external API calls by sending the X-Data-Source header with the request. So, if you have a test data source called 'test', just send "X-Data-Source: test" as a header and any database operations in the function stack (except for Direct Database Query) will target the test data source.
Categories
- All Categories
- 53 ? Announcements
- 47 ? Releases
- 37 ? Welcome
- 983 ? Help! I'm a Noob
- 125 ? No-Code Front-Ends
- 633 ? Working with APIs
- 439 ? Transforming data
- 126 ? Connect Xano to ...
- 50 ?? Find an Expert
- 348 ❓Other questions
- 35 ? Security
- 22 ✂️ Snippets
- 19 ? Showcase
- 7 ?️ Xano Chatter
- 62 ? Video Tutorials
- 171 ? Request a feature
- 229 ? Report a Bug
- 19 ? Templates & Extensions
- 7 ? Feedback