apiChannelInstanceIdClientActionCreateChannelPost
Create channel
Create a new WhatsApp channel
/api/channel/{instanceId}/client/action/create-channel
Usage and SDK Samples
curl -X POST\
-H "Authorization: Bearer [[accessToken]]"\
-H "Accept: application/json"\
-H "Content-Type: application/json"\
"http://api.chatwhatsapp.in/api/channel/{instanceId}/client/action/create-channel"
import io.swagger.client.*;
import io.swagger.client.auth.*;
import io.swagger.client.model.*;
import io.swagger.client.api.ChannelApi;
import java.io.File;
import java.util.*;
public class ChannelApiExample {
public static void main(String[] args) {
ApiClient defaultClient = Configuration.getDefaultApiClient();
ChannelApi apiInstance = new ChannelApi();
Action_createchannel_body body = ; // Action_createchannel_body |
String instanceId = instanceId_example; // String | ID of the WhatsApp instance
try {
inline_response_200_3 result = apiInstance.apiChannelInstanceIdClientActionCreateChannelPost(body, instanceId);
System.out.println(result);
} catch (ApiException e) {
System.err.println("Exception when calling ChannelApi#apiChannelInstanceIdClientActionCreateChannelPost");
e.printStackTrace();
}
}
}
import io.swagger.client.api.ChannelApi;
public class ChannelApiExample {
public static void main(String[] args) {
ChannelApi apiInstance = new ChannelApi();
Action_createchannel_body body = ; // Action_createchannel_body |
String instanceId = instanceId_example; // String | ID of the WhatsApp instance
try {
inline_response_200_3 result = apiInstance.apiChannelInstanceIdClientActionCreateChannelPost(body, instanceId);
System.out.println(result);
} catch (ApiException e) {
System.err.println("Exception when calling ChannelApi#apiChannelInstanceIdClientActionCreateChannelPost");
e.printStackTrace();
}
}
}
Configuration *apiConfig = [Configuration sharedConfig];
Action_createchannel_body *body = ; //
String *instanceId = instanceId_example; // ID of the WhatsApp instance
ChannelApi *apiInstance = [[ChannelApi alloc] init];
// Create channel
[apiInstance apiChannelInstanceIdClientActionCreateChannelPostWith:body
instanceId:instanceId
completionHandler: ^(inline_response_200_3 output, NSError* error) {
if (output) {
NSLog(@"%@", output);
}
if (error) {
NSLog(@"Error: %@", error);
}
}];
var WhatsAppApi = require('whats_app_api');
var defaultClient = WhatsAppApi.ApiClient.instance;
var api = new WhatsAppApi.ChannelApi()
var body = ; // {{Action_createchannel_body}}
var instanceId = instanceId_example; // {{String}} ID of the WhatsApp instance
var callback = function(error, data, response) {
if (error) {
console.error(error);
} else {
console.log('API called successfully. Returned data: ' + data);
}
};
api.apiChannelInstanceIdClientActionCreateChannelPost(bodyinstanceId, callback);
using System;
using System.Diagnostics;
using IO.Swagger.Api;
using IO.Swagger.Client;
using IO.Swagger.Model;
namespace Example
{
public class apiChannelInstanceIdClientActionCreateChannelPostExample
{
public void main()
{
var apiInstance = new ChannelApi();
var body = new Action_createchannel_body(); // Action_createchannel_body |
var instanceId = instanceId_example; // String | ID of the WhatsApp instance
try
{
// Create channel
inline_response_200_3 result = apiInstance.apiChannelInstanceIdClientActionCreateChannelPost(body, instanceId);
Debug.WriteLine(result);
}
catch (Exception e)
{
Debug.Print("Exception when calling ChannelApi.apiChannelInstanceIdClientActionCreateChannelPost: " + e.Message );
}
}
}
}
<?php
require_once(__DIR__ . '/vendor/autoload.php');
$api_instance = new Swagger\Client\ApiChannelApi();
$body = ; // Action_createchannel_body |
$instanceId = instanceId_example; // String | ID of the WhatsApp instance
try {
$result = $api_instance->apiChannelInstanceIdClientActionCreateChannelPost($body, $instanceId);
print_r($result);
} catch (Exception $e) {
echo 'Exception when calling ChannelApi->apiChannelInstanceIdClientActionCreateChannelPost: ', $e->getMessage(), PHP_EOL;
}
?>
use Data::Dumper;
use WWW::SwaggerClient::Configuration;
use WWW::SwaggerClient::ChannelApi;
my $api_instance = WWW::SwaggerClient::ChannelApi->new();
my $body = WWW::SwaggerClient::Object::Action_createchannel_body->new(); # Action_createchannel_body |
my $instanceId = instanceId_example; # String | ID of the WhatsApp instance
eval {
my $result = $api_instance->apiChannelInstanceIdClientActionCreateChannelPost(body => $body, instanceId => $instanceId);
print Dumper($result);
};
if ($@) {
warn "Exception when calling ChannelApi->apiChannelInstanceIdClientActionCreateChannelPost: $@\n";
}
from __future__ import print_statement
import time
import swagger_client
from swagger_client.rest import ApiException
from pprint import pprint
# create an instance of the API class
api_instance = swagger_client.ChannelApi()
body = # Action_createchannel_body |
instanceId = instanceId_example # String | ID of the WhatsApp instance
try:
# Create channel
api_response = api_instance.api_channel_instance_id_client_action_create_channel_post(body, instanceId)
pprint(api_response)
except ApiException as e:
print("Exception when calling ChannelApi->apiChannelInstanceIdClientActionCreateChannelPost: %s\n" % e)
Parameters
Name | Description |
---|---|
instanceId* |
String
ID of the WhatsApp instance
Required
|
Name | Description |
---|---|
body * |