Skip to content

Latest commit

 

History

History
291 lines (211 loc) · 9.93 KB

File metadata and controls

291 lines (211 loc) · 9.93 KB

liveagent_api.ContactsApi

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

Method HTTP request Description
create_contact POST /contacts Create new contact
delete_contact DELETE /contacts/{contactId} Delete contact
get_contacts_list GET /contacts Gets list of contacts
get_specific_contact GET /contacts/{contactId} Get contact by specific id
update_contact PUT /contacts/{contactId} Update contact

create_contact

list[Contact] create_contact(contact=contact)

Create new contact

Example

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

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

# create an instance of the API class
api_instance = liveagent_api.ContactsApi()
contact = liveagent_api.Contact() # Contact |  (optional)

try: 
    # Create new contact
    api_response = api_instance.create_contact(contact=contact)
    pprint(api_response)
except ApiException as e:
    print "Exception when calling ContactsApi->create_contact: %s\n" % e

Parameters

Name Type Description Notes
contact Contact [optional]

Return type

list[Contact]

Authorization

privileges, apikey

HTTP request headers

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

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

delete_contact

OkResponse delete_contact(contact_id, delete_tickets)

Delete contact

Deletes a contact

Example

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

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

# create an instance of the API class
api_instance = liveagent_api.ContactsApi()
contact_id = 'contact_id_example' # str | 
delete_tickets = true # bool | <u>true</u>: Delete customer from all lists and also delete all his tickets.<br> <u>false</u>: Delete customer from all lists but leave his tickets intact.

try: 
    # Delete contact
    api_response = api_instance.delete_contact(contact_id, delete_tickets)
    pprint(api_response)
except ApiException as e:
    print "Exception when calling ContactsApi->delete_contact: %s\n" % e

Parameters

Name Type Description Notes
contact_id str
delete_tickets bool <u>true</u>: Delete customer from all lists and also delete all his tickets.<br> <u>false</u>: Delete customer from all lists but leave his tickets intact.

Return type

OkResponse

Authorization

privileges, apikey

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_contacts_list

list[ContactListItem] get_contacts_list(page=page, per_page=per_page, _from=_from, to=to, sort_dir=sort_dir, sort_field=sort_field, filters=filters)

Gets list of contacts

Example

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

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

# create an instance of the API class
api_instance = liveagent_api.ContactsApi()
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 | Filters (json object {column:value, ...}) (optional)

try: 
    # Gets list of contacts
    api_response = api_instance.get_contacts_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 ContactsApi->get_contacts_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 Filters (json object {column:value, ...}) [optional]

Return type

list[ContactListItem]

Authorization

privileges, apikey

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_contact

list[Contact] get_specific_contact(contact_id)

Get contact by specific id

Example

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

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

# create an instance of the API class
api_instance = liveagent_api.ContactsApi()
contact_id = 'contact_id_example' # str | 

try: 
    # Get contact by specific id
    api_response = api_instance.get_specific_contact(contact_id)
    pprint(api_response)
except ApiException as e:
    print "Exception when calling ContactsApi->get_specific_contact: %s\n" % e

Parameters

Name Type Description Notes
contact_id str

Return type

list[Contact]

Authorization

privileges, apikey

HTTP request headers

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

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

update_contact

list[Contact] update_contact(contact_id, contact=contact)

Update contact

Example

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

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

# create an instance of the API class
api_instance = liveagent_api.ContactsApi()
contact_id = 'contact_id_example' # str | 
contact = liveagent_api.Contact() # Contact |  (optional)

try: 
    # Update contact
    api_response = api_instance.update_contact(contact_id, contact=contact)
    pprint(api_response)
except ApiException as e:
    print "Exception when calling ContactsApi->update_contact: %s\n" % e

Parameters

Name Type Description Notes
contact_id str
contact Contact [optional]

Return type

list[Contact]

Authorization

privileges, apikey

HTTP request headers

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

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