createAnAccountAgentBot
Create an Agent Bot
Create an agent bot in the account
/api/v1/accounts/{account_id}/agent_bots
Usage and SDK Samples
curl -X POST -H "api_access_token: [[apiKey]]" "https://app.ooctopus.com/api/v1/accounts/{account_id}/agent_bots"
import io.swagger.client.*;
import io.swagger.client.auth.*;
import io.swagger.client.model.*;
import io.swagger.client.api.AccountAgentBotsApi;
import java.io.File;
import java.util.*;
public class AccountAgentBotsApiExample {
public static void main(String[] args) {
ApiClient defaultClient = Configuration.getDefaultApiClient();
// Configure API key authorization: userApiKey
ApiKeyAuth userApiKey = (ApiKeyAuth) defaultClient.getAuthentication("userApiKey");
userApiKey.setApiKey("YOUR API KEY");
// Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
//userApiKey.setApiKeyPrefix("Token");
AccountAgentBotsApi apiInstance = new AccountAgentBotsApi();
Integer accountId = 56; // Integer | The numeric ID of the account
Agent_bot_create_update_payload data = ; // Agent_bot_create_update_payload |
try {
agent_bot result = apiInstance.createAnAccountAgentBot(accountId, data);
System.out.println(result);
} catch (ApiException e) {
System.err.println("Exception when calling AccountAgentBotsApi#createAnAccountAgentBot");
e.printStackTrace();
}
}
}
import io.swagger.client.api.AccountAgentBotsApi;
public class AccountAgentBotsApiExample {
public static void main(String[] args) {
AccountAgentBotsApi apiInstance = new AccountAgentBotsApi();
Integer accountId = 56; // Integer | The numeric ID of the account
Agent_bot_create_update_payload data = ; // Agent_bot_create_update_payload |
try {
agent_bot result = apiInstance.createAnAccountAgentBot(accountId, data);
System.out.println(result);
} catch (ApiException e) {
System.err.println("Exception when calling AccountAgentBotsApi#createAnAccountAgentBot");
e.printStackTrace();
}
}
}
Configuration *apiConfig = [Configuration sharedConfig];
// Configure API key authorization: (authentication scheme: userApiKey)
[apiConfig setApiKey:@"YOUR_API_KEY" forApiKeyIdentifier:@"api_access_token"];
// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
//[apiConfig setApiKeyPrefix:@"Bearer" forApiKeyIdentifier:@"api_access_token"];
Integer *accountId = 56; // The numeric ID of the account
Agent_bot_create_update_payload *data = ; //
AccountAgentBotsApi *apiInstance = [[AccountAgentBotsApi alloc] init];
// Create an Agent Bot
[apiInstance createAnAccountAgentBotWith:accountId
data:data
completionHandler: ^(agent_bot output, NSError* error) {
if (output) {
NSLog(@"%@", output);
}
if (error) {
NSLog(@"Error: %@", error);
}
}];
var Ooctopus = require('ooctopus');
var defaultClient = Ooctopus.ApiClient.instance;
// Configure API key authorization: userApiKey
var userApiKey = defaultClient.authentications['userApiKey'];
userApiKey.apiKey = "YOUR API KEY"
// Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
//userApiKey.apiKeyPrefix['api_access_token'] = "Token"
var api = new Ooctopus.AccountAgentBotsApi()
var accountId = 56; // {Integer} The numeric ID of the account
var data = ; // {Agent_bot_create_update_payload}
var callback = function(error, data, response) {
if (error) {
console.error(error);
} else {
console.log('API called successfully. Returned data: ' + data);
}
};
api.createAnAccountAgentBot(accountId, data, callback);
using System;
using System.Diagnostics;
using IO.Swagger.Api;
using IO.Swagger.Client;
using IO.Swagger.Model;
namespace Example
{
public class createAnAccountAgentBotExample
{
public void main()
{
// Configure API key authorization: userApiKey
Configuration.Default.ApiKey.Add("api_access_token", "YOUR_API_KEY");
// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
// Configuration.Default.ApiKeyPrefix.Add("api_access_token", "Bearer");
var apiInstance = new AccountAgentBotsApi();
var accountId = 56; // Integer | The numeric ID of the account
var data = new Agent_bot_create_update_payload(); // Agent_bot_create_update_payload |
try
{
// Create an Agent Bot
agent_bot result = apiInstance.createAnAccountAgentBot(accountId, data);
Debug.WriteLine(result);
}
catch (Exception e)
{
Debug.Print("Exception when calling AccountAgentBotsApi.createAnAccountAgentBot: " + e.Message );
}
}
}
}
<?php
require_once(__DIR__ . '/vendor/autoload.php');
// Configure API key authorization: userApiKey
Swagger\Client\Configuration::getDefaultConfiguration()->setApiKey('api_access_token', 'YOUR_API_KEY');
// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
// Swagger\Client\Configuration::getDefaultConfiguration()->setApiKeyPrefix('api_access_token', 'Bearer');
$api_instance = new Swagger\Client\Api\AccountAgentBotsApi();
$accountId = 56; // Integer | The numeric ID of the account
$data = ; // Agent_bot_create_update_payload |
try {
$result = $api_instance->createAnAccountAgentBot($accountId, $data);
print_r($result);
} catch (Exception $e) {
echo 'Exception when calling AccountAgentBotsApi->createAnAccountAgentBot: ', $e->getMessage(), PHP_EOL;
}
?>
use Data::Dumper;
use WWW::SwaggerClient::Configuration;
use WWW::SwaggerClient::AccountAgentBotsApi;
# Configure API key authorization: userApiKey
$WWW::SwaggerClient::Configuration::api_key->{'api_access_token'} = 'YOUR_API_KEY';
# uncomment below to setup prefix (e.g. Bearer) for API key, if needed
#$WWW::SwaggerClient::Configuration::api_key_prefix->{'api_access_token'} = "Bearer";
my $api_instance = WWW::SwaggerClient::AccountAgentBotsApi->new();
my $accountId = 56; # Integer | The numeric ID of the account
my $data = WWW::SwaggerClient::Object::Agent_bot_create_update_payload->new(); # Agent_bot_create_update_payload |
eval {
my $result = $api_instance->createAnAccountAgentBot(accountId => $accountId, data => $data);
print Dumper($result);
};
if ($@) {
warn "Exception when calling AccountAgentBotsApi->createAnAccountAgentBot: $@\n";
}
from __future__ import print_statement
import time
import swagger_client
from swagger_client.rest import ApiException
from pprint import pprint
# Configure API key authorization: userApiKey
swagger_client.configuration.api_key['api_access_token'] = 'YOUR_API_KEY'
# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
# swagger_client.configuration.api_key_prefix['api_access_token'] = 'Bearer'
# create an instance of the API class
api_instance = swagger_client.AccountAgentBotsApi()
accountId = 56 # Integer | The numeric ID of the account
data = # Agent_bot_create_update_payload |
try:
# Create an Agent Bot
api_response = api_instance.create_an_account_agent_bot(accountId, data)
pprint(api_response)
except ApiException as e:
print("Exception when calling AccountAgentBotsApi->createAnAccountAgentBot: %s\n" % e)
Parameters
Name | Description |
---|---|
account_id* |
Integer
The numeric ID of the account
Required
|
Name | Description |
---|---|
data * |