import apideck
from apideck.api import crm_api
from apideck.model.contacts_sort import ContactsSort
from apideck.model.sort_direction import SortDirection
from pprint import pprint
configuration = apideck.Configuration()
configuration.api_key['apiKey'] = '<insert-api-key-here>'
configuration.api_key_prefix['apiKey'] = 'Bearer'
with apideck.ApiClient(configuration) as api_client:
# Create an instance of the API class
api_instance = crm_api.CrmApi(api_client)
raw = False
consumer_id = '<insert-consumer-id-here>'
app_id = '<insert-application-id-here>'
service_id = '<insert-service-id-here>'
limit = 20
sort = ContactsSort(
by="name",
direction=SortDirection("asc"),
)
try:
# List contacts
api_response = api_instance.contacts_all(raw=raw, consumer_id=consumer_id, app_id=app_id, service_id=service_id, limit=limit, sort=sort)
pprint(api_response)
except apideck.ApiException as e:
print("Exception when calling CrmApi->contacts_all: %s
" % e)