Azure / azure-sdk

This is the Azure SDK parent repository and mostly contains documentation around guidelines and policies as well as the releases for the various languages supported by the Azure SDK.
http://azure.github.io/azure-sdk
MIT License
472 stars 291 forks source link

Board Review: Azure Communication Services (SPOOL) Cross Platform Messaging (.NET) #4271

Closed garchiro7 closed 2 months ago

garchiro7 commented 2 years ago

Responsible: geling.li@microsoft.com

Team: ACS - Cross Platform Messaging

Docs & Champion scenarios: Fire and Forget Swagger API change on Gateway - Fire and Forget

New Operation to be added

SendThreadlessMessageAsync:

Sends a fire and forget threadless message to CPM

Method

public virtual async Task<Response<SendThreadlessMessageResult>> SendThreadlessMessageAsync(SendThreadlessMessageOptions options, CancellationToken cancellationToken = default);

SendThreadlessMessageOptions Payload:

public class SendThreadlessMessageOptions
    {
        /// <summary> The from identifier that is owned by the authenticated account. </summary>
        public string From { get; set; }
        /// <summary> The channel user identifiers of the recipient. </summary>
        public string To { get; set; }
        /// <summary> The cross-platform threadless message type. </summary>
        public ThreadlessMessageType? Type { get; set; }
        /// <summary> Threadless message content.  Required if the type is text.</summary>
        public string Content { get; set; }
        /// <summary> The media Object. Required if the type is media.</summary>
        public MessageMedia Media { get; set; }
        /// <summary> The template object used to create message templates. Required if message type is a template.
</summary>
        public MessageTemplate Template { get; set; }
    }

Response:

public class SendThreadlessMessageResult
    {
        /// <summary> A server-generated message id. </summary>
        public string Id { get; }
        /// <summary> Status of the threadless message. </summary>
        public string Status { get; }
    }

Having a New Threadless Messaging Client vs New operations on existing Chat Client

image

More example usages:

On Existing Chat Client
Send a text message
SendThreadlessMessageOptions options = new SendThreadlessMessageOptions
            {
                From =  "business phone number",
                To = "37:whatsapp:16315551234",
                Type = ThreadlessMessageType.Text,
                Content = "Come on guys, lets go for lunch together."
            };

SendThreadlessMessageResults sendThreadlessMessageResult = chatClient.SendThreadlessMessage(options).ConfigureAwait(false);
Send a media message SendThreadlessMessageOptions options = new SendThreadlessMessageOptions
            {
                From = "business phone number",
                To = "37:whatsapp:16315551234",
                Type = ThreadlessMessageType.Media,
                Media = new MessageMedia("https://IMAGE\_URL")
            };

SendThreadlessMessageResults sendThreadlessMessageResult = chatClient.SendThreadlessMessage(options).ConfigureAwait(false);
Send a template message MessageTemplate template = new MessageTemplate
{
    Language = "appointment_update",
    Name = "en_US",
    Parameters = new List {"Friday", "2424"}
};
SendThreadlessMessageOptions options = new SendThreadlessMessageOptions
{
    From = "business phone number",
    To = "37:whatsapp:16315551234",
    Type = ThreadlessMessageType.Template,
    Template = template
};

SendThreadlessMessageResults sendThreadlessMessageResult = chatClient.SendThreadlessMessage(options).ConfigureAwait(false);

Api Spec:

azure-rest-api-specs/communicationserviceschat.json

PR-View

Sdk view: @azure/communication-chat - apiview.dev

lilyjma commented 2 years ago

scheduled for 5/24 2-4pm pst

tg-msft commented 2 years ago

See https://github.com/Azure/azure-rest-api-specs/issues/18777 for the API Stewardship Board review.

tg-msft commented 2 years ago

Recording (MS INTERNAL ONLY)

github-actions[bot] commented 2 months ago

Hi @garchiro7, we deeply appreciate your input into this project. Regrettably, this issue has remained unresolved for over 2 years and inactive for 30 days, leading us to the decision to close it. We've implemented this policy to maintain the relevance of our issue queue and facilitate easier navigation for new contributors. If you still believe this topic requires attention, please feel free to create a new issue, referencing this one. Thank you for your understanding and ongoing support.