RestAPI - Livechat

Department

findAll

Find all departments

An Array with all departments


/department

Usage and SDK Samples

curl -X GET "http://localhost:3000/v1/livechat/department"
import io.swagger.client.*;
import io.swagger.client.auth.*;
import io.swagger.client.model.*;
import io.swagger.client.api.DepartmentApi;

import java.io.File;
import java.util.*;

public class DepartmentApiExample {

    public static void main(String[] args) {
        
        DepartmentApi apiInstance = new DepartmentApi();
        try {
            ResponseList result = apiInstance.findAll();
            System.out.println(result);
        } catch (ApiException e) {
            System.err.println("Exception when calling DepartmentApi#findAll");
            e.printStackTrace();
        }
    }
}
import io.swagger.client.api.DepartmentApi;

public class DepartmentApiExample {

    public static void main(String[] args) {
        DepartmentApi apiInstance = new DepartmentApi();
        try {
            ResponseList result = apiInstance.findAll();
            System.out.println(result);
        } catch (ApiException e) {
            System.err.println("Exception when calling DepartmentApi#findAll");
            e.printStackTrace();
        }
    }
}

DepartmentApi *apiInstance = [[DepartmentApi alloc] init];

// Find all departments
[apiInstance findAllWithCompletionHandler: 
              ^(ResponseList output, NSError* error) {
                            if (output) {
                                NSLog(@"%@", output);
                            }
                            if (error) {
                                NSLog(@"Error: %@", error);
                            }
                        }];
var RestApiLivechat = require('rest_api___livechat');

var api = new RestApiLivechat.DepartmentApi()

var callback = function(error, data, response) {
  if (error) {
    console.error(error);
  } else {
    console.log('API called successfully. Returned data: ' + data);
  }
};
api.findAll(callback);
using System;
using System.Diagnostics;
using IO.Swagger.Api;
using IO.Swagger.Client;
using IO.Swagger.Model;

namespace Example
{
    public class findAllExample
    {
        public void main()
        {
            
            var apiInstance = new DepartmentApi();

            try
            {
                // Find all departments
                ResponseList result = apiInstance.findAll();
                Debug.WriteLine(result);
            }
            catch (Exception e)
            {
                Debug.Print("Exception when calling DepartmentApi.findAll: " + e.Message );
            }
        }
    }
}
<?php
require_once(__DIR__ . '/vendor/autoload.php');

$api_instance = new Swagger\Client\Api\DepartmentApi();

try {
    $result = $api_instance->findAll();
    print_r($result);
} catch (Exception $e) {
    echo 'Exception when calling DepartmentApi->findAll: ', $e->getMessage(), PHP_EOL;
}
?>
use Data::Dumper;
use WWW::SwaggerClient::Configuration;
use WWW::SwaggerClient::DepartmentApi;

my $api_instance = WWW::SwaggerClient::DepartmentApi->new();

