We are not able to access below API.
POST /api/v2/conversations/participants/attributes/search
Any suggestion or sample code will be appreciated
We are not able to access below API.
POST /api/v2/conversations/participants/attributes/search
Any suggestion or sample code will be appreciated
That's because it's a Preview API, not a public one -
POST /api/v2/conversations/participants/attributes/search
Refer to the header at the top of the page for more information.
The API is tracked here Provide customers real-time access to all | Genesys Cloud Ideas Portal (aha.io).
I think access to that portal requires the partner to give you access. Maybe reach out to your Genesys partner and check with them.
Here is the code that i used. All Credentials are fake here. We are able to get data in postman Genesys has allowed my account for review. Any quick help will be appriciated
pip install PureCloudPlatformClientV2
import time
import base64, sys, requests, os
from datetime import datetime, timedelta
import PureCloudPlatformClientV2
from pprint import pprint
from PureCloudPlatformClientV2.rest import ApiException
from pyspark.sql.types import *
import json
AppName = 'Reporting'
CLIENT_ID = dbutils.secrets.get(scope="scope key",key="api--clientid")
CLIENT_SECRET = dbutils.secrets.get(scope="scope key",key="api-clientsecret") #
ORG_REGION = os.environ['GENESYS_CLOUD_REGION'] # eg. us_east_1
region = PureCloudPlatformClientV2.PureCloudRegionHosts[ORG_REGION]
PureCloudPlatformClientV2.configuration.host = region.get_api_host()
tBase = "https://login.usw2.pure.cloud"
aBase = "https://developer.genesys.cloud/platform/preview-apis"
stTm = time.time()
apiclient = PureCloudPlatformClientV2.api_client.ApiClient().get_client_credentials_token(CLIENT_ID,CLIENT_SECRET)
authApi = PureCloudPlatformClientV2.AuthorizationApi(apiclient)
access_token = apiclient.access_token
def getattributesList():
userCount = 0
url_participants = '/api/v2/conversations/participants/attributes/search'
usDict = {}
jD = access_token
ahs2 = {"Authorization": "{} {}".format('Bearer', access_token), "Content-Type": "application/json" }
#data = {"type": "EXACT","fields": ["conversationId"],"values": ["ABCDEDF-99CC-4C19-BBC6-000006C4BEA6","ABCDEDF-C999-428E-9959-00000840B683"]}
data = {"type": "DATE_RANGE","fields": ["startTime"],"startValue": "2022-02-09T00:00:00.000Z","endValue": "2022-03-10T00:00:00.000Z"}
resp2 = requests.post("{}{}{}".format(aBase, url_participants, data), headers=ahs2)
print(resp2.content)
enTm = time.time()
toTm = float((enTm - stTm) / 60)
print('\n Completed {} {} minutes!'.format(userCount, toTm))
getattributesList()Preformatted text
We do have access to preview API and able to access in postman.
You'll probably need to open a support case then so they can investigate you properly.
This topic was automatically closed 31 days after the last reply. New replies are no longer allowed.