Issues "Invalid boolean: 1" external api call
i have called stripe external api for subscription cancel where we need to pass boolean true i passed boolean true but in external api response i get error message this Invalid boolean: 1
Comments
-
Hey @Khan aqib that is strange. I'd have to look at Stripe's documentation. One quick thing to try would be to pass true as a text string instead of a boolean. Not sure if that will work in this case but just something worth trying!
-
Please check with to_boolean and to_text filter
-
Hi @Michael Udinski and @Xano freelance i have checked to_boolean and to_text filter and string but it's not worked please check this issues
-
The conversion of bools to 1/0 is a symptom of URL form encoding.
In your external API request, "push" the following header:
Content-Type: application/json
Let us know if that squares you away? If not, can you please share a screenshot of the Exertnal API Request configuration?
-
i have checked this but not work i have share response header and request header and also send external api request configuration
-
Got it. Your API appears to requires form-encoding, but also wants the words "true" and "false". First, remove the extra header I recommended above. That will put you back where you were. To make progress, make an if-then conditioned on the state of the boolean in question. In the "then", create a variable and set it to the word (text) of "true". Make sure it's not a bool! In the "else", create a variable of the same name and set it to the word "false". Then pass that to your params.
We actually hit exactly this situation in a recent State Change Pro Office Hours (held every day) and resolved the issue using the above technique.
Categories
- All Categories
- 46 π£ Announcements
- 47 π¦Ύ Releases
- 36 π Welcome
- 924 π€· Help! I'm a Noob
- 113 π± No-Code Front-Ends
- 597 π Working with APIs
- 418 π’ Transforming data
- 120 π Connect Xano to ...
- 46 π§βπ» Find an Expert
- 320 βOther questions
- 32 π Security
- 22 βοΈ Snippets
- 19 π Showcase
- 7 π£οΈ ο»Ώ Xano Chatter
- 60 πΊ Video Tutorials
- 166 π Request a feature
- 219 π Report a Bug
- 19 π Templates & Extensions
- 6 π¬ Feedback