title: Unable to deserialize the response
body: <p>I have searched and found this thread :<br>
  <a href="https://stackoverflow.com/questions/37609327/microsoft-bot-connectorclient-sendmessage-unable-to-deserialize-the-response">Microsoft.Bot ConnectorClient SendMessage Unable to deserialize the response</a><br>
  But there is no code and explanation.</p>
  
  <p>So far I have this : </p>
  
  <pre><code>  var obj = model[i];
                      var userAccount = new ChannelAccount(obj.toId, obj.toName);
                      var botAccount = new ChannelAccount(obj.fromId, obj.fromName);
                      var connector = new ConnectorClient(new Uri(obj.serviceUrl));
  
                      IMessageActivity message = Activity.CreateMessageActivity();
                      if (!string.IsNullOrEmpty(obj.conversationId) &amp;&amp; !string.IsNullOrEmpty(obj.channelId))
                      {
                          message.ChannelId = obj.channelId;
                      }
                      else
                      {
                          obj.conversationId = (await connector.Conversations.CreateDirectConversationAsync(botAccount, userAccount)).Id;
                      }
  
                      if (botAccount.Name == "")
                          botAccount.Name = "Bot";
                      if (userAccount.Name == "")
                          userAccount.Name = "User";
  
  
  
                      message.From = botAccount;
                      message.Recipient = userAccount;
                      message.Conversation = new ConversationAccount(id: obj.conversationId);
                      message.Text = "Hello, this is a notification";
                      message.Locale = "en-Us";
                      await connector.Conversations.SendToConversationAsync((Activity)message);
  </code></pre>
  
  <p>My message object : </p>
  
  <blockquote>
    <p>{Microsoft.Bot.Connector.ChannelAccount}
        Id: "49gjgijl7a4inc821c"
        Name: "Bot"</p>
    
    <p>message.Recipient
        {Microsoft.Bot.Connector.ChannelAccount}
            Id: "default-user"
            Name: "User"</p>
    
    <p>message.Conversation  {Microsoft.Bot.Connector.ConversationAccount}
        Id: "a0m69i29gih3kjf3mc"
        IsGroup: null
        Name: null</p>
    
    <p>message.Text = "Hello, this is a notification";
                        message.Locale = "en-Us";</p>
  </blockquote>
  
  <p>I'm getting this error when trying to post : </p>
  
  <blockquote>
    <p>Unable to deserialize the response.</p>
  </blockquote>
  
  <p>e.InnerException</p>
  
  <blockquote>
    <p>{"Unexpected character encountered while parsing value: &lt;. Path '',
    line 0, position 0."}
        Data: {System.Collections.ListDictionaryInternal}
        HResult: -2146233088
        HelpLink: null
        InnerException: null
        LineNumber: 0
        LinePosition: 0
        Message: "Unexpected character encountered while parsing value: &lt;. Path '', line 0, position 0."
        Path: ""
        Source: "Newtonsoft.Json"
        StackTrace: "   at Newtonsoft.Json.JsonTextReader.ParseValue()\r\n   at Newtonsoft.Json.JsonTextReader.Read()\r\n   at
    Newtonsoft.Json.Serialization.JsonSerializerInternalReader.ReadForType(JsonReader
    reader, JsonContract contract, Boolean hasConverter)\r\n   at
    Newtonsoft.Json.Serialization.JsonSerializerInternalReader.Deserialize(JsonReader
    reader, Type objectType, Boolean checkAdditionalContent)\r\n   at
    Newtonsoft.Json.JsonSerializer.DeserializeInternal(JsonReader reader,
    Type objectType)\r\n   at
    Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject[T](String
    json, JsonSerializerSettings settings)\r\n   at
    Microsoft.Bot.Connector.Conversations.d__6.MoveNext()"
        TargetSite: {Boolean ParseValue()}</p>
  </blockquote>
  
  <p>Any help ?</p>
  
  <p>Edit :  This is how I deserialize object.</p>
  
  <pre><code>  HttpContent requestContent = Request.Content;
              string jsonContent = requestContent.ReadAsStringAsync().Result;
              List&lt;ConversationModel&gt; model = new List&lt;ConversationModel&gt;();
  
  
              try { 
              model = JsonConvert.DeserializeObject&lt;List&lt;ConversationModel&gt;&gt;(jsonContent);
  </code></pre>
  
  <p>This is my object content : </p>
  
  <pre><code> channelId: "emulator"
      conversationId: "a0m69i29gih3kjf3mc"
      email: "some-email@hotmail.com"
      fromId: "49gjgijl7a4inc821c"
      fromName: ""
      serviceUrl: "http://localhost:3979"
      toId: "default-user"
      toName: ""
  </code></pre>
  
  <p>I am adding to name and from name explicitly for local testing (see the code).</p>