You are viewing limited content. For full access, please sign in.

Question

Question

Twilio HTTP Request

asked on December 27, 2018

Has anyone had any luck using the built in web request to send an SMS using Twilio? So far I've managed to set the connection up but I can't get it to recognize the json for the To and From numbers as well as the body. On the Twilio site I only see examples for CURL, NODE.JS, PHP, RUBY, PYTHON, JAVA and C#. I figured I'd try C# but it requires a library (https://www.nuget.org/packages/Twilio/5.24.0 )that I can't install or extract to just call in the script references. Any ideas?

0 0

Replies

replied on December 27, 2018

You can drop dependencies into the root of the workflow directory, and then you can reference them from scripts. I've found that Workflow Designer requires me to set up a mirror to the server workflow directory (C:\Program Files\Laserfiche\Laserfiche Workflow 10.2). Then you can add the dependency in Workflow Designer, and it will work fine when you deploy the workflow.

0 0
replied on December 27, 2018

If I'm understanding correctly. I can drop that nuget file into the root folder and it should work?

0 0
replied on December 27, 2018 Show version history

No, you have to pull the dll out. Change the extension to .zip and copy the dll and the xml file out of the path \lib\net451 and copy that to the Workflow directory.

0 0
replied on January 1, 2019

As an addendum, it might be easier to maintain in the long run to create a standalone web service that wraps up the functionality and dependencies. Then you can call that from Workflow.

1 0
replied on January 2, 2019

As Devin said, a standalone web service is probably the better option. We are actually working on an application that uses Twilio now and that is the approach we used.

Workflow sends the JSON request to our web service, and the web service handles the Twilio interaction; this is far easier to maintain in my opinion.

0 0
replied on January 3, 2019

How would one go about doing that Jason? Can you point me in the right direction?

0 0
replied on January 3, 2019

There are actually multiple ways this could be done, but the following article will walk you through the basics of creating a API.NET API using C#

https://docs.microsoft.com/en-us/aspnet/web-api/overview/getting-started-with-aspnet-web-api/tutorial-your-first-web-api

We use MVC in most of our web applications, but it really depends on your needs. There's probably going to be a bit of a learning curve, but as Devin said, it will work out a lot better than trying to squeeze the Twilio components directly into Workflow.

If this is all new to you, I'd say start with a simple API application to get an idea of how that works. Work on the Twilio code separately to figure out what all you need, then build those components into the API.

0 0
You are not allowed to follow up in this post.

Sign in to reply to this post.