Skip to content

Latest commit

 

History

History
475 lines (345 loc) · 15.5 KB

File metadata and controls

475 lines (345 loc) · 15.5 KB

chatwoot_client.ContactsApi

All URIs are relative to https://app.chatwoot.com/

Method HTTP request Description
contact_conversations GET /api/v1/accounts/{account_id}/contacts/{id}/conversations Contact Conversations
contact_create POST /api/v1/accounts/{account_id}/contacts Create Contact
contact_delete DELETE /api/v1/accounts/{account_id}/contacts/{id} Delete Contact
contact_details GET /api/v1/accounts/{account_id}/contacts/{id} Show Contact
contact_filter POST /api/v1/accounts/{account_id}/contacts/filter Contact Filter
contact_list GET /api/v1/accounts/{account_id}/contacts List Contacts
contact_search GET /api/v1/accounts/{account_id}/contacts/search Search Contacts
contact_update PUT /api/v1/accounts/{account_id}/contacts/{id} Update Contact

contact_conversations

ContactConversations contact_conversations(account_id, id)

Contact Conversations

Get conversations associated to that contact

Example

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

# Configure API key authorization: userApiKey
configuration = chatwoot_client.Configuration()
configuration.api_key['api_access_token'] = 'YOUR_API_KEY'
# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
# configuration.api_key_prefix['api_access_token'] = 'Bearer'

# create an instance of the API class
api_instance = chatwoot_client.ContactsApi(chatwoot_client.ApiClient(configuration))
account_id = 56 # int | The numeric ID of the account
id = 56 # int | ID of the contact

try:
    # Contact Conversations
    api_response = api_instance.contact_conversations(account_id, id)
    pprint(api_response)
except ApiException as e:
    print("Exception when calling ContactsApi->contact_conversations: %s\n" % e)

Parameters

Name Type Description Notes
account_id int The numeric ID of the account
id int ID of the contact

Return type

ContactConversations

Authorization

userApiKey

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json; charset=utf-8

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

contact_create

ExtendedContact contact_create(body, account_id)

Create Contact

Create a new Contact

Example

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

# Configure API key authorization: userApiKey
configuration = chatwoot_client.Configuration()
configuration.api_key['api_access_token'] = 'YOUR_API_KEY'
# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
# configuration.api_key_prefix['api_access_token'] = 'Bearer'

# create an instance of the API class
api_instance = chatwoot_client.ContactsApi(chatwoot_client.ApiClient(configuration))
body = chatwoot_client.ContactCreate() # ContactCreate | 
account_id = 56 # int | The numeric ID of the account

try:
    # Create Contact
    api_response = api_instance.contact_create(body, account_id)
    pprint(api_response)
except ApiException as e:
    print("Exception when calling ContactsApi->contact_create: %s\n" % e)

Parameters

Name Type Description Notes
body ContactCreate
account_id int The numeric ID of the account

Return type

ExtendedContact

Authorization

userApiKey

HTTP request headers

  • Content-Type: application/json; charset=utf-8
  • Accept: application/json; charset=utf-8

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

contact_delete

contact_delete(account_id, id)

Delete Contact

Example

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

# Configure API key authorization: userApiKey
configuration = chatwoot_client.Configuration()
configuration.api_key['api_access_token'] = 'YOUR_API_KEY'
# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
# configuration.api_key_prefix['api_access_token'] = 'Bearer'

# create an instance of the API class
api_instance = chatwoot_client.ContactsApi(chatwoot_client.ApiClient(configuration))
account_id = 56 # int | The numeric ID of the account
id = 56 # int | ID of the contact

try:
    # Delete Contact
    api_instance.contact_delete(account_id, id)
except ApiException as e:
    print("Exception when calling ContactsApi->contact_delete: %s\n" % e)

Parameters

Name Type Description Notes
account_id int The numeric ID of the account
id int ID of the contact

Return type

void (empty response body)

Authorization

userApiKey

HTTP request headers

  • Content-Type: Not defined
  • Accept: Not defined

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

contact_details

ExtendedContact contact_details(account_id, id)

Show Contact

Get a contact belonging to the account using ID

Example

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

# Configure API key authorization: userApiKey
configuration = chatwoot_client.Configuration()
configuration.api_key['api_access_token'] = 'YOUR_API_KEY'
# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
# configuration.api_key_prefix['api_access_token'] = 'Bearer'

# create an instance of the API class
api_instance = chatwoot_client.ContactsApi(chatwoot_client.ApiClient(configuration))
account_id = 56 # int | The numeric ID of the account
id = 56 # int | ID of the contact

try:
    # Show Contact
    api_response = api_instance.contact_details(account_id, id)
    pprint(api_response)
except ApiException as e:
    print("Exception when calling ContactsApi->contact_details: %s\n" % e)

Parameters

Name Type Description Notes
account_id int The numeric ID of the account
id int ID of the contact

Return type

ExtendedContact

Authorization

userApiKey

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json; charset=utf-8

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

contact_filter

ContactList contact_filter(body, account_id, page=page)

Contact Filter

Filter contacts with custom filter options and pagination

Example

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

