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

Latest commit

 

History

History
83 lines (70 loc) · 4.31 KB

File metadata and controls

83 lines (70 loc) · 4.31 KB

Getting the current account status.

Implementation notes
Re-authorization is only required if you change the device or manually click "Log out of all devices" on the phone.
Keep the WhatsApp app open during authorization.
This method is available in both synchronous and asynchronous implementations

Request

Parameter Description The data type of the parameter Required parameter
NoWakeup Ignore autowakeup.
Default - false
Boolean
GetFullInformation Get full information on the current status.
Default - false
Boolean

Response

Parameter Description The data type of the parameter
QrCode Base64-encoded contents of the QR code. String
StatusData Additional information about account status. AccountStatusData
AccountStatus Account Status. AccountStatusType

Parameters of the AccountStatusData

Parameter Description The data type of the parameter
Title Status title in the language of the account. String
Reason The reason why the account is in "loading" status. InstanceConnectionStatusType
Actions Actions that can be applied to change the status. AdditionInformationStatus
Message Status message in the language of the account. Boolean
SubStatus Account substatus. InstanceStatusType
SubMessage Additional status message in the language of the account. Boolean

Parameters of the AdditionInformationStatus

Parameter Description The data type of the parameter
Retry Repeat the manual synchronization attempt with the device. InstanceStatus
Expiry Updates the QR code after its expired. InstanceStatus
Logout Logout from WhatsApp Web to get new QR code. InstanceStatus
Takeover Returns the active session. InstanceStatus
LearnMore Getting additional information about acceptable transactions in this account status. InstanceStatus

Parameters of the InstanceStatus

Parameter Description The data type of the parameter
Link Reference URL instead of method. String
Label Action caption for the button. String
Action Method name. InstanceStatusActionType

Example

using System;

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

using ChatApi.WA.Account;
using ChatApi.WA.Account.Requests;

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

        private static void Main()
        {
            // put your chat-api's data
            Connect = new WhatsAppConnect(WhatsApp_Server, WhatsApp_Instance, WhatsApp_Token); 
            IAccountOperation accountOperation = new AccountOperation(connect);

            var accountStatusRequest = new AccountStatusRequest
            {
                NoWakeup = true,
                GetFullInformation = true
            };
            var chatApiResponse = accountOperation.GetStatus(accountStatusRequest);

            if (!chatApiResponse.IsSuccess) throw chatApiResponse.Exception!;
            IAccountStatusResponse? response = chatApiResponse.GetResult();

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