C# 如何为tropo获取消息令牌和语音令牌?
这是代码。Tropo是一种信息服务,可用于向手机发送信息C# 如何为tropo获取消息令牌和语音令牌?,c#,C#,这是代码。Tropo是一种信息服务,可用于向手机发送信息 using System; using System.Collections.Generic; using System.Web; using System.Xml; using TropoCSharp.Structs; using TropoCSharp.Tropo; namespace OutboundTest { class Program { static void Main(string[] a
using System;
using System.Collections.Generic;
using System.Web;
using System.Xml;
using TropoCSharp.Structs;
using TropoCSharp.Tropo;
namespace OutboundTest
{
class Program
{
static void Main(string[] args)
{
// The voice and messaging tokens provisioned when your Tropo application is set up.
string voiceToken = "your-voice-token-here";
string messagingToken = "your-messaging-token-here";
// A collection to hold the parameters we want to send to the Tropo Session API.
IDictionary<string, string> parameters = new Dictionary<String, String>();
// Enter a phone number to send a call or SMS message to here.
parameters.Add("sendToNumber", "15551112222");
// Enter a phone number to use as the caller ID.
parameters.Add("sendFromNumber", "15551113333");
// Select the channel you want to use via the Channel struct.
string channel = Channel.Text;
parameters.Add("channel", channel);
string network = Network.SMS;
parameters.Add("network", network);
// Message is sent as a query string parameter, make sure it is properly encoded.
parameters.Add("msg", HttpUtility.UrlEncode("This is a test message from C#."));
// Instantiate a new instance of the Tropo object.
Tropo tropo = new Tropo();
// Create an XML doc to hold the response from the Tropo Session API.
XmlDocument doc = new XmlDocument();
// Set the token to use.
string token = channel == Channel.Text ? messagingToken : voiceToken;
// Load the XML document with the return value of the CreateSession() method call.
doc.Load(tropo.CreateSession(token, parameters));
// Display the results in the console.
Console.WriteLine("Result: " + doc.SelectSingleNode("session/success").InnerText.ToUpper());
Console.WriteLine("Token: " + doc.SelectSingleNode("session/token").InnerText);
Console.Read();
}
}
}
我需要知道如何获取上面代码中提到的消息令牌和语音令牌。==>这里是您的消息令牌&这里是您的语音令牌。我已经在谷歌上搜索过了。我找不到。您可以在中找到代币。单击应用程序,然后滚动到页面底部。在“语音”或“消息”下,单击“查看令牌URL”,然后可以在显示的URL参数中查看令牌
您可以在中找到代币。单击应用程序,然后滚动到页面底部。在“语音”或“消息”下,单击“查看令牌URL”,然后可以在显示的URL参数中查看令牌 可能是帮助可能是帮助