# Configure API key authorization: agentBotApiKey
configuration = chatwoot_client.Configuration()
configuration.api_key['api_access_token'] = 'YOUR_API_KEY'
# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
# configuration.api_key_prefix['api_access_token'] = 'Bearer'
# Configure API key authorization: userApiKey
configuration = chatwoot_client.Configuration()
configuration.api_key['api_access_token'] = 'YOUR_API_KEY'
# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
# configuration.api_key_prefix['api_access_token'] = 'Bearer'

# create an instance of the API class
api_instance = chatwoot_client.ContactsApi(chatwoot_client.ApiClient(configuration))
body = chatwoot_client.ContactsFilterBody() # ContactsFilterBody | 
account_id = 56 # int | The numeric ID of the account
page = 56 # int |  (optional)

try:
    # Contact Filter
    api_response = api_instance.contact_filter(body, account_id, page=page)
    pprint(api_response)
except ApiException as e:
    print("Exception when calling ContactsApi->contact_filter: %s\n" % e)

Parameters

Name Type Description Notes
body ContactsFilterBody
account_id int The numeric ID of the account
page int [optional]

Return type

ContactList

Authorization

agentBotApiKey, userApiKey

HTTP request headers

  • Content-Type: application/json; charset=utf-8
  • Accept: application/json; charset=utf-8

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

contact_list

ContactList contact_list(account_id, sort=sort, page=page)

List Contacts

Listing all the resolved contacts with pagination (Page size = 15) . Resolved contacts are the ones with a value for identifier, email or phone number

Example

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

# Configure API key authorization: userApiKey
configuration = chatwoot_client.Configuration()
configuration.api_key['api_access_token'] = 'YOUR_API_KEY'
# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
# configuration.api_key_prefix['api_access_token'] = 'Bearer'

# create an instance of the API class
api_instance = chatwoot_client.ContactsApi(chatwoot_client.ApiClient(configuration))
account_id = 56 # int | The numeric ID of the account
sort = 'sort_example' # str | The attribute by which list should be sorted (optional)
page = 1 # int | The page parameter (optional) (default to 1)

try:
    # List Contacts
    api_response = api_instance.contact_list(account_id, sort=sort, page=page)
    pprint(api_response)
except ApiException as e:
    print("Exception when calling ContactsApi->contact_list: %s\n" % e)

Parameters

Name Type Description Notes
account_id int The numeric ID of the account
sort str The attribute by which list should be sorted [optional]
page int The page parameter [optional] [default to 1]

Return type

ContactList

Authorization

userApiKey

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json; charset=utf-8

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

contact_search

InlineResponse2002 contact_search(account_id, q=q, sort=sort, page=page)

Search Contacts

Search the resolved contacts using a search key, currently supports email search (Page size = 15). Resolved contacts are the ones with a value for identifier, email or phone number

Example

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

# Configure API key authorization: userApiKey
configuration = chatwoot_client.Configuration()
configuration.api_key['api_access_token'] = 'YOUR_API_KEY'
# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
# configuration.api_key_prefix['api_access_token'] = 'Bearer'

# create an instance of the API class
api_instance = chatwoot_client.ContactsApi(chatwoot_client.ApiClient(configuration))
account_id = 56 # int | The numeric ID of the account
q = 'q_example' # str | Search using contact `name`, `identifier`, `email` or `phone number` (optional)
sort = 'sort_example' # str | The attribute by which list should be sorted (optional)
page = 1 # int | The page parameter (optional) (default to 1)

try:
    # Search Contacts
    api_response = api_instance.contact_search(account_id, q=q, sort=sort, page=page)
    pprint(api_response)
except ApiException as e:
    print("Exception when calling ContactsApi->contact_search: %s\n" % e)

Parameters

Name Type Description Notes
account_id int The numeric ID of the account
q str Search using contact `name`, `identifier`, `email` or `phone number` [optional]
sort str The attribute by which list should be sorted [optional]
page int The page parameter [optional] [default to 1]

Return type

InlineResponse2002

Authorization

userApiKey

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json; charset=utf-8

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

contact_update

ContactBase contact_update(body, account_id, id)

Update Contact

Update a contact belonging to the account using ID

Example

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

# Configure API key authorization: userApiKey
configuration = chatwoot_client.Configuration()
configuration.api_key['api_access_token'] = 'YOUR_API_KEY'
# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
# configuration.api_key_prefix['api_access_token'] = 'Bearer'

# create an instance of the API class
api_instance = chatwoot_client.ContactsApi(chatwoot_client.ApiClient(configuration))
body = chatwoot_client.ContactUpdate() # ContactUpdate | 
account_id = 56 # int | The numeric ID of the account
id = 56 # int | ID of the contact

try:
    # Update Contact
    api_response = api_instance.contact_update(body, account_id, id)
    pprint(api_response)
except ApiException as e:
    print("Exception when calling ContactsApi->contact_update: %s\n" % e)

Parameters

Name Type Description Notes
body ContactUpdate
account_id int The numeric ID of the account
id int ID of the contact

Return type

ContactBase

Authorization

userApiKey

HTTP request headers

  • Content-Type: application/json; charset=utf-8
  • Accept: application/json; charset=utf-8

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