JSON format for External Paging
![Brian Giometti](https://us.v-cdn.net/6037124/uploads/userpics/ONIPTIEX0LDD/nJE4ZN6ATNTPB.png)
I'm working on getting external paging working on my Xano API and am a bit confused as to the preferred format of the request. I read the help article and am happy to use JSON but I'd like to clarify what exactly Xano is expecting.
If send my reqeust to: https://my.xano.api/endpoint?{"external":{"page":num}} xano will see it as an input does not seem to be linking it.
If I send to https://my.xano.api/endpoint?external={"page":num} then everything works correctly.
Maybe this has to do with my function stack? I'm just linking the external JSON input as suggested in the documentation. I suppose if I want to do the first I'd need to link external.external?
My aim here is to remain as flexible as possible as I build out the front end, and being able to just construct an object as needed is definitely nice.
Here's my function stack if it helps
Comments
-
Also it's my understanding that I could do this via header possibly. Is there a header that Xano would see and associate with the input?
-
The issue here is the format of HTTP requests. The third paragraph shows a properly formatted query string, while the second paragraph's input is not. The general rules are:
https://myhost/mypath?key=value&key=value2
If you want the value in question to be a JSON string, you just replace the value part with the JSON string. Note that you'll quickly run into situations where you need to encode special characters in the URL.
-
Makes enough sense.
I was just confused when I saw Xano recognize the first as an input of {"external":{"page":num}} but it didn't do anything with it.
The help doc lead me to believe that's exactly what it was expecting.
Anywho, easy enough to do it the second way. Thanks for confirming!
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