Giter Club home page Giter Club logo

tropo-webapi-csharp's Introduction

NuGet version (tropo-webapi-csharp) NuGet version (tropo-webapi-csharp) GitHub license

Overview

TropoCSharp is a set of C# classes for working with the Tropo cloud communication service. Tropo allows a developer to create applications that run over the phone, IM, SMS, and Twitter using web technologies. This library communicates with Tropo over JSON.

Usage

Build the solution. External references are managed through NuGet.

You can test samples in the TropoSamples solution by viewing them in a web browser, or via HTTP POST (which is how the Tropo WebAPI interacts with web applications).

Tests for various Tropo action classes are in the TropoClassesTests soltuon.

Project with samples (ASP.NET web application) will use a directory called TropoSample (e.g., http://localhost/TropoSample).

Example

using System;
using TropoCSharp.Tropo;

namespace TropoSamples
{
	public partial class HelloWorld : System.Web.UI.Page
	{
		
		public void Page_Load (object sender, EventArgs args)
		{
            // Create a new instance of the Tropo object.
            Tropo tropo = new Tropo();

            // Call the say method of the Tropo object and give it a prompt to say.
            tropo.Say("Hello World!");

            tropo.RenderJSON(Response);
		}
	}
}

tropo-webapi-csharp's People

Contributors

akalsey avatar denis7 avatar frankmeten avatar frankyucisco avatar johntdyer avatar jsgoecke avatar mheadd avatar robert-shade avatar robertlabrie avatar shiftysituation avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

tropo-webapi-csharp's Issues

Voice is stripped from Ask

Using the Tropo class, create an Ask object and pass it into the Tropo class. The Voice property of Ask is being stripped out and replaced with the global Voice that is a property of Tropo class. This prevents the ability to mix languages. Example; in english -> "press 1 for english". in spanish -> "press 2 for spanish".

Looking at the code, the simple solution would probably be changing the Tropo.Ask(Ask ask) method to simply Serialize the Ask argument. Maybe checking if (ask.Voice == null) ask.Voice = this.Voice;

ArgumentOutOfRangeException on Mac(the IDE is Mono)

Hi team:

I just want to make some test of the examples, and it always show the: #TROPO#: Received non-2XX status code on Tropo-Thread-755441209553ebeceaad7d491b29a74d [url=http://9e6b3d43.ngrok.io/OutboundSMS.aspx, code=500.
I can visit it via the browser as the screenshot.
screen shot 2017-11-24 at 5 08 09 pm
screen shot 2017-11-24 at 5 08 21 pm

So I test via the POSTMAN, both the GET/POST, all show the 500 error, And the error details is:

<style type="text/css"> body { background-color: #FFFFFF; font-size: .75em; font-family: Verdana, Helvetica, Sans-Serif; margin: 0; padding: 0; color: #696969; } a:link { color: #000000; text-decoration: underline; } a:visited { color: #000000; } a:hover { color: #000000; text-decoration: none; } a:active { color: #12eb87; } p, ul { margin-bottom: 20px; line-height: 1.6em; } pre { font-size: 1.2em; margin-left: 20px; margin-top: 0px; } h1, h2, h3, h4, h5, h6 { font-size: 1.6em; color: #000; font-family: Arial, Helvetica, sans-serif; } h1 { font-weight: bold; margin-bottom: 0; margin-top: 0; padding-bottom: 0; } h2 { font-size: 1em; padding: 0 0 0px 0; color: #696969; font-weight: normal; margin-top: 0; margin-bottom: 20px; } h2.exceptionMessage { white-space: pre; } h3 { font-size: 1.2em; } h4 { font-size: 1.1em; } h5, h6 { font-size: 1em; } #header { position: relative; margin-bottom: 0px; color: #000; padding: 0; background-color: #5c87b2; height: 38px; padding-left: 10px; } #header h1 { font-weight: bold; padding: 5px 0; margin: 0; color: #fff; border: none; line-height: 2em; font-family: Arial, Helvetica, sans-serif; font-size: 32px !important; } #header-image { float: left; padding: 3px; margin-left: 1px; margin-right: 1px; } #header-text { color: #fff; font-size: 1.4em; line-height: 38px; font-weight: bold; } #main { padding: 20px 20px 15px 20px; background-color: #fff; _height: 1px; } #footer { color: #999; padding: 5px 0; text-align: left; line-height: normal; margin: 20px 0px 0px 0px; font-size: .9em; border-top: solid 1px #5C87B2; } #footer-powered-by { float: right; } .details { font-family: monospace; border: solid 1px #e8eef4; white-space: pre; font-size: 1.2em; overflow: auto; padding: 6px; margin-top: 6px; background-color: #eeeeff; color: 555555 } .details-wrapped { white-space: normal } .details-header { margin-top: 1.5em } .details-header a { font-weight: bold; text-decoration: none } p { margin-bottom: 0.3em; margin-top: 0.1em } .sourceErrorLine { color: #770000; font-weight: bold; } </style> <script type="text/javascript"> var hideElementsById = new Array (); window.onload = function () { if (!hideElementsById || hideElementsById.length < 1) return; for (index in hideElementsById) toggle (hideElementsById [index]); }
function toggle (divId)
{
	var e = document.getElementById (divId);
	if (!e)
		return;
	var h = document.getElementById (divId + "Hint");
	if (e.style.display == "block" || e.style.display == "") {
		e.style.display = "none";
		if (h)
			h.innerHTML = " (click to show)";
	} else {
		e.style.display = "block";
		if (h)
			h.innerHTML = " (click to hide)";
	}
}
</script> <title>Error 500</title>
Application Exception

System.ArgumentOutOfRangeException

startIndex cannot be larger than length of string. Parameter name: startIndex

Description: HTTP 500.Error processing request.

Details: Non-web exception. Exception origin (name of application or object): mscorlib.

Exception stack trace:
at System.String.Substring (System.Int32 startIndex, System.Int32 length) [0x00022] in /Users/builder/data/lanes/4992/mono-mac-sdk/external/bockbuild/builds/mono-x64/mcs/class/referencesource/mscorlib/system/string.cs:1246 at System.String.Substring (System.Int32 startIndex) [0x00000] in /Users/builder/data/lanes/4992/mono-mac-sdk/external/bockbuild/builds/mono-x64/mcs/class/referencesource/mscorlib/system/string.cs:1232 at System.Web.Script.Services.RestHandler..ctor (System.Web.HttpContext context, System.Type type, System.String filePath) [0x00014] in /Users/builder/data/lanes/4992/mono-mac-sdk/external/bockbuild/builds/mono-x64/mcs/class/System.Web.Extensions/System.Web.Script.Services/RestHandler.cs:98 at System.Web.Script.Services.RestHandler.GetHandler (System.Web.HttpContext context, System.Type type, System.String filePath) [0x00000] in /Users/builder/data/lanes/4992/mono-mac-sdk/external/bockbuild/builds/mono-x64/mcs/class/System.Web.Extensions/System.Web.Script.Services/RestHandler.cs:115 at System.Web.Handlers.ScriptModule.PostAcquireRequestState (System.Object sender, System.EventArgs e) [0x0005f] in /Users/builder/data/lanes/4992/mono-mac-sdk/external/bockbuild/builds/mono-x64/mcs/class/System.Web.Extensions/System.Web.Handlers/ScriptModule.cs:78 at System.Web.HttpApplication+<RunHooks>d__217.MoveNext () [0x00158] in /Users/builder/data/lanes/4992/mono-mac-sdk/external/bockbuild/builds/mono-x64/mcs/class/System.Web/System.Web/HttpApplication.cs:1030 at System.Web.HttpApplication+<Pipeline>d__225.MoveNext () [0x007f1] in /Users/builder/data/lanes/4992/mono-mac-sdk/external/bockbuild/builds/mono-x64/mcs/class/System.Web/System.Web/HttpApplication.cs:1299 at System.Web.HttpApplication.Tick () [0x00000] in /Users/builder/data/lanes/4992/mono-mac-sdk/external/bockbuild/builds/mono-x64/mcs/class/System.Web/System.Web/HttpApplication.cs:927

SO Can anyone help to solve this issue under MAC.

Thanks

Jackey Fan

NuGet package linking to wrong version of JSON.net

If you install the NuGet Tropo package - it downloads and installs the latest NuGet version of JSON.net - however Tropo is looking for a specific version of JSON.Net that does not match the NuGet package.

To resolve this, I had to replace the JSON.net reference (newtonsoft) with the NuGet package and recompile.

Update Conference Constructor for allowSignals

The following overload method needs to be update to reflect the allowSignals property:

public void Conference(Conference conference)
{
Conference(conference.Id, conference.Mute, conference.Name, conference.PlayTones, conference.Required, conference.Terminator);
}

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.