Hello,
I would like to return latest meeting booked for customer so I could then change its status afterwards. With below code I was able to return booked meeting, however it is not ordered to show most recently booked.
import hubspot
from pprint import pprint
from hubspot.crm.objects.meetings import ApiException
API_KEY = "xxx"
def main(event):
# Use inputs to get data from any action in your workflow and use it in your code instead of having to use the HubSpot API.
client = hubspot.Client.create(access_token=API_KEY)
try:
api_response = client.crm.objects.meetings.basic_api.get_page(limit=1, archived=False)
meeting_dict = api_response.results[0]
pprint(api_response)
meeting_id = meeting_dict.id
except ApiException as e:
print("Exception when calling basic_api->get_page: %s\n" % e)
#email = event["inputFields"]["email"]
# Return the output data that can be used in later actions in your workflow.
return {
"outputFields": {
"meeting_id": meeting_id
}
}
Is there a method to order results of the query?
Regards,
Damian.