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?
Question
Question
Replies
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.
If I'm understanding correctly. I can drop that nuget file into the root folder and it should work?
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.
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.
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.
How would one go about doing that Jason? Can you point me in the right direction?
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#
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.