MessageFactory.ContentUrl Method
Definition
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
Returns a message activity that contains a single image or video.
public static Microsoft.Bot.Schema.IMessageActivity ContentUrl (string url, string contentType, string name = default, string text = default, string ssml = default, string inputHint = default);
static member ContentUrl : string * string * string * string * string * string -> Microsoft.Bot.Schema.IMessageActivity
Public Shared Function ContentUrl (url As String, contentType As String, Optional name As String = Nothing, Optional text As String = Nothing, Optional ssml As String = Nothing, Optional inputHint As String = Nothing) As IMessageActivity
Parameters
- url
- String
The URL of the image or video to send.
- contentType
- String
The MIME type of the image or video.
- name
- String
Optional, the name of the image or video file.
- text
- String
Optional, the text of the message to send.
- ssml
- String
Optional, text to be spoken by your bot on a speech-enabled channel.
- inputHint
- String
Optional, indicates whether your bot is accepting, expecting, or ignoring user input after the message is delivered to the client. One of: "acceptingInput", "ignoringInput", or "expectingInput". Default is null.
Returns
A message activity containing the attachment.
Exceptions
url
or contentType
is null
,
empty, or white space.
Examples
This code creates a message activity that contains an image.
IMessageActivity message =
MessageFactory.ContentUrl("https://{domainName}/cat.jpg", MediaTypeNames.Image.Jpeg, "Cat Picture");