Hey - im using python but im unable to loop through my API response. Im using the search api and the api response looks something like this. What I need are the values of the properties. Basically I need the firstname and hs_object_id of each user. I have also tried this out on my own but the last line (print(i)) only gives me the words of the properties
api_response = client.crm.contacts.search_api.do_search(public_object_search_request=public_object_search_request)
for data in api_response._results:
for i in data._properties:
print(i)
{'paging': None,
'results': [{'archived': False,
'archived_at': None,
'created_at': datetime.datetime(2024, 3, 27, 9, 13, 6, 633000, tzinfo=tzutc()),
'id': '1111',
'properties': {'createdate': '2024-03-27T09:13:06.633Z',
'firstname': 'Name1',
'hs_object_id': '1111'},
'properties_with_history': None,
'updated_at': datetime.datetime(2024, 4, 25, 5, 33, 40, 551000, tzinfo=tzutc())},
{'archived': False,
'archived_at': None,
'created_at': datetime.datetime(2024, 2, 26, 7, 31, 57, 197000, tzinfo=tzutc()),
'id': '1112',
'properties': {'createdate': '2024-02-26T07:31:57.197Z',
'firstname': 'Name2',
'hs_object_id': '1112',
},
'properties_with_history': None,
'updated_at': datetime.datetime(2024, 4, 25, 7, 19, 58, 332000, tzinfo=tzutc())},