目标是使用对话API(群聊)从后端发送图像.
我明白了,如果只是1对1的消息,你怎么能做到use mediaUrl:
MessageResource.Create(
body: "Hello there!",
from: new Twilio.Types.PhoneNumber("+15555555555"),
mediaUrl: mediaUrl,
to: new Twilio.Types.PhoneNumber("+12316851234")
);
以上不适用于我,因为我希望使用群聊将多个成员.以下是我当前用于向多个参与者发送文本的实现
// create a group chat
ConversationResource conversation = ConversationResource.Create(client: _twilioClient);
var bootyService = ParticipantResource.Create(
identity: "myService",
messagingBindingProjectedAddress: "+15555555555",
pathConversationSid: conversation.Sid,
client: _twilioClient
);
// participant 1
var sender = ParticipantResource.Create(
messagingBindingAddress: "+12316851234",
pathConversationSid: conversation.Sid,
client: _twilioClient
);
// participant 2
var Receiver = ParticipantResource.Create(
messagingBindingAddress: "+12316851234",
pathConversationSid: conversation.Sid,
client: _twilioClient
);
var groupMessage = ConversationMessageResource.Create(
body: "Hi this is a group chat",
author: "myService",
pathConversationSid: conversation.Sid,
client: _twilioClient
);
Conversations API没有任何MediaURL的概念.可以使用对话消息资源发送图像吗?