Schedule Groups response has missing quotes and malformed data

Good day All,

I am running into an issue with the following request response on Python SDK.
scheduleGroups = architectApi.get_architect_schedulegroups(page_size=100)
The Date fields values are coming back as below:
'date_created': datetime.datetime(2020, 9, 28, 8, 59, 59, 502000, tzinfo=tzutc()),
'date_modified': datetime.datetime(2023, 5, 24, 9, 38, 18, 972000, tzinfo=tzutc()),

This causes issues when trying to work with the JSON as the value is not encapsulated in quotes.
I'm also not sure why it shows the value as datetime.datetime, is this not supposed to be a text str value?

I am expecting the results to match the API Explorer results:
image

Any assistance and or clarity would be much appreciated.

Hi Dewald,

The Python SDK returns a Python object and not a JSON object. The SDKs provide native language wrappers for all request and response calls. If you want to parse the native JSON from the Python object, you can use the following function in the utils.py function: platform-client-sdk-python/utils.py at 7ebc0a17b6d66c6c4cf5b5f8f60354feafea273c · MyPureCloud/platform-client-sdk-python · GitHub

Thanks,
John Carnell
Director, Developer Engagement

1 Like

Thanks John, could you advise how to call/import this module?
Edit: Is the utils.py installed with the SDK or do i need to get it?

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