Can Xano grab data from a web callback URL?
I am currently trying to integrate Square's point of sale API with Xano -
Originally I had planned to use a webhook where it would grab and utilise the data sent from Square. However, after some testing I have noticed Square adds the data onto your specified callback URL. I have provided an example below.
EG. callback URL: https://www.example.com?data=encoded_data_here)
I am receiving the data to my callback URL but I don't know how to get Xano to grab it out for me. Can Xano pull this data out from the URL and make use of it?
Sounds like Square is not calling your Xano endpoint at all if you don't see the request in the history!
A common issue with webhooks is that some of them are based GET and others on POST. And Xano makes a separate "query" for each. If Square is sending a GET your POST endpoint will never receive it.
So I would try: make a new endpoint, set it to "GET" and give it the same name as your current one. See if Square talks to either of your endpoints.
Yes, Xano will look at the query string by means of the inputs on your function stack. If you have something in the URL coming into Xano called "?data=X&stuff=y" you can create an input called "data" of type "text" and you will find it holds the value "X". Similarly, creating an input called "stuff" will contain "y".
Thanks for the comment Ray. I have tried your recommendation and still not getting anything in the request history, which is normally the first thing I will go to check. If you don't mind I will put up some screenshots to see if you can identify the problem.
The below screenshot shows my square_callback_url webhook. I have the data as text in the input and use get all input encoding JSON.
My next screenshot shows what Square has posted to the callback URL. I do get the error code on the page which I am not sure about but the URL I have on the screenshot below matches what's in the Square dashboard to whats in the Xano webhook apart from "?data="
Any help would be much appreciated.
Hi @Ray Deck
Your answer was spot on. Just needed to change it to a GET request. I was under the impression all Xano webhooks needed to be a POST but you learn something new every day. :)1 · Share on Twitter
- 2.1K All Categories
- 43 📣 Announcements
- 32 🦾 Releases
- 30 👋 Welcome
- 552 🤷 Help! I'm a Noob
- 39 📱 No-Code Front-Ends
- 419 🌐 Working with APIs
- 278 🔢 Transforming data
- 100 🔌 Connect Xano to ...
- 13 🧑💻 Find an Expert
- 239 ❓Other questions
- 9 🔐 Security
- 13 ✂️ Snippets
- 16 🏆 Showcase
- 3 🗣️ Xano Chatter
- 49 📺 Video Tutorials
- 156 🙏 Request a feature
- 156 🐞 Report a Bug
- 17 🚀 Templates & Extensions
- 💬 Feedback