Assets/Watson/Scripts/Services/Conversation-Experimental/Conversation-Experimental.cs
/// <summary>
/// Message the specified workspaceId, input and callback.
/// </summary>
/// <param name="workspaceId">Workspace identifier.</param>
/// <param name="input">Input.</param>
/// <param name="callback">Callback.</param>
Message the specified workspaceId, input and callback.
Message the specified workspaceId input and callback .
public bool Message(string workspaceId, string input, OnMessage callback)
		{
			if(string.IsNullOrEmpty(workspaceId))
				throw new ArgumentNullException("workspaceId");
			if(string.IsNullOrEmpty(input))
				throw new ArgumentNullException("input");
			if(callback == null)
				throw new ArgumentNullException("callback");
            RESTConnector connector = RESTConnector.GetConnector(SERVICE_ID, SERVICE_MESSAGE);
			if(connector == null)
				return false;
			string reqJson = "{{\"input\": {{\"text\": \"{0}\"}}}}";
			string reqString = string.Format(reqJson, input);
			MessageReq req = new MessageReq();
			req.Callback = callback;
			req.Headers["Content-Type"] = "application/json";
            req.Headers["Accept"] = "application/json";
            req.Parameters["version"] = Version.VERSION;
			req.Function = "/" + workspaceId + "/message";
			req.Send = Encoding.UTF8.GetBytes(reqString);
			req.OnResponse = MessageResp;
			return connector.Send(req);
		}
public bool Message ( string workspaceId , string input , OnMessage callback ) { if ( string . IsNullOrEmpty ( workspaceId ) ) throw new ArgumentNullException ( " " ) ; if ( string . IsNullOrEmpty ( input ) ) throw new ArgumentNullException ( " " ) ; if ( callback == null ) throw new ArgumentNullException ( " " ) ; RESTConnector connector = RESTConnector . GetConnector ( SERVICE_ID , SERVICE_MESSAGE ) ; if ( connector == null ) return false ; string reqJson = " \" \" \" \" \" \" " ; string reqString = string . Format ( reqJson , input ) ; MessageReq req = new MessageReq ( ) ; req . Callback = callback ; req . Headers [ " " ] = " " ; req . Headers [ " " ] = " " ; req . Parameters [ " " ] = Version . VERSION ; req . Function = " " + workspaceId + " " ; req . Send = Encoding . UTF8 . GetBytes ( reqString ) ; req . OnResponse = MessageResp ; return connector . Send ( req ) ; }
Message the specified workspaceId, input and callback.
Message the specified workspaceId input and callback .
workspaceId
string
None
input
string
None
callback
OnMessage
None