Do you know how to get the data with correct json format that can be read and convert to csv?

I am using the following codes to extract PureCloud Analytics data via API.

api_instance = PureCloudPlatformClientV2.AnalyticsApi()
body = PureCloudPlatformClientV2.UserDetailsQuery() # UserDetailsQuery | query 
body.interval = "2021-01-01T01:01:59/2021-01-02T01:01:59"
json_class = api_instance.post_analytics_users_details_query(body)
json_string = json_class.__str__()

And got the result like below json format.

I've tried to use Python or Databricks dataframe to open and read this data, but failed with the following error.
error: _corrupt_record: string (nullable = true)

Do you know how to get the data with correct json format that can be read and convert to csv?

Hi,

Sorry, my answer to your previous question wouldn't work in that situation.
All models implement a to_json method so you could use json_class.to_json() to represent the response as valid JSON.

Thank you so much, it works now.

This topic was automatically closed 31 days after the last reply. New replies are no longer allowed.