Skip to content
This repository was archived by the owner on Dec 18, 2023. It is now read-only.

Latest commit

 

History

History
68 lines (56 loc) · 3.41 KB

File metadata and controls

68 lines (56 loc) · 3.41 KB

Changing the shortcut settings.

Implementation note
The functionality is only available for WhatsApp Business.
This method is available in both synchronous and asynchronous implementations.

Request

Parameter Description The data type of the parameter Required parameter
LabelId Unique ID of the label. String
HexColor Label Color. String
  • Only HexColor is specified
  • Only LabelName is specified
LabelName Name of the label. String
  • Only LabelName is specified
  • Only HexColor is specified

Response

Parameter Description The data type of the parameter
Result The result of the creation. String
LabelInfo Data for the created label. Label

Parameters of the Label

Parameter Description The data type of the parameter
LabelId Unique ID of the label. String
HexColor Label Color. String
LabelName Name of the label. String

Example

using System;

using ChatApi.Core.Connect;
using ChatApi.Core.Connect.Interfaces;

using ChatApi.WA.Dialogs;
using ChatApi.WA.Dialogs.Operations.Interfaces;

using ChatApi.WA.Dialogs.Requests.UI;
using ChatApi.WA.Dialogs.Requests.UI.Interfaces;

using ChatApiClient.Properties;
namespace ChatApiClient
{
    internal class Program
    {
        internal static IWhatsAppConnect Connect { get; set; }

        internal static void Main()
        {
            // put your chat-api's data
            Connect = new WhatsAppConnect(WhatsApp_Server, WhatsApp_Instance, WhatsApp_Token); 
            IDialogOperations dialogOperations = new DialogOperations(Connect);
            IUserInterfaceOperations userInterfaceOperations = dialogOperations.UserInterfaceOperations.Value;
            IWhatsAppBusinessOperations whatsAppBusinessOperations = userInterfaceOperations.WhatsAppBusinessOperations.Value;

            ILabelUpdateRequest request = new LabelUpdateRequest
            {
                LabelId = "labelId",
                LabelName = "VIP Client"
            };

            var chatApiResponse = whatsAppBusinessOperations.UpdateLabel(request);
            if (!chatApiResponse.IsSuccess) Console.WriteLine(chatApiResponse.Exception);
            var response = chatApiResponse.GetResult();

            Console.WriteLine(response?.PrintMembers());
        }
    }
}