Show as Unauthorzied, but added to view on al

apiclient = PureCloudPlatformClientV2.api_client.ApiClient().get_client_credentials_token(os.environ['CLIENT_ID'], os.environ['CLIENT_SECRET'])
authApi = PureCloudPlatformClientV2.AuthorizationApi(apiclient)

print(authApi.get_authorization_permissions())

api_instance= PureCloudPlatformClientV2.ConversationsApi()
page_size= 5000
page_number= 1
interval= '2024-02-06T00:00:00Z/2024-02-10T00:00:00'

try:
# Get call history
api_response = api_instance.get_conversations_calls_history(page_size=page_size, page_number=page_number, interval=interval)
print(api_response)
except ApiException as e:
print("Exception when calling ConversationsApi->get_conversations_calls_history: %s\n" % e)

Output:
C:\Users\tvo1\AppData\Local\Programs\Python\Python311\python.exe C:\Users\tvo1\Python\Python\Genesys-Flask.py
{'entities': [{'domain': 'analytics',
'id': None,
'name': None,
'permission_map': {'agentConversationDetail': [{'action': 'view',
'allows_conditions': True,
'division_aware': False,
'domain': 'analytics',
'entity_type': 'agentConversationDetail',
'label': "Query for an agent's conversation details"}],
'botAggregate': [{'action': 'view',
'allows_conditions': True,
'division_aware': False,
'domain': 'analytics',
'entity_type': 'botAggregate',
'label': 'Query for bot aggregates'}],
'conversationAggregate': [{'action': 'view',
'allows_conditions': True,
'division_aware': True,
'domain': 'analytics',
'entity_type': 'conversationAggregate',
'label': 'Query for conversation aggregates'}],
'conversationDetail': [{'action': 'view',
'allows_conditions': True,
'division_aware': True,
'domain': 'analytics',
'entity_type': 'conversationDetail',
'label': 'Query for conversation details'}],
'conversationProperties': [{'action': 'index',
'allows_conditions': False,
'division_aware': True,
'domain': 'analytics',
'entity_type': 'conversationProperties',
'label': 'Index conversation properties'}],
'dashboardConfigurations': [{'action': 'deleteActive',
'allows_conditions': False,
'division_aware': False,
'domain': 'analytics',
'entity_type': 'dashboardConfigurations',
'label': 'Delete dashboard configurations for any active user in the org'},
{'action': 'deleteInactive',
'allows_conditions': False,
'division_aware': False,
'domain': 'analytics',
'entity_type': 'dashboardConfigurations',
'label': 'Delete dashboard configurations for any inactive user in the org'},
{'action': 'edit',
'allows_conditions': False,
'division_aware': False,
'domain': 'analytics',
'entity_type': 'dashboardConfigurations',
'label': 'Query for dashboard configurations'},
{'action': 'publish',
'allows_conditions': False,
'division_aware': False,
'domain': 'analytics',
'entity_type': 'dashboardConfigurations',
'label': 'Make dashboard configurations public'},
{'action': 'view',
'allows_conditions': False,
'division_aware': False,
'domain': 'analytics',
'entity_type': 'dashboardConfigurations',
'label': 'Query for dashboard configurations'},
{'action': 'viewPrivate',
'allows_conditions': False,
'division_aware': False,
'domain': 'analytics',
'entity_type': 'dashboardConfigurations',
'label': 'Query for private dashboard configurations of any user in the org'}]},
'self_uri': '/api/v2/authorization/permissions'},
{'domain': 'acdvideo',
'id': None,
'name': None,
'permission_map': {'session': [{'action': 'view',
'allows_conditions': False,
'division_aware': False,
'domain': 'acdvideo',
'entity_type': 'session',
'label': 'View ACD video sessions'}]},
'self_uri': '/api/v2/authorization/permissions'},
{'domain': 'agentUI',
'id': None,
'name': None,
'permission_map': {'defaultPanels': [{'action': 'edit',
'allows_conditions': False,
'division_aware': False,
'domain': 'agentUI',
'entity_type': 'defaultPanels',
'label': 'Edit Agent UI default panel settings'},
{'action': 'view',
'allows_conditions': False,
'division_aware': False,
'domain': 'agentUI',
'entity_type': 'defaultPanels',
'label': 'View Agent UI default panel settings'}]},
'self_uri': '/api/v2/authorization/permissions'},
{'domain': 'acdscreenshare',
'id': None,
'name': None,
'permission_map': {'chat': [{'action': 'escalate',
'allows_conditions': False,
'division_aware': False,
'domain': 'acdscreenshare',
'entity_type': 'chat',
'label': 'Allows agent to escalate a chat to a screenshare'}],
'session': [{'action': 'view',
'allows_conditions': False,
'division_aware': False,
'domain': 'acdscreenshare',
'entity_type': 'session',
'label': 'Allows viewing ACD screen share session'}],
'voice': [{'action': 'escalate',
'allows_conditions': False,
'division_aware': False,
'domain': 'acdscreenshare',
'entity_type': 'voice',
'label': 'Allows agent to escalate a voice call to a screenshare'}]},
'self_uri': '/api/v2/authorization/permissions'},
{'domain': 'alerting',
'id': None,
'name': None,
'permission_map': {'alert': [{'action': 'add',
'allows_conditions': False,
'division_aware': False,
'domain': 'alerting',
'entity_type': 'alert',
'label': 'Add an alert configuration'},
{'action': 'delete',
'allows_conditions': False,
'division_aware': False,
'domain': 'alerting',
'entity_type': 'alert',
'label': 'Delete an alert configuration'},
{'action': 'edit',
'allows_conditions': False,
'division_aware': False,
'domain': 'alerting',
'entity_type': 'alert',
'label': 'Edit an alert configuration'},
{'action': 'view',
'allows_conditions': False,
'division_aware': False,
'domain': 'alerting',
'entity_type': 'alert',
'label': 'View alert configurations'}],
'rule': [{'action': 'add',
'allows_conditions': False,
'division_aware': False,
'domain': 'alerting',
'entity_type': 'rule',
'label': 'Add an alert configuration'},
{'action': 'delete',
'allows_conditions': False,
'division_aware': False,
'domain': 'alerting',
'entity_type': 'rule',
'label': 'Delete an alert configuration'},
{'action': 'edit',
'allows_conditions': False,
'division_aware': False,
'domain': 'alerting',
'entity_type': 'rule',
'label': 'Edit an alert configuration'},
{'action': 'view',
'allows_conditions': False,
'division_aware': False,
'domain': 'alerting',
'entity_type': 'rule',
'label': 'View alert configurations'}]},
'self_uri': '/api/v2/authorization/permissions'}],
'first_uri': '/api/v2/authorization/permissions?pageSize=25&pageNumber=1',
'last_uri': '/api/v2/authorization/permissions?pageSize=25&pageNumber=42',
'next_uri': '/api/v2/authorization/permissions?pageSize=25&pageNumber=2',
'page_count': 42,
'page_number': 1,
'page_size': 25,
'previous_uri': None,
'self_uri': '/api/v2/authorization/permissions?pageSize=25&pageNumber=1',
'total': 1035}
Exception when calling ConversationsApi->get_conversations_calls_history: (401)
Reason: Unauthorized
HTTP response headers: HTTPHeaderDict({'Content-Type': 'application/json', 'Content-Length': '201', 'Connection': 'keep-alive', 'Date': 'Fri, 12 Apr 2024 15:54:23 GMT', 'ININ-Correlation-Id': 'a6a78557-6615-4bbe-85f1-838b1673e2c4', 'Strict-Transport-Security': 'max-age=31536000; includeSubDomains', 'Cache-Control': 'no-cache, no-store, must-revalidate', 'X-Cache': 'Error from cloudfront', 'Via': '1.1 250c0cb00d06687b06322aeb6c0379f2.cloudfront.net (CloudFront)', 'X-Amz-Cf-Pop': 'LAX50-P2', 'X-Amz-Cf-Id': 'x7xDKl0DPtcu1HVYW1F195TxjzIFXXidypaRpUEAztn1_wsdr8ZzlQ=='})
HTTP response body: {"message":"No authentication bearer token specified in authorization header.","code":"authentication.required","status":401,"contextId":"a6a78557-6615-4bbe-85f1-838b1673e2c4","details":[],"errors":[]}