eval { 
    my $result = $api_instance->findAll();
    print Dumper($result);
};
if ($@) {
    warn "Exception when calling DepartmentApi->findAll: $@\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.DepartmentApi()

try: 
    # Find all departments
    api_response = api_instance.find_all()
    pprint(api_response)
except ApiException as e:
    print("Exception when calling DepartmentApi->findAll: %s\n" % e)

Parameters

Responses

Status: 200 - Successfull operation

Status: 400 - Bad request


findDepartmentById

Find Department by id

Return one Department with yours agents


/department/{id}

Usage and SDK Samples

curl -X GET "http://localhost:3000/v1/livechat/department/{id}"
import io.swagger.client.*;
import io.swagger.client.auth.*;
import io.swagger.client.model.*;
import io.swagger.client.api.DepartmentApi;

import java.io.File;
import java.util.*;

public class DepartmentApiExample {

    public static void main(String[] args) {
        
        DepartmentApi apiInstance = new DepartmentApi();
        String id = id_example; // String | Id of department to be get info
        try {
            ResponseInsertUpdate result = apiInstance.findDepartmentById(id);
            System.out.println(result);
        } catch (ApiException e) {
            System.err.println("Exception when calling DepartmentApi#findDepartmentById");
            e.printStackTrace();
        }
    }
}
import io.swagger.client.api.DepartmentApi;

public class DepartmentApiExample {

    public static void main(String[] args) {
        DepartmentApi apiInstance = new DepartmentApi();
        String id = id_example; // String | Id of department to be get info
        try {
            ResponseInsertUpdate result = apiInstance.findDepartmentById(id);
            System.out.println(result);
        } catch (ApiException e) {
            System.err.println("Exception when calling DepartmentApi#findDepartmentById");
            e.printStackTrace();
        }
    }
}
String *id = id_example; // Id of department to be get info

DepartmentApi *apiInstance = [[DepartmentApi alloc] init];

// Find Department by id
[apiInstance findDepartmentByIdWith:id
              completionHandler: ^(ResponseInsertUpdate output, NSError* error) {
                            if (output) {
                                NSLog(@"%@", output);
                            }
                            if (error) {
                                NSLog(@"Error: %@", error);
                            }
                        }];
var RestApiLivechat = require('rest_api___livechat');

var api = new RestApiLivechat.DepartmentApi()

var id = id_example; // {String} Id of department to be get info


var callback = function(error, data, response) {
  if (error) {
    console.error(error);
  } else {
    console.log('API called successfully. Returned data: ' + data);
  }
};
api.findDepartmentById(id, callback);
using System;
using System.Diagnostics;
using IO.Swagger.Api;
using IO.Swagger.Client;
using IO.Swagger.Model;

namespace Example
{
    public class findDepartmentByIdExample
    {
        public void main()
        {
            
            var apiInstance = new DepartmentApi();
            var id = id_example;  // String | Id of department to be get info

            try
            {
                // Find Department by id
                ResponseInsertUpdate result = apiInstance.findDepartmentById(id);
                Debug.WriteLine(result);
            }
            catch (Exception e)
            {
                Debug.Print("Exception when calling DepartmentApi.findDepartmentById: " + e.Message );
            }
        }
    }
}
<?php
require_once(__DIR__ . '/vendor/autoload.php');

$api_instance = new Swagger\Client\Api\DepartmentApi();
$id = id_example; // String | Id of department to be get info

try {
    $result = $api_instance->findDepartmentById($id);
    print_r($result);
} catch (Exception $e) {
    echo 'Exception when calling DepartmentApi->findDepartmentById: ', $e->getMessage(), PHP_EOL;
}
?>
use Data::Dumper;
use WWW::SwaggerClient::Configuration;
use WWW::SwaggerClient::DepartmentApi;

my $api_instance = WWW::SwaggerClient::DepartmentApi->new();
my $id = id_example; # String | Id of department to be get info

eval { 
    my $result = $api_instance->findDepartmentById(id => $id);
    print Dumper($result);
};
if ($@) {
    warn "Exception when calling DepartmentApi->findDepartmentById: $@\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.DepartmentApi()
id = id_example # String | Id of department to be get info

try: 
    # Find Department by id
    api_response = api_instance.find_department_by_id(id)
    pprint(api_response)
except ApiException as e:
    print("Exception when calling DepartmentApi->findDepartmentById: %s\n" % e)

Parameters

Path parameters
Name Description
id*
String
Id of department to be get info
Required

Responses

Status: 200 - Successfull operation

Status: 400 - Bad request

Status: 404 - Not Found


insertDepartment

Add a new department with your agents


/department

Usage and SDK Samples

curl -X POST "http://localhost:3000/v1/livechat/department"
import io.swagger.client.*;
import io.swagger.client.auth.*;
import io.swagger.client.model.*;
import io.swagger.client.api.DepartmentApi;

import java.io.File;
import java.util.*;

public class DepartmentApiExample {

    public static void main(String[] args) {
        
        DepartmentApi apiInstance = new DepartmentApi();
        InsertObject body = ; // InsertObject | An object with department and agents array
        try {
            ResponseInsertUpdate result = apiInstance.insertDepartment(body);
            System.out.println(result);
        } catch (ApiException e) {
            System.err.println("Exception when calling DepartmentApi#insertDepartment");
            e.printStackTrace();
        }
    }
}
import io.swagger.client.api.DepartmentApi;

public class DepartmentApiExample {

    public static void main(String[] args) {
        DepartmentApi apiInstance = new DepartmentApi();
        InsertObject body = ; // InsertObject | An object with department and agents array
        try {
            ResponseInsertUpdate result = apiInstance.insertDepartment(body);
            System.out.println(result);
        } catch (ApiException e) {
            System.err.println("Exception when calling DepartmentApi#insertDepartment");
            e.printStackTrace();
        }
    }
}
InsertObject *body = ; // An object with department and agents array

DepartmentApi *apiInstance = [[DepartmentApi alloc] init];

// Add a new department with your agents
[apiInstance insertDepartmentWith:body
              completionHandler: ^(ResponseInsertUpdate output, NSError* error) {
                            if (output) {
                                NSLog(@"%@", output);
                            }
                            if (error) {
                                NSLog(@"Error: %@", error);
                            }
                        }];
var RestApiLivechat = require('rest_api___livechat');

var api = new RestApiLivechat.DepartmentApi()

var body = ; // {InsertObject} An object with department and agents array


var callback = function(error, data, response) {
  if (error) {
    console.error(error);
  } else {
    console.log('API called successfully. Returned data: ' + data);
  }
};
api.insertDepartment(body, callback);
using System;
using System.Diagnostics;
using IO.Swagger.Api;
using IO.Swagger.Client;
using IO.Swagger.Model;

namespace Example
{
    public class insertDepartmentExample
    {
        public void main()
        {
            
            var apiInstance = new DepartmentApi();
            var body = new InsertObject(); // InsertObject | An object with department and agents array

            try
            {
                // Add a new department with your agents
                ResponseInsertUpdate result = apiInstance.insertDepartment(body);
                Debug.WriteLine(result);
            }
            catch (Exception e)
            {
                Debug.Print("Exception when calling DepartmentApi.insertDepartment: " + e.Message );
            }
        }
    }
}
<?php
require_once(__DIR__ . '/vendor/autoload.php');

$api_instance = new Swagger\Client\Api\DepartmentApi();
$body = ; // InsertObject | An object with department and agents array

try {
    $result = $api_instance->insertDepartment($body);
    print_r($result);
} catch (Exception $e) {
    echo 'Exception when calling DepartmentApi->insertDepartment: ', $e->getMessage(), PHP_EOL;
}
?>
use Data::Dumper;
use WWW::SwaggerClient::Configuration;
use WWW::SwaggerClient::DepartmentApi;

my $api_instance = WWW::SwaggerClient::DepartmentApi->new();
my $body = WWW::SwaggerClient::Object::InsertObject->new(); # InsertObject | An object with department and agents array

eval { 
    my $result = $api_instance->insertDepartment(body => $body);
    print Dumper($result);
};
if ($@) {
    warn "Exception when calling DepartmentApi->insertDepartment: $@\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.DepartmentApi()
body =  # InsertObject | An object with department and agents array

try: 
    # Add a new department with your agents
    api_response = api_instance.insert_department(body)
    pprint(api_response)
except ApiException as e:
    print("Exception when calling DepartmentApi->insertDepartment: %s\n" % e)

Parameters

Body parameters
Name Description
body *

Responses

Status: 200 - Successfull operation

Status: 400 - Bad request


removeDepartmentById

Remove Department by id

Remove an Department by id


/department/{id}

Usage and SDK Samples

curl -X DELETE "http://localhost:3000/v1/livechat/department/{id}"
import io.swagger.client.*;
import io.swagger.client.auth.*;
import io.swagger.client.model.*;
import io.swagger.client.api.DepartmentApi;

import java.io.File;
import java.util.*;

public class DepartmentApiExample {

    public static void main(String[] args) {
        
        DepartmentApi apiInstance = new DepartmentApi();
        String id = id_example; // String | Id of department to be remove
        try {
            SuccessObject result = apiInstance.removeDepartmentById(id);
            System.out.println(result);
        } catch (ApiException e) {
            System.err.println("Exception when calling DepartmentApi#removeDepartmentById");
            e.printStackTrace();
        }
    }
}
import io.swagger.client.api.DepartmentApi;

public class DepartmentApiExample {

    public static void main(String[] args) {
        DepartmentApi apiInstance = new DepartmentApi();
        String id = id_example; // String | Id of department to be remove
        try {
            SuccessObject result = apiInstance.removeDepartmentById(id);
            System.out.println(result);
        } catch (ApiException e) {
            System.err.println("Exception when calling DepartmentApi#removeDepartmentById");
            e.printStackTrace();
        }
    }
}
String *id = id_example; // Id of department to be remove

DepartmentApi *apiInstance = [[DepartmentApi alloc] init];

// Remove Department by id
[apiInstance removeDepartmentByIdWith:id
              completionHandler: ^(SuccessObject output, NSError* error) {
                            if (output) {
                                NSLog(@"%@", output);
                            }
                            if (error) {
                                NSLog(@"Error: %@", error);
                            }
                        }];
var RestApiLivechat = require('rest_api___livechat');

var api = new RestApiLivechat.DepartmentApi()

var id = id_example; // {String} Id of department to be remove


var callback = function(error, data, response) {
  if (error) {
    console.error(error);
  } else {
    console.log('API called successfully. Returned data: ' + data);
  }
};
api.removeDepartmentById(id, callback);
using System;
using System.Diagnostics;
using IO.Swagger.Api;
using IO.Swagger.Client;
using IO.Swagger.Model;

namespace Example
{
    public class removeDepartmentByIdExample
    {
        public void main()
        {
            
            var apiInstance = new DepartmentApi();
            var id = id_example;  // String | Id of department to be remove

            try
            {
                // Remove Department by id
                SuccessObject result = apiInstance.removeDepartmentById(id);
                Debug.WriteLine(result);
            }
            catch (Exception e)
            {
                Debug.Print("Exception when calling DepartmentApi.removeDepartmentById: " + e.Message );
            }
        }
    }
}
<?php
require_once(__DIR__ . '/vendor/autoload.php');

$api_instance = new Swagger\Client\Api\DepartmentApi();
$id = id_example; // String | Id of department to be remove

try {
    $result = $api_instance->removeDepartmentById($id);
    print_r($result);
} catch (Exception $e) {
    echo 'Exception when calling DepartmentApi->removeDepartmentById: ', $e->getMessage(), PHP_EOL;
}
?>
use Data::Dumper;
use WWW::SwaggerClient::Configuration;
use WWW::SwaggerClient::DepartmentApi;

my $api_instance = WWW::SwaggerClient::DepartmentApi->new();
my $id = id_example; # String | Id of department to be remove

eval { 
    my $result = $api_instance->removeDepartmentById(id => $id);
    print Dumper($result);
};
if ($@) {
    warn "Exception when calling DepartmentApi->removeDepartmentById: $@\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.DepartmentApi()
id = id_example # String | Id of department to be remove

try: 
    # Remove Department by id
    api_response = api_instance.remove_department_by_id(id)
    pprint(api_response)
except ApiException as e:
    print("Exception when calling DepartmentApi->removeDepartmentById: %s\n" % e)

Parameters

Path parameters
Name Description
id*
String
Id of department to be remove
Required

Responses

Status: 200 - Successfull operation

Status: 400 - Bad request

Status: 404 - Not Found


updateDepartment

Update an existing department

An object with department and agents array


/department/{id}

Usage and SDK Samples

curl -X PUT "http://localhost:3000/v1/livechat/department/{id}"
import io.swagger.client.*;
import io.swagger.client.auth.*;
import io.swagger.client.model.*;
import io.swagger.client.api.DepartmentApi;

import java.io.File;
import java.util.*;

public class DepartmentApiExample {

    public static void main(String[] args) {
        
        DepartmentApi apiInstance = new DepartmentApi();
        String id = id_example; // String | Id of department to be update
        InsertObject body = ; // InsertObject | An object with department and agents array
        try {
            ResponseInsertUpdate result = apiInstance.updateDepartment(id, body);
            System.out.println(result);
        } catch (ApiException e) {
            System.err.println("Exception when calling DepartmentApi#updateDepartment");
            e.printStackTrace();
        }
    }
}
import io.swagger.client.api.DepartmentApi;

public class DepartmentApiExample {

    public static void main(String[] args) {
        DepartmentApi apiInstance = new DepartmentApi();
        String id = id_example; // String | Id of department to be update
        InsertObject body = ; // InsertObject | An object with department and agents array
        try {
            ResponseInsertUpdate result = apiInstance.updateDepartment(id, body);
            System.out.println(result);
        } catch (ApiException e) {
            System.err.println("Exception when calling DepartmentApi#updateDepartment");
            e.printStackTrace();
        }
    }
}
String *id = id_example; // Id of department to be update
InsertObject *body = ; // An object with department and agents array

DepartmentApi *apiInstance = [[DepartmentApi alloc] init];

// Update an existing department
[apiInstance updateDepartmentWith:id
    body:body
              completionHandler: ^(ResponseInsertUpdate output, NSError* error) {
                            if (output) {
                                NSLog(@"%@", output);
                            }
                            if (error) {
                                NSLog(@"Error: %@", error);
                            }
                        }];
var RestApiLivechat = require('rest_api___livechat');

var api = new RestApiLivechat.DepartmentApi()

var id = id_example; // {String} Id of department to be update

var body = ; // {InsertObject} An object with department and agents array


var callback = function(error, data, response) {
  if (error) {
    console.error(error);
  } else {
    console.log('API called successfully. Returned data: ' + data);
  }
};
api.updateDepartment(id, body, callback);
using System;
using System.Diagnostics;
using IO.Swagger.Api;
using IO.Swagger.Client;
using IO.Swagger.Model;

namespace Example
{
    public class updateDepartmentExample
    {
        public void main()
        {
            
            var apiInstance = new DepartmentApi();
            var id = id_example;  // String | Id of department to be update
            var body = new InsertObject(); // InsertObject | An object with department and agents array

            try
            {
                // Update an existing department
                ResponseInsertUpdate result = apiInstance.updateDepartment(id, body);
                Debug.WriteLine(result);
            }
            catch (Exception e)
            {
                Debug.Print("Exception when calling DepartmentApi.updateDepartment: " + e.Message );
            }
        }
    }
}
<?php
require_once(__DIR__ . '/vendor/autoload.php');

$api_instance = new Swagger\Client\Api\DepartmentApi();
$id = id_example; // String | Id of department to be update
$body = ; // InsertObject | An object with department and agents array

try {
    $result = $api_instance->updateDepartment($id, $body);
    print_r($result);
} catch (Exception $e) {
    echo 'Exception when calling DepartmentApi->updateDepartment: ', $e->getMessage(), PHP_EOL;
}
?>
use Data::Dumper;
use WWW::SwaggerClient::Configuration;
use WWW::SwaggerClient::DepartmentApi;

my $api_instance = WWW::SwaggerClient::DepartmentApi->new();
my $id = id_example; # String | Id of department to be update
my $body = WWW::SwaggerClient::Object::InsertObject->new(); # InsertObject | An object with department and agents array

eval { 
    my $result = $api_instance->updateDepartment(id => $id, body => $body);
    print Dumper($result);
};
if ($@) {
    warn "Exception when calling DepartmentApi->updateDepartment: $@\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.DepartmentApi()
id = id_example # String | Id of department to be update
body =  # InsertObject | An object with department and agents array

try: 
    # Update an existing department
    api_response = api_instance.update_department(id, body)
    pprint(api_response)
except ApiException as e:
    print("Exception when calling DepartmentApi->updateDepartment: %s\n" % e)

Parameters

Path parameters
Name Description
id*
String
Id of department to be update
Required
Body parameters
Name Description
body *

Responses

Status: 200 - Successfull operation

Status: 400 - Bad request

Status: 404 - Not Found


Generated 2017-12-19T15:16:17.275Z