Skip to content

Latest commit

 

History

History
190 lines (141 loc) · 7.16 KB

File metadata and controls

190 lines (141 loc) · 7.16 KB

liveagent_api.DepartmentsApi

All URIs are relative to https://localhost/api/v3

Method HTTP request Description
get_department_list GET /departments Gets list of departments
get_specific_department GET /departments/{departmentId} Get department by specific id
if_agent_is_in_department GET /departments/{departmentId}/{agentId} Is the agent in the department

get_department_list

list[Department] get_department_list(page=page, per_page=per_page, _from=_from, to=to, sort_dir=sort_dir, sort_field=sort_field, filters=filters)

Gets list of departments

Example

from __future__ import print_function
import time
import liveagent_api
from liveagent_api.rest import ApiException
from pprint import pprint

# Configure API key authorization: apikey
configuration = liveagent_api.Configuration()
configuration.api_key['apikey'] = 'YOUR_API_KEY'
# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
# configuration.api_key_prefix['apikey'] = 'Bearer'
# Configure OAuth2 access token for authorization: privileges
configuration = liveagent_api.Configuration()
configuration.access_token = 'YOUR_ACCESS_TOKEN'

# create an instance of the API class
api_instance = liveagent_api.DepartmentsApi(liveagent_api.ApiClient(configuration))
page = 1 # int | Page to display. Not used if _from is defined. (optional) (default to 1)
per_page = 10 # int | Results per page. Used only if _page is used. (optional) (default to 10)
_from = 0 # int | Result set start. Takes precedence over _page. (optional) (default to 0)
to = 0 # int | Result set end. Used only if _from is used. (optional) (default to 0)
sort_dir = 'ASC' # str | Sorting direction ASC or DESC (optional) (default to ASC)
sort_field = 'sort_field_example' # str | Sorting field (optional)
filters = 'filters_example' # str | Filter as json object {\"column1\":\"value\", \"column2\":\"value\", ...} or list of filters as json array [[\"column\",\"operator\",\"value\"], ...] (optional)

try:
    # Gets list of departments
    api_response = api_instance.get_department_list(page=page, per_page=per_page, _from=_from, to=to, sort_dir=sort_dir, sort_field=sort_field, filters=filters)
    pprint(api_response)
except ApiException as e:
    print("Exception when calling DepartmentsApi->get_department_list: %s\n" % e)

Parameters

Name Type Description Notes
page int Page to display. Not used if _from is defined. [optional] [default to 1]
per_page int Results per page. Used only if _page is used. [optional] [default to 10]
_from int Result set start. Takes precedence over _page. [optional] [default to 0]
to int Result set end. Used only if _from is used. [optional] [default to 0]
sort_dir str Sorting direction ASC or DESC [optional] [default to ASC]
sort_field str Sorting field [optional]
filters str Filter as json object {"column1":"value", "column2":"value", ...} or list of filters as json array [["column","operator","value"], ...] [optional]

Return type

list[Department]

Authorization

apikey, privileges

HTTP request headers

  • Content-Type: application/json
  • Accept: application/json

[Back to top] [Back to API list] [Back to Model list] [Back to README]

get_specific_department

Department get_specific_department(department_id)

Get department by specific id

Example

from __future__ import print_function
import time
import liveagent_api
from liveagent_api.rest import ApiException
from pprint import pprint

# Configure API key authorization: apikey
configuration = liveagent_api.Configuration()
configuration.api_key['apikey'] = 'YOUR_API_KEY'
# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
# configuration.api_key_prefix['apikey'] = 'Bearer'
# Configure OAuth2 access token for authorization: privileges
configuration = liveagent_api.Configuration()
configuration.access_token = 'YOUR_ACCESS_TOKEN'

# create an instance of the API class
api_instance = liveagent_api.DepartmentsApi(liveagent_api.ApiClient(configuration))
department_id = 'department_id_example' # str | 

try:
    # Get department by specific id
    api_response = api_instance.get_specific_department(department_id)
    pprint(api_response)
except ApiException as e:
    print("Exception when calling DepartmentsApi->get_specific_department: %s\n" % e)

Parameters

Name Type Description Notes
department_id str

Return type

Department

Authorization

apikey, privileges

HTTP request headers

  • Content-Type: application/json
  • Accept: application/json

[Back to top] [Back to API list] [Back to Model list] [Back to README]

if_agent_is_in_department

OkResponse if_agent_is_in_department(department_id, agent_id)

Is the agent in the department

Example

from __future__ import print_function
import time
import liveagent_api
from liveagent_api.rest import ApiException
from pprint import pprint

# Configure API key authorization: apikey
configuration = liveagent_api.Configuration()
configuration.api_key['apikey'] = 'YOUR_API_KEY'
# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
# configuration.api_key_prefix['apikey'] = 'Bearer'
# Configure OAuth2 access token for authorization: privileges
configuration = liveagent_api.Configuration()
configuration.access_token = 'YOUR_ACCESS_TOKEN'

# create an instance of the API class
api_instance = liveagent_api.DepartmentsApi(liveagent_api.ApiClient(configuration))
department_id = 'department_id_example' # str | 
agent_id = 'agent_id_example' # str | 

try:
    # Is the agent in the department
    api_response = api_instance.if_agent_is_in_department(department_id, agent_id)
    pprint(api_response)
except ApiException as e:
    print("Exception when calling DepartmentsApi->if_agent_is_in_department: %s\n" % e)

Parameters

Name Type Description Notes
department_id str
agent_id str

Return type

OkResponse

Authorization

apikey, privileges

HTTP request headers

  • Content-Type: application/json
  • Accept: application/json

[Back to top] [Back to API list] [Back to Model list] [Back to README]