skip to Main Content

Sending thumbnailcard to telegram channel produces following exception. This is working fine in emulator.

Operation returned an invalid status code ‘InternalServerError’

Here is the code for card:

var Card = new ThumbnailCard(cardHeading, BotName)
{
    Buttons = new List<CardAction>
    {
        new CardAction(ActionTypes.ImBack, "MyProfile", text:"MyProfile", displayText: "MyProfile", value: "MyProfile"),
        new CardAction(ActionTypes.ImBack, "MyBadges", text:"MyBadges", displayText: "MyBadges", value: "MyBadges"),
        new CardAction(ActionTypes.ImBack, "MyActivity", text:"MyActivity", displayText: "MyActivity", value: "MyActivity"),
        new CardAction(ActionTypes.ImBack, "LogOut", text: "LogOut", displayText: "LogOut", value: "LogOut")
    },
    Images = new List<CardImage>()
    {
        new CardImage()
        {
            Url = string.Format("data:image/png;base64,{0}", strBase64Image)
        }
    }
};

2

Answers


  1. From the attachments sample:

    // Using a base64 string to send an attachment will not work on all channels.
    // Additionally, some channels will only allow certain file types to be sent this way.
    // For example a .png file may work but a .pdf file may not on some channels.
    // Please consult the channel documentation for specifics.
    

    We can surmise from this information that Telegram does not support embedded images.

    Login or Signup to reply.
  2. I doubt your CardImage Url format is correct. could you please try with below code snippet

    Images = new List<CardImage> { new CardImage("https://pbs.twimg.com/profile_images/3647943215/d7f12830b3c17a5a9e4afcc370e3a37e_400x400.jpeg") } 
    

    Point To Remember:

    Emulator could manage many of the issue itself where channel always doesn’t.

    And Let me know if is it working

    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search