Step 1: Set Up the Xano Database
- Navigate to the Database:
- In Xano, go to the Database section from the left menu.
- Add a Table:
- Click Add Table → Enter Manually.
- Add the following columns:
originZIP(Text)destinationZIP(Text)weight(Number)- Optional:
cost(Number, for storing the API response).
This database will dynamically store inputs and results.
Step 2: Create the API Group and Custom Endpoint
- Go to the API section.
- Add an API Group:
- Click Add API Group and name it (e.g., “SpreadsheetWeb Integration”).
- Create a Custom Endpoint:
- Click Add API Endpoint → Select Custom Endpoint.
Step 3: Configure the External API Request
- Import the SpreadsheetWeb API cURL:
- Visit the SpreadsheetWeb API documentation.
- Go to the
calculatesinglesimplepath → Click Try it out → Execute. - Copy the generated cURL Request.
- Import into Xano:
- In your custom endpoint, click Add Function → Select External API Request.
- Click Import cURL and paste the following structure:
- Replace placeholders with your Workspace ID and Application ID.
- Set Headers:
- Add a Header:
-
Content-Type: application/json
-
- Add a Header:
Step 4: Add Dynamic Input Fields
- Go to the Input Values section of your endpoint.
- Define dynamic input fields:
originZIP→ Map to API’soriginZIP.destinationZIP→ Map to API’sdestinationZIP.weight→ Map to API’sweight.
This setup ensures that API inputs are dynamically sent.
Step 5: Test the API
- Use Xano’s Run & Debug feature to test the API:
- Input sample values for
originZIP,destinationZIP, andweight.
- Input sample values for
- Verify that the cost field is returned in the response.
Example Response:
Step 6: Save Test Data in the Database (Optional)
- Add a Database Function in the endpoint to save inputs and outputs.
- Map:
originZIP→ DatabaseoriginZIPdestinationZIP→ DatabasedestinationZIPweight→ Databaseweightcost→ Databasecost(from API response).