There are a few ways to connect to it, I am using the absolute simplest form where I will just send a URL if I place this URL in my browser https://zoomconnect.com/app/api/rest/v1/sms/send-url/add6f984-xxxx-xxxx-xxxx-xxxxxxxxxxxx?recipientNumber=27767480000&message=Testing which I have changed for posing here, it returns a number like
And suddenly the SMS comes up on my phone, so great, its working, now I add an API Action to my Server Action using .aspx and run the same thing.
The SMS comes through perfectly but the form never gets a success so it cant reset the form fields or redirect to the next page. Instead I get the following error.
Would you mind please trying to explain your steps in a bit more detail, its not something I have done before so not certain, whet you mean.
Very happy that someone has had a similar issue though, as I wondered if I was doing something wrong.
So if we were to build out a project in Visual Studio, we’d just create a new ASP page and write our code in C# there.
Then running that page directly in the browser would return whatever the C# code does.
Since the project in Wappler is using ASP model (same goes for PHP), any page you create with the right extensions get processed by IIS correctly.
So, you can create a regular ASP page with public static void Main and all that other stuff, and it would run just fine on the same IIS hosting.
Hence, what I suggest is to create a page which works like an API Endpoint (hint: Generic Web Handler). Then using ASP/C# code, call the actual API using the values in input, read the response, wrap it in JSON and set that as this page’s response.
In server action, you just call this page with all the required data, and you should get valid response in result.
What is the Content Type of the response from the api? The error is that our api call gets a response of which it thinks that it is json and tries to parse it. It only does so with a json content type, otherwise it will return the response as string.
Thank you Patrick for your assistance, and what a simple solution it landed up being.
Adding .txt to the URL forces it to plaintext, so a simple url alteration from https://zoomconnect.com/app/api/rest/v1/sms/send-url/add6f984-xxxx-xxxx-xxxx-xxxxxxxxxxxx?recipientNumber=27767480000&message=Testing
TO https://zoomconnect.com/app/api/rest/v1/sms/send-url/add6f984-xxxx-xxxx-xxxx-xxxxxxxxxxxx.txt?recipientNumber=27767480000&message=Testing
And now its all working. Also it is not actually a Wappler bug but more a problem in the API return where the provider is sending back json with no json content, so not a Wappler bug afteral.