Zoom Connect SMS API

I am working with the Zoom Connect SMS API https://www.zoomconnect.com/ and am having a slight issue.

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
Screenshot 2020-10-12 at 07.04.11

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.

@patrick I assume can decipher that, hahaha.

Don’t think this is in the pipeline to be fixed anytime soon.
Here’s the work-around I use:

  1. Create a separate ASP page which would make the API call.
  2. Wrap the response in JSON.
  3. Return this JSON as response.
  4. In Server Action, call this ASP page using API Action step.
1 Like

Thank you @sid

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.

1 Like

Aha, thank you for explaining, that makes more sense, i’m going to give it a try and see how I go.

Thanks again, I would have never even thought of trying that to be honest.

@patrick is this something Wappler may have a fix for soon, as this is quite a workaround.

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.

1 Like

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.