Transforming data \n to JSON API
Options
Mazze
Member ✭
Hi there,
I want to use an external API. The type I need to send is: "Content-Type: application/json"
I need to send a key from google (here as "googlePrivateKey")-[image.png]Sadly that key has a lots of \n in it and is and this causes my API to not work. As the \n is causing the api to fail it is escaped like this: \n.
Sadly it is the same thing as here but does not not work:
https://community.xano.com/c/help-im-a-noob/sending-a-slack-message-via-xano-how-to-escape-n-markdown-in-xano
What transformation / filter should I use here to get the right results? I e.g. tried "json_encode" or "url_addarg" but this does not work.
Extract (with modified data
):
"\nMIIEvgIBADANBgkqhkiG9w0BAQEFAASCBKgwggSkAgEAAoIBAQDbuj4+1l6OloyT\nUTFLepLUU/fh0XbvE/Umef4uWKomcmrDSKSc187RTrJkTd/1h7O4o6j05c7eCiGR\n/3+NtcwhDuayEMsBmBYuXi7ogpJYR2Qdy4RyMM2Tjmt33cf68BiYWm2vWRw+X3Cr\noCMBZUpFUxDqC5LBI72ZE/r+yIlWD4eFB4kiMg1uY67p5EzR1UnZbjwYzJvjWEKf\nl+kHS4MKQH865FEpp1adE/vexEAf8PMgEjlezpf9+j0QhjETR3ikbIDh31bYJdj7\nFN...."
If i create a variable using the text + "json_encode" it is transformed to:
\\nMIIEvgIBADANBgkqhkiG9w0BAQEFAASCBKgwggSkAgEAAoIBAQDbuj4+1l6OloyT\\nUTFLepLUU\/fh0XbvE\/Umef4uWKomcmrDSKSc187RTrJkTd\/1h7O4o6j05c7eCiGR\\n\/3+NtcwhDuayEMsBmBYuXi7ogpJYR2Qdy4RyMM2Tjmt33cf68BiYWm2vWRw+X3Cr\\noCMBZUp
[image.png][image.png]
I want to use an external API. The type I need to send is: "Content-Type: application/json"
I need to send a key from google (here as "googlePrivateKey")-[image.png]Sadly that key has a lots of \n in it and is and this causes my API to not work. As the \n is causing the api to fail it is escaped like this: \n.
Sadly it is the same thing as here but does not not work:
https://community.xano.com/c/help-im-a-noob/sending-a-slack-message-via-xano-how-to-escape-n-markdown-in-xano
What transformation / filter should I use here to get the right results? I e.g. tried "json_encode" or "url_addarg" but this does not work.
Extract (with modified data
![;) ;)](https://legacy-community.xano.com/resources/emoji/wink.png)
"\nMIIEvgIBADANBgkqhkiG9w0BAQEFAASCBKgwggSkAgEAAoIBAQDbuj4+1l6OloyT\nUTFLepLUU/fh0XbvE/Umef4uWKomcmrDSKSc187RTrJkTd/1h7O4o6j05c7eCiGR\n/3+NtcwhDuayEMsBmBYuXi7ogpJYR2Qdy4RyMM2Tjmt33cf68BiYWm2vWRw+X3Cr\noCMBZUpFUxDqC5LBI72ZE/r+yIlWD4eFB4kiMg1uY67p5EzR1UnZbjwYzJvjWEKf\nl+kHS4MKQH865FEpp1adE/vexEAf8PMgEjlezpf9+j0QhjETR3ikbIDh31bYJdj7\nFN...."
If i create a variable using the text + "json_encode" it is transformed to:
\\nMIIEvgIBADANBgkqhkiG9w0BAQEFAASCBKgwggSkAgEAAoIBAQDbuj4+1l6OloyT\\nUTFLepLUU\/fh0XbvE\/Umef4uWKomcmrDSKSc187RTrJkTd\/1h7O4o6j05c7eCiGR\\n\/3+NtcwhDuayEMsBmBYuXi7ogpJYR2Qdy4RyMM2Tjmt33cf68BiYWm2vWRw+X3Cr\\noCMBZUp
[image.png][image.png]
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