You forgot to pass in the apiclient. Refer to the example here showing how to specify the apiclient when constructing an api instance: https://developer.genesys.cloud/devapps/sdk/docexplorer/purecloudpython/#client-credentials-grant.

apiclient = PureCloudPlatformClientV2.api_client.ApiClient().get_client_credentials_token(os.environ['CLIENT_ID'], os.environ['CLIENT_SECRET'])
authApi = PureCloudPlatformClientV2.AuthorizationApi(apiclient)

api_instance= PureCloudPlatformClientV2.ConversationsApi(apiclient)
page_size= 1000
page_number= 1
interval= '2024-02-06T00:00:00Z/2024-02-10T00:00:00Z'

try:
# Get call history
# api_response = api_instance.get_conversations_calls_history(page_size=page_size, page_number=page_number, interval=interval)
api_response = api_instance.get_conversations_calls_history(interval=interval)
pprint(api_response)
except ApiException as e:
print("Exception when calling ConversationsApi->get_conversations_calls_history: %s\n" % e)

output:
{'entities': [],
'first_uri': '/api/v2/conversations/calls/history?pageSize=0&pageNumber=1',
'last_uri': '/api/v2/conversations/calls/history?pageSize=0&pageNumber=1',
'next_uri': None,
'page_count': 0,
'page_number': 1,
'page_size': 0,
'previous_uri': None,
'self_uri': '/api/v2/conversations/calls/history?pageSize=0&pageNumber=1',
'total': 0}

When i run the api from https://developer.genesys.cloud/devapps/api-explorer and execute the the time frame the output is different on the call history

{
  "entities": [
    {
      "id": "b20905b3-ef02-40eb-8761-XXX",
      "participants": [
        {
          "id": "c94c26c8-a06a-4f38-b700-XXX",
          "name": "Northbrook IL",
          "address": "tel:+1847989XXX",
          "startTime": "2024-02-09T17:19:50.010Z",
          "endTime": "2024-02-09T17:23:26.525Z",
          "purpose": "customer",
          "direction": "inbound",
          "ani": "tel:+18479893176",
          "dnis": "tel:+16576568931",
          "disconnectType": "endpoint",
          "externalContact": {
            "id": "c72ea53d-28f6-4a9e-bbc2-XXX",
            "selfUri": "/api/v2/externalcontacts/contacts/c72ea53d-28f6-4a9e-bbc2-XXX"
          },
          "didInteract": true,
          "sipResponseCodes": []
        },

That looks right. Client credentials don't make calls, so they don't get any call history. Your user can make calls, so your user can have call history.

what would i use to view all call history so that i can pull the from the api? When i execute it from the developer tool i use my admin account and i don't do any calls.

how do I change it to view on all call history from a specific time frame?

You don't. Use analytics. https://developer.genesys.cloud/analyticsdatamanagement/analytics/