Creating a new instance of the Chat Api.
Implementation note
This method is available in both synchronous and asynchronous implementations.
Parameter
Description
The data type of the parameter
Required parameter
Type
Instance type
ChatApiInstanceType
Parameter
Description
The data type of the parameter
Result
Result of creating a Chat Api instance
IChatApiCreateInstanceResult
Parameters of the IChatApiCreateInstanceResult
Parameter
Description
The data type of the parameter
Status
The status of the operation
ChatApiStatusOperation
InstanceParameters
Parameters of the instance
IChatApiInstanceParameters
Parameters of the IChatApiInstanceParameters
Parameter
Description
The data type of the parameter
Id
The unique identifier of the instance
String
ApiUrl
Link for accessing the server
String
Token
A unique token for accessing the server for this instance
String
using System ;
using ChatApi . Core . Connect . Interfaces ;
using ChatApi . Core . Response . Interfaces ;
using ChatApi . Instances ;
using ChatApi . Instances . Models ;
using ChatApi . Instances . Connect ;
using ChatApi . Instances . Requests ;
using ChatApi . Instances . Requests . Interfaces ;
using ChatApi . Instances . Responses . Interfaces ;
namespace ChatApiClient
{
internal static class Program
{
internal static void Main ( )
{
IChatApiInstanceConnect connect = new ChatApiInstanceConnect ( "ApiKey" ) ;
IChatApiInstanceOperations instanceOperations = new ChatApiInstanceOperations ( connect ) ;
IChatApiCreateInstanceRequest request = new ChatApiCreateInstanceRequest
{
Type = ChatApiInstanceType . WhatsAppDev
} ;
IChatApiResponse < IChatApiCreateInstanceResponse ? > chatApiResponse = instanceOperations . CreateChatApiInstance ( request ) ;
if ( ! chatApiResponse . IsSuccess ) throw chatApiResponse . Exception ! ;
var response = chatApiResponse . GetResult ( ) ;
Console . WriteLine ( response ? . PrintMembers ( ) ) ;
}
}